REML_Rm: Accumulate Residual Prediction-Error Adjustments for a REML...

View source: R/REML_Rm.R

REML_RmR Documentation

Accumulate Residual Prediction-Error Adjustments for a REML Update

Description

Internal interface to the registered compiled residual-covariance update. It adds fixed-effect and fixed/random cross-covariance contributions to the random-effect prediction-error adjustment for each student.

Usage

REML_Rm(
  invsqrtW_,
  JYp_,
  loopsize_,
  patternlength_,
  rownumber_,
  ybetas_,
  etahat_,
  tempmatR_,
  JXpi_,
  JXpp_,
  JXpx_,
  JXpdim_,
  JZpi_,
  JZpp_,
  JZpx_,
  JZpdim_,
  betacov_,
  C12_
)

Arguments

invsqrtW_

Column matrix of observation weights on the inverse square-root scale, indexed by original observation row.

JYp_

Response column matrix for the selected observation pattern.

loopsize_

Number of students sharing the pattern.

patternlength_

Number of observations per student in this pattern.

rownumber_

One-based original row numbers for the pattern observations.

ybetas_

Column matrix of fitted fixed-effect coefficients.

etahat_

Column matrix of predicted random effects.

tempmatR_

Random-effect second-moment matrix: the covariance adjustment plus the outer product of the predicted random effects.

JXpi_, JXpp_, JXpx_, JXpdim_

Compressed sparse-column row indices, column pointers, nonzero values, and dimensions of the pattern's fixed-effects design matrix. Sparse indices and pointers are zero-based.

JZpi_, JZpp_, JZpx_, JZpdim_

Corresponding compressed sparse-column components of the pattern's random-effects design matrix.

betacov_

Fixed-effect block of the inverse mixed-model coefficient matrix.

C12_

Fixed/random cross block of the inverse mixed-model coefficient matrix, with fixed effects in rows and random effects in columns.

Value

A square matrix of accumulated residual second moments and REML prediction-error adjustments, with dimension patternlength_.


GPvam documentation built on Oct. 23, 2026, 1:06 a.m.