Learn R Programming

VGAMextra (version 0.0-6)

expQlink: Link functions for the quantiles of several 1--parameter continuous distributions.

Description

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

Usage

expQlink(theta, p = stop("Argument 'p' must be entered."),
           bvalue = NULL, inverse = FALSE,
           deriv = 0, short = TRUE, tag = FALSE)

Value

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.

Arguments

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 Links.

Author

V. Miranda and Thomas W. Yee.

Details

This is a link function to model any fixed quantile, say \(\xi_p\), of the exponential distribution. It is called the expQlink transformation and is defined as $$ \log (1 - p)^{-1/\lambda},$$ where \(\lambda\) is positive as in exponential.

Numerical values of \(\lambda\) or \(p\) out of range may result in Inf, -Inf, NA or NaN.

See Also

exponential, Links.

Examples

Run this code
 ## 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)
    
# \donttest{
  ##  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"))
  # }

Run the code above in your browser using DataLab