devfun_mer | R Documentation |
Creates a deviance function for a fitted model object, using \theta
and sigma
as the parameters.
devfun_mer(x)
devfun_mer2(x)
x |
A fitted merMod object from |
The built-in function(s) in lme4 for generating deviance function are not exported and rely on C++ code. This function is mainly used to obtain Hessian and asymptotic covariance matrix of the random effects.
A deviance function with one argument th_sig
that takes input
of a numeric vector corresponding to the some estimated values of
\theta
and \sigma
. For devfun_mer2
, a function with
one argument theta
that profiles out \sigma
and only takes
input of elements for \theta
.
Bates, D., M\"achler, M., Bolker, B. M., & Walker, S. C. Fitting linear mixed-effects models using lme4. Retrieved from https://cran.r-project.org/web/packages/lme4/vignettes/lmer.pdf
Implementation in lme4pureR: https://github.com/lme4/lme4pureR/blob/master/R/pls.R
library(lme4)
fm01ML <- lmer(Yield ~ (1 | Batch), Dyestuff, REML = FALSE)
dd <- devfun_mer(fm01ML)
# Asymptotic variance-covariance matrix of (theta, sigma):
2 * solve(numDeriv::hessian(dd, c(fm01ML@theta, sigma(fm01ML))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.