y = 1:6
w = c(1486, 694, 195, 37, 10, 1) # Data from Coleman and James (1961)
fit = vglm(y ~ 1, pospoisson, weights=w)
Coef(fit)
summary(fit)
fitted(fit)
# Artificial data
x = runif(n <- 1000)
lambda = exp(1 - 2*x)
y = rpospois(n, lambda)
table(y)
fit = vglm(y ~ x, pospoisson, trace=TRUE, crit="c")
coef(fit, matrix=TRUE)
Run the code above in your browser using DataLab