Skip to contents

Given output from a random intercept model, compute the "X" and "Y" variables needed for the least squares reparametrization.

Usage

loss_maha(YY, y_hat, m_scale)

Arguments

YY

m x n matrix of response variables

y_hat

n x 1 vector of fitted values (common across the m replicates)

m_scale

the Mahalanobis scale factor 1/(sigma_e^2/sigma_u^2 + m)

Value

The Mahalanobis loss (scalar)