y = 1:5 # Knight, p.304
w = c(63, 14, 5, 1, 2)
fit = vglm(y ~ 1, zetaff, trace=TRUE, wei=w, crit="c")
(phat = Coef(fit)) # 1.682557
cbind(dzeta(y, phat) * sum(w), w)
weighted.mean(y, w)
fitted(fit, mat=FALSE)
predict(fit)
# MLE should satisfy the following:
mean(log(rep(y, w))) + zeta(1+phat, deriv=1)/zeta(1+phat) # Should be 0
Run the code above in your browser using DataLab