| cola_glmm | R Documentation |
Fits a generalized linear mixed model with site-level random intercepts using
only one-shot per-site summaries (Ck, Sk, S2k, X0). Each of the
iterations constructs weighted LMM summary statistics which are then solved
by lmm.fit (from DLMM), yielding updated fixed effects and random
intercepts until convergence.
cola_glmm(
summary_by_site,
family = "poisson",
intercept = TRUE,
beta_init = NULL,
u_init = NULL,
max_iter = 50,
tol = 1e-06,
verbose = TRUE
)
summary_by_site |
Named list of site summaries. Each element must contain
|
family |
Character; one of |
intercept |
Logical; whether the fixed-effect design includes an
intercept (affects how |
beta_init |
Optional named numeric vector of initial fixed effects. Defaults to zeros. |
u_init |
Optional named numeric vector of initial site random effects (one per site). Defaults to zeros. |
max_iter |
Integer maximum number of IRLS iterations. Default |
tol |
Convergence tolerance on relative squared parameter change.
Default |
verbose |
Logical; print iteration progress. Default |
Uses canonical links: log for Poisson and logit for binomial. The fixed-effect
covariates in X0 are assumed binary (plus optional Intercept).
For numerically extreme logits, a small weight floor is used internally.
Requires lmm.fit from dlmm.R to be on the search path.
A list with elements:
beta: named fixed-effect estimates
u: named site random-intercept BLUPs
V: variance component matrix for the random intercept
s2: residual scale from the working LMM
iter: number of iterations performed
SiXYZ_last: last iteration's sufficient statistics (by site)
# fit <- cola_glmm(summary_by_site, family = "poisson")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.