An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20120930/853fb2b1/attachment.pl>
Subject-wise log-likelihood gradient and hessian
2 messages · Rubem Kaipper Ceratti, Ben Bolker
Rubem Kaipper Ceratti <rubem_ceratti at ...> writes:
Hi all, I'd like to know if it's possible to extract the subject-wise gradient and hessian of the marginal log-likelihood from a 'mer' object.
Can you explain in slightly greater detail? What are the parameters you're taking the gradient and hessian with respect to -- sounds like the fixed-effect parameters (beta)? How do you define "subject-wise"? The marginal likelihood is only defined with respect to the full data set, isn't it?
Using the 'cbpp' dataset as an example: library(lme4) (m1 <- glmer(size ~ period+(1|herd), cbpp, poisson))
Since apparently there's no way to get what I need directly, I've thought about splitting the data frame by 'herd', updating m1 on each subset and then calling numDeriv::grad() and numDeriv::hessian() on the deviance function of each updated object at the estimates from m1, but I couldn't get this approach to work. Any input is appreciated.
I assume you're already using the development version, as the deviance function is only available in the development version?
Thanks (and sorry for the broken english),
English seems fine -- it's the technical description that's eluding me a bit.