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. 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.

Thanks (and sorry for the broken english),
Rubem
	[[alternative HTML version deleted]]

