# NOT RUN {
logit("a")
logit("a", short = FALSE)
logit("a", short = FALSE, tag = TRUE)
logoff(1:5, offset = 1) # Same as log(1:5 + 1)
powerlink(1:5, power = 2) # Same as (1:5)^2
# }
# NOT RUN {
# This is old and no longer works:
logoff(1:5, earg = list(offset = 1))
powerlink(1:5, earg = list(power = 2))
# }
# NOT RUN {
fit1 <- vgam(agaaus ~ altitude, binomialff(link = "cloglog"), hunua) # best
fit2 <- vgam(agaaus ~ altitude, binomialff(link = cloglog ), hunua) # okay
# }
# NOT RUN {
# This no longer works since "clog" is not a valid VGAM link function:
fit3 <- vgam(agaaus ~ altitude, binomialff(link = "clog"), hunua) # not okay
# No matter what the link, the estimated var-cov matrix is the same
y <- rbeta(n = 1000, shape1 = exp(0), shape2 = exp(1))
fit1 <- vglm(y ~ 1, betaR(lshape1 = "identitylink", lshape2 = "identitylink"),
trace = TRUE, crit = "coef")
fit2 <- vglm(y ~ 1, betaR(lshape1 = logoff(offset = 1.1),
lshape2 = logoff(offset = 1.1)), trace = TRUE)
vcov(fit1, untransform = TRUE)
vcov(fit1, untransform = TRUE) - vcov(fit2, untransform = TRUE) # Should be all 0s
\dontrun{ # This is old:
fit1@misc$earg # Some 'special' parameters
fit2@misc$earg # Some 'special' parameters are here
}
par(mfrow = c(2, 2))
p <- seq(0.05, 0.95, len = 200) # A rather restricted range
x <- seq(-4, 4, len = 200)
plot(p, logit(p), type = "l", col = "blue")
plot(x, logit(x, inverse = TRUE), type = "l", col = "blue")
plot(p, logit(p, deriv = 1), type = "l", col = "blue") # 1 / (p*(1-p))
plot(p, logit(p, deriv = 2), type = "l", col = "blue") # (2*p-1)/(p*(1-p))^2
# }
Run the code above in your browser using DataLab