On 04/02/14 20:12, IamRandom wrote:
I am running a simple example of GLM. If I include weights when family="poisson" then the weights are calculated iteratively and $weights and $prior.weights return different values. The $prior.weights are what I supplied and $weights are the "posterior" weights of the IWLS. If I include weights with family="gaussian" then the weights are static and $weights and $prior.weights return the same values; it seems to ignore IWLS algorithm procedure. I really want the family="poisson" to behave like the family="gaussian" and use the static weights. Thoughts?
As far as I understand things, your desideratum makes no sense. The prior weights and the just-plain-weights are very different creatures. The reason they wind up being the same for the gaussian family is that for the gaussian family the likelihood is maximized by least squares; there is no need for iteration or for re-weighting.
The poisson family cannot behave like the gaussian family because for the poisson family (or any family *other* than gaussian) iteration is necessary in order to maximize the likelihood.
You might get some insight into what's going on if you were to read Annette Dobson's book "An Introduction to Generalized Linear Models"
(Chapman and Hall, 1990). cheers, Rolf Turner ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.