A small lme4::getME() vocabulary, for downstream code written
against merMod objects. Registered on lme4's generic, so call it as
lme4::getME(fit, "X") or load lme4 first.
Details
Supported names:
"X"Fixed-effect design matrix of the
mupredictor."Z","Zt"The sparse random-effect design of the
mupredictor and its transpose. Columns (rows ofZt) span the whole random-effect coefficient vector, so a block belonging to another distributional parameter contributes zero columns here."beta","fixef"The primary (
mu-family) fixed-effect coefficients, named. Coefficients of auxiliary distributional parameters are a separate vector; usefixef()for all of them."b"Conditional modes in coefficient space, aligned with the columns of
Z. Reduced-rank (rr()) blocks are expanded through their loadings, so this is not the internal parameter vector."theta"Covariance parameters on the internal (unconstrained) scale, as in
confint(). These are not lme4's relative-covariance-factor entries."lower"Lower bounds on
theta. The internal parameterization is unbounded, so this is a vector of-Inf, not lme4's mixture of0and-Inf. Code that teststheta == lowerto detect a singular fit will never fire; usediagnose()orVarCorr()instead."sigma"Residual standard deviation (
sigma.frmtmb_fit())."flist"The grouping factors, one per distinct grouping variable. Smooth and Gaussian-process blocks are excluded: their levels are basis functions, not groups. There is no
"assign"attribute."n_rtrms","n_rfacs"Number of random-effect terms and of distinct grouping factors.
Multivariate fits have one design per response, so "X", "Z" and
"Zt" need resp; the other names answer without it.
Examples
if (requireNamespace("lme4", quietly = TRUE)) {
set.seed(1)
dd <- data.frame(x = rnorm(100), g = factor(rep(1:10, 10)))
dd$y <- rnorm(100, 1 + 0.5 * dd$x + rnorm(10, 0, 0.8)[dd$g], 1)
fit <- frm(bf(y ~ x + (1 | g)) + gaussian(), data = dd)
# the designs, for downstream code written against merMod objects
dim(lme4::getME(fit, "X"))
dim(lme4::getME(fit, "Zt"))
# a vector of names returns a named list
str(lme4::getME(fit, c("n_rtrms", "n_rfacs", "sigma")))
# the conditional modes in coefficient space, aligned with Z
head(lme4::getME(fit, "b"))
# note: "lower" is all -Inf here, because the internal covariance
# parameterization is unbounded. Use diagnose() to spot a singular
# fit, not theta == lower.
lme4::getME(fit, "lower")
}
#> List of 3
#> $ n_rtrms: int 1
#> $ n_rfacs: int 1
#> $ sigma : num 0.966
#> theta_1
#> -Inf