rayleighQlink: Link functions for the quantiles of several 1-parameter...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/contsDistQlinks.R

Description

Computes the rayleighQlink transformation, its inverse and the first two derivatives.

Usage

1
2
3
4
  rayleighQlink(theta, p = stop("Argument 'p' must be specified."),
                bvalue = NULL, inverse = FALSE,
                deriv = 0, short = TRUE, tag = FALSE)
  

Arguments

theta

Numeric or character. It is theta by default, although it may be eta. See Links for additional details about this.

p

Numeric. A single value between 0.0 and 1.0. It is the p–quantile to be modeled by this link function.

bvalue, inverse, deriv, short, tag

See Links.

Details

This link function directly models any p–quantile of the Rayleigh distribution specified by the argument p. It is called the rayleighQlink transformation defined as

b * sqrt(-2 * log(1 - p)),

where b > 0 is a scale parameter as in rayleigh.

Numerical values of b or p out of range may result in Inf, -Inf, NA or NaN.

If theta is character, then arguments inverse and deriv are discarded.

Value

For deriv = 0, the rayleighQlink transformation of theta, when inverse = FALSE. If inverse = TRUE, then this function returns theta / sqrt(-2 log(1 - p)).

For deriv = 1, then the function returns d eta / d theta, if inverse = FALSE. If inverse = TRUE, then d theta / d eta as a function of theta.

If deriv = 2, then the second order derivatives in terms of theta.

Note

Numerical instability may occur for values theta too close to zero. Use argument bvalue to replace them before computing the link.

Author(s)

V. Miranda and Thomas W. Yee.

See Also

rayleigh, Links.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 ## E1. rayleighQlink() and its inverse ##
  p <- 0.50                           ## Modeling the median
  my.b <- seq(0, 5, by = 0.1)[-1]
  max(my.b - rayleighQlink(rayleighQlink(my.b, p = p), p = p, inverse  =TRUE)) ## Zero


 ## E2. Special values ##
  rayleighQlink(theta = c(Inf, -Inf, NA, NaN), p = p)
    
    
 ## E3. Use of argument 'bvalue' ##
  rayleighQlink(theta = seq(-0.2, 1.0, by = 0.1), p = p)  # WARNING: NaNs if theta <= 0
  rayleighQlink(theta = seq(-0.2, 1.0, by = 0.1), p = p, bvalue = .Machine$double.xmin)
    

VGAMextra documentation built on May 24, 2021, 9:07 a.m.