torch_openreml.blup

torch_openreml.blup(y, x, z, g, v)[source]

Compute the best linear unbiased predictor (BLUP) of the random effects.

\[\hat{\symbf{b}} = \symbf{G} \symbf{Z}^\top \symbf{V}^{-1} \hat{\symbf{e}}\]

where \(\hat{\symbf{e}}\) are the marginal residuals.

Parameters:
  • y (torch.Tensor) – Response vector of shape (n,).

  • x (torch.Tensor) – Fixed-effect design matrix of shape (n, p).

  • z (torch.Tensor) – Random-effect design matrix of shape (n, q).

  • g (torch.Tensor) – Random-effect covariance matrix of shape (q, q), e.g. \(\symbf{G}(\boldsymbol{\theta})\) evaluated at fitted covariance parameters.

  • v (torch.Tensor) – Marginal covariance matrix of shape (n, n), e.g. \(\symbf{V}(\boldsymbol{\theta})\) evaluated at fitted covariance parameters.

Returns:

Random-effect predictions of shape (q,).

Return type:

torch.Tensor