fitted.NormalBlockBase: Extract Fitted Values

View source: R/NormalBlockBase-S3methods.R

fitted.NormalBlockBaseR Documentation

Extract Fitted Values

Description

Extract the fitted values of a normal-block model, on the original scale of Y. For the variance-block models, they include the posterior mean of the latent block signals, ⁠X B + E[W] C'⁠; for the mean-block models, they are ⁠X B C'⁠ (with the posterior cluster probabilities when the clustering is unknown). Zero-inflated models set the observed zeros to 0.

Usage

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

Arguments

object

An object of class NormalBlockBase.

...

not used, only here for S3 compatibility

Value

A matrix of fitted values extracted from the object.

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))
head(fitted(model)[, 1:5])

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