expQlink {VGAMextra} | R Documentation |
Computes the expQlink
transformation, its inverse and
the first two derivatives.
expQlink(theta, p = stop("Argument 'p' must be entered."), bvalue = NULL, inverse = FALSE, deriv = 0, short = TRUE, tag = FALSE)
theta |
Numeric or character. This is theta although may be eta depending on the other parameters. See below for further details. |
p |
Numeric. A prespecified number between 0 and 1. The particular p–quantile to be modelled. For example, p = 0.5 means that the median is considered by this link function. |
bvalue, inverse, deriv, short, tag |
See |
This is a link function to model any fixed quantile, say
ξ[p], of the exponential distribution.
It is called the expQlink
transformation and is defined as
-log(1 - p) / rate,
where rate is positive as in
exponential
.
Numerical values of rate or p out of range may
result in Inf
, -Inf
, NA
or NaN
.
With deriv = 0
, the expQlink
transformation of
theta
for prespecified p when inverse = FALSE
.
If inverse = TRUE
, then the inverse -log(1 - p)/theta
.
For deriv = 1
, this link function returns
d eta
/ d theta
when inverse = FALSE
.
If inverse = TRUE
, then
d theta
/ d eta
as a function of
theta
.
Similarly, when deriv = 2
, the second derivatives in
terms of theta
are returned.
Numerical instability may occur for values theta
too close
to zero. Use argument bvalue
to replace them before
computing the link.
If theta
is character, then arguments inverse
and
deriv
are ignored. See Links
for further details.
V. Miranda and Thomas W. Yee.
## E1. expQlink() and its inverse ## p <- 0.25 # Modelling the first quartile. my.theta <- seq(0, 5, by = 0.1)[-1] my.diff <- my.theta - expQlink(expQlink(my.theta, p = p), p = p, inverse =TRUE) summary(my.diff) # Zero ## E2. Special values ## expQlink(theta = c(Inf, -Inf, NA, NaN), p = p) ## E3. Plot of expQlink() for different quantiles ## plot(expQlink(my.theta, p = p) ~ my.theta, type = "l", lty = "dotted", col = "blue", lwd = 2, main = "expQink(p) transformation", xlab = "theta", ylab = "expQLink", xlim = c(-0.5, 5), ylim = c(-0.5, 5)) abline(h = 0, v = 0, lwd = 2) lines(my.theta, expQlink(my.theta, p = 0.50), col = "green", lty = "dotted", lwd = 2) lines(my.theta, expQlink(my.theta, p = 0.75), col = "red", lty = "dotted", lwd = 2) legend(2, 4, c("p = 0.25", "p = 0.50", "p = 0.75"), col = c("blue", "green", "red"), lwd = c(2, 2, 2), lty = c("dotted", "dotted", "dotted"))