rayleighQlink {VGAMextra} | R Documentation |
Computes the rayleighQlink
transformation, its inverse and the
first two derivatives.
rayleighQlink(theta, p = stop("Argument 'p' must be specified."), bvalue = NULL, inverse = FALSE, deriv = 0, short = TRUE, tag = FALSE)
theta |
Numeric or character. It is theta by default, although
it may be eta. See |
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 |
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.
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
.
Numerical instability may occur for values theta
too close
to zero. Use argument bvalue
to replace them before
computing the link.
V. Miranda and Thomas W. Yee.
## 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)