logitoffsetlink: Logit-with-an-Offset Link Function

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/linksold.R View source: R/links.q

Description

Computes the logitoffsetlink transformation, including its inverse and the first two derivatives.

Usage

1
2
logitoffsetlink(theta, offset = 0, inverse = FALSE, deriv = 0,
                short = TRUE, tag = FALSE)

Arguments

theta

Numeric or character. See below for further details.

offset

The offset value(s), which must be non-negative. It is called K below.

inverse, deriv, short, tag

Details at Links.

Details

This link function allows for some asymmetry compared to the ordinary logitlink link. The formula is

log(theta/(1-theta) - K)

and the default value for the offset K is corresponds to the ordinary logitlink link. When inverse = TRUE will mean that the value will lie in the interval (K / (1+K), 1).

Value

For logitoffsetlink with deriv = 0, the logitoffsetlink of theta, i.e., log(theta/(1-theta) - K) when inverse = FALSE, and if inverse = TRUE then (K + exp(theta))/(1 + exp(theta) + K).

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.

Here, all logarithms are natural logarithms, i.e., to base e.

Note

This function is numerical less stability than logitlink.

Author(s)

Thomas W. Yee

References

Komori, O. and Eguchi, S. et al., 2016. An asymmetric logistic model for ecological data. Methods in Ecology and Evolution, 7.

See Also

Links, logitlink.

Examples

1
2
3
4
p <- seq(0.05, 0.99, by = 0.01); myoff <- 0.05
logitoffsetlink(p, myoff)
max(abs(logitoffsetlink(logitoffsetlink(p, myoff),
                        myoff, inverse = TRUE) - p))  # Should be 0

Example output

Loading required package: stats4
Loading required package: splines
 [1] -5.940171253 -4.280930518 -3.678184165 -3.298013145 -3.017955410
 [6] -2.795061578 -2.609171320 -2.449188567 -2.308348798 -2.182221411
[11] -2.067745502 -1.962717267 -1.865496796 -1.774830407 -1.689737855
[16] -1.609437912 -1.533297649 -1.460796888 -1.391502706 -1.325050736
[21] -1.261131218 -1.199478415 -1.139862457 -1.082082987 -1.025964134
[26] -0.971350509 -0.918103969 -0.866100987 -0.815230494 -0.765392087
[31] -0.716494545 -0.668454568 -0.621195727 -0.574647556 -0.528744780
[36] -0.483426650 -0.438636360 -0.394320544 -0.350428827 -0.306913434
[41] -0.263728831 -0.220831412 -0.178179205 -0.135731614 -0.093449167
[46] -0.051293294 -0.009226103  0.032789823  0.074791629  0.116816385
[51]  0.158901283  0.201083833  0.243402071  0.285894762  0.328601623
[56]  0.371563556  0.414822897  0.458423682  0.502411949  0.546836061
[61]  0.591747066  0.637199107  0.683249879  0.729961154  0.777399378
[66]  0.825636364  0.874750088  0.924825634  0.975956288  1.028244847
[71]  1.081805170  1.136764055  1.193263490  1.251463423  1.311545158
[76]  1.373715579  1.438212460  1.505311203  1.575333500  1.648658626
[81]  1.725738368  1.807117125  1.893459447  1.985588633  2.084542148
[86]  2.191653532  2.308677607  2.437989730  2.582918804  2.748338720
[91]  2.941803932  3.175968324  3.474551101  3.890799369  4.594614672
[1] 2.220446e-16

VGAM documentation built on Jan. 16, 2021, 5:21 p.m.