predict.NormalBlockBase: Predict Method for Normal-Block Models

View source: R/NormalBlockBase-S3methods.R

predict.NormalBlockBaseR Documentation

Predict Method for Normal-Block Models

Description

Predicts the mean of the observations Y for new covariates X, on the original scale of Y: ⁠B' X⁠ for the variance-block models (the latent block signals, centered, average out; unlike fitted(), which adds their posterior mean for the training observations), ⁠C B' X⁠ for the mean-block models. For zero-inflated models, the mean of the Gaussian component.

Usage

## S3 method for class 'NormalBlockBase'
predict(object, new_X, ...)

Arguments

object

An object of class NormalBlockBase.

new_X

New set of covariates.

...

not used, only here for S3 compatibility

Value

A n*p prediction matrix for new observations

Examples

ex_data <- generate_normal_block_var_data(n = 50, p = 20, d = 1, q = 3)
data <- NormalBlockData$new(ex_data$Y, ex_data$X)
model <- normal_block(data, blocks = 3, control = NB_control(verbose = FALSE))
predict(model, ex_data$X[1:3, , drop = FALSE])[, 1:5]

normalblockr documentation built on Nov. 24, 2026, 1:06 a.m.