## Example 1. Special values for theta (or eta, accordingly) ##
a.par <- c(0, 1:10/10, 20, 1e1, Inf, -Inf, NaN, NA)
# The borel.tannerMlink transformation and the first two derivatives.
print(rbind(a.par,
deriv1 = borel.tannerMlink(theta = a.par, inverse = FALSE, deriv = 1),
deriv2 = borel.tannerMlink(theta = a.par, inverse = FALSE, deriv = 2)),
digits = 2)
# The inverse of 'borel.tannerMlink()' and the first two derivatives.
# 'theta' turns into 'eta'.
print(rbind(a.par,
Invderiv1 = borel.tannerMlink(theta = a.par, inverse = TRUE, deriv = 1),
Invderiv2 = borel.tannerMlink(theta = a.par, inverse = TRUE, deriv = 2)),
digits = 2)
## Example 2 ##
a.param <- c(0, 1, 5, 10, 1e2, 1e3)
rbind(a.values = a.param,
inv.BT = borel.tannerMlink(theta = a.param, inverse = TRUE))
data.inv <- borel.tannerMlink(borel.tannerMlink(a.param, inv = TRUE)) - a.param
summary(data.inv) ## Should be zero
## Example 3. Some link functions in VGAM with domain set (0, 1) ##
a.param <- ppoints(100)
# \donttest{
par(lwd = 2)
plot(a.param, borel.tannerMlink(a.param), ylim = c(-5, 7), xlim = c(-0.01, 1.01),
type = "l", col = "gray10", ylab = "transformation",
las = 1, main = "Some probability link functions")
lines(a.param, logffMlink(a.param), col = "blue")
lines(a.param, logitlink(a.param), col = "limegreen")
lines(a.param, probitlink(a.param), col = "purple")
lines(a.param, clogloglink(a.param), col = "chocolate")
lines(a.param, cauchitlink(a.param), col = "tan")
abline(v = c(0.5, 1), lty = "dashed")
abline(v = 0, h = 0, lty = "dashed")
legend(0.05, 7, c("borel.tanneMlink", "logffMlink", "logitlink", "probitlink",
"clogloglink", "cauchitlink"),
col = c("gray10", "blue", "limegreen", "purple", "chocolate", "tan"),
lwd = 1)
par(lwd = 1)
# }
Run the code above in your browser using DataLab