## The link and its inverse ##
theta <- 0.1 + 1:10
eta <- maxwellMlink(maxwellMlink(theta = theta), inverse =TRUE)
summary(eta - theta) # Zero
eta <- rayleighMlink(rayleighMlink(theta = theta), inverse =TRUE)
summary(eta - theta) # Zero
## Modelling the mean of the Maxwell distribution ##
set.seed(17010401)
rate <- maxwellMlink(theta = 2, inverse = TRUE) # ~ 0.046
mdata <- data.frame(y = rmaxwell(1000, rate = rate ))
fit <- vglm(y ~ 1, maxwell(link = "maxwellMlink"),
data = mdata, trace = TRUE, crit = "coef")
coef(fit, matrix = TRUE)
Coef(fit)
Run the code above in your browser using DataLab