sdata <- data.frame(y = rsinmad(n = 1000, exp(1), exp(2), exp(0)))
fit <- vglm(y ~ 1, sinmad, data = sdata, trace = TRUE)
fit <- vglm(y ~ 1, sinmad(ishape1.a = exp(1)), data = sdata, trace = TRUE)
coef(fit, matrix = TRUE)
Coef(fit)
summary(fit)
# Harder problem (has the shape3.q parameter going to infinity)
set.seed(3)
sdata <- data.frame(y1 = rbeta(1000, 6, 6))
# hist(with(sdata, y1))
if (FALSE) {
# This fails
fit1 <- vglm(y1 ~ 1, sinmad, data = sdata, trace = TRUE)
fit1 <- vglm(y1 ~ 1, sinmad, data = sdata, trace = TRUE, maxit = 6,
crit = "coef")
Coef(fit1)
}
# Try this remedy:
fit2 <- vglm(y1 ~ 1, sinmad(ishape3.q = 3, lshape3.q = "loglog"),
data = sdata, trace = TRUE, stepsize = 0.05, maxit = 99)
coef(fit2, matrix = TRUE)
Coef(fit2)
Run the code above in your browser using DataLab