alogitlink: Arcsine-Logit Link Mixtures

View source: R/links.q

alogitlinkR Documentation

Description

Computes some arcsine–logit mixture link transformations, including their inverse and the first few derivatives.

Usage

  alogitlink(theta, bvalue = NULL, taumix.logit = 1,
     tol = 1e-13, nmax = 99, inverse = FALSE, deriv = 0,
     short = TRUE, tag = FALSE, c10 = c(4, -pi))
lcalogitlink(theta, bvalue = NULL, pmix.logit = 0.01,
     tol = 1e-13, nmax = 99, inverse = FALSE, deriv = 0,
     short = TRUE, tag = FALSE, c10 = c(4, -pi))

Arguments

theta

Numeric or character. See below for further details.

bvalue

See Links.

taumix.logit

Numeric, of length 1. Mixing parameter assigned to logitlink. Then 1 - exp(-taumix.log * theta) is used to weight asinlink. Thus a 0 value will result in logitlink and a very large numeric such as 1e4 should be roughly equivalent to asinlink over almost all of the parameter space.

pmix.logit

Numeric, of length 1. Mixing probability assigned to logitlink. Then 1 - pmix.logit is used to weight asinlink. Thus a 0 value will result in asinlink. and 1 is equivalent to logitlink.

tol, nmax

Arguments fed into a function implementing a vectorized bisection method.

inverse, deriv, short, tag

Details at Links.

c10

See asinlink and logitlink.

Details

lcalogitlink is a linear combination (LC) of asinlink and logitlink.

Value

The following holds for the LC variant. For deriv >= 0, (1 - pmix.logit) * asinlink(p, deriv = deriv) + pmix.logit * logitlink(p, deriv = deriv) when inverse = FALSE, and if inverse = TRUE then a nonlinear equation is solved for the probability, given eta. For deriv = 1, then the function returns d eta / d theta as a function of theta if inverse = FALSE, else if inverse = TRUE then it returns the reciprocal.

Warning

The default values for taumix.logit and pmix.logit may change in the future. The name and order of the arguments may change too.

Author(s)

Thomas W. Yee

References

Hauck, J. W. W. and A. Donner (1977). Wald's test as applied to hypotheses in logit analysis. Journal of the American Statistical Association, 72, 851–853.

See Also

asinlink, logitlink, Links, probitlink, clogloglink, cauchitlink, binomialff, sloglink, hdeff, https://www.cia.gov/index.html.

Examples

p <- seq(0.01, 0.99, length= 10)
alogitlink(p)
max(abs(alogitlink(alogitlink(p), inv = TRUE) - p))  # 0?

## Not run: 
par(mfrow = c(2, 2), lwd = (mylwd <- 2))
y <- seq(-4, 4, length = 100)
p <- seq(0.01, 0.99, by = 0.01)

for (d in 0:1) {
  matplot(p, cbind(logitlink(p, deriv = d), probitlink(p, deriv = d)),
          type = "n", col = "blue", ylab = "transformation",
          las = 1, main = if (d == 0) "Some probability link functions"
          else "First derivative")
  lines(p,   logitlink(p, deriv = d), col = "green")
  lines(p,  probitlink(p, deriv = d), col = "blue")
  lines(p, clogloglink(p, deriv = d), col = "tan")
  lines(p,  alogitlink(p, deriv = d), col = "red3")
  if (d == 0) {
    abline(v = 0.5, h = 0, lty = "dashed")
    legend(0, 4.5, c("logitlink", "probitlink", "clogloglink",
           "alogitlink"), lwd = mylwd,
           col = c("green", "blue", "tan", "red3"))
  } else
    abline(v = 0.5, lwd = 0.5, col = "gray")
}

for (d in 0) {
  matplot(y, cbind( logitlink(y, deriv = d, inverse = TRUE),
                   probitlink(y, deriv = d, inverse = TRUE)),
          type  = "n", col = "blue", xlab = "transformation", ylab = "p",
          main = if (d == 0) "Some inverse probability link functions"
          else "First derivative", las=1)
  lines(y,   logitlink(y, deriv = d, inverse = TRUE), col = "green")
  lines(y,  probitlink(y, deriv = d, inverse = TRUE), col = "blue")
  lines(y, clogloglink(y, deriv = d, inverse = TRUE), col = "tan")
  lines(y,  alogitlink(y, deriv = d, inverse = TRUE), col = "red3")
  if (d == 0) {
      abline(h = 0.5, v = 0, lwd = 0.5, col = "gray")
      legend(-4, 1, c("logitlink", "probitlink", "clogloglink",
             "alogitlink"), lwd = mylwd,
             col = c("green", "blue", "tan", "red3"))
  }
}
par(lwd = 1)

## End(Not run)

VGAM documentation built on Sept. 18, 2024, 9:09 a.m.