make_glmer_Z_matrix: Reconstruct an Observation-Level Random-Effect Design Matrix

View source: R/wrapper_glmer.R

make_glmer_Z_matrixR Documentation

Reconstruct an Observation-Level Random-Effect Design Matrix

Description

Converts the transposed block random-effect design matrix used internally by 'rtmb_glmer()' into an observation-level matrix. This is kept as a small utility for users who want to work from the block matrix returned by 'make_glmer_re_terms()'.

Usage

make_glmer_Z_matrix(Zt, group_idx, N = length(group_idx))

Arguments

Zt

Transposed block random-effect design matrix.

group_idx

Integer group index for each observation.

N

Number of observations. Defaults to 'length(group_idx)'.

Value

A matrix with 'N' rows and one column per random-effect coefficient.


BayesRTMB documentation built on Nov. 24, 2026, 9:06 a.m.