rayleighQlink {VGAMextra} | R Documentation |
Link functions for the quantiles of several 1–parameter continuous distributions
Description
Computes the rayleighQlink
transformation, its inverse and the
first two derivatives.
Usage
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 |
p |
Numeric. A single value between 0.0 and 1.0.
It is the |
bvalue , inverse , deriv , short , tag |
See |
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
Examples
## 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)