logLik.NormalBlockBase: Extract Log-Likelihood of a Normal-Block Model

View source: R/NormalBlockBase-S3methods.R

logLik.NormalBlockBaseR Documentation

Extract Log-Likelihood of a Normal-Block Model

Description

Returns the (variational) log-likelihood of a fitted normal-block model as a "logLik" object, compatible with stats::AIC() and stats::BIC().

Usage

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

Arguments

object

An object of class NormalBlockBase.

...

not used, only here for S3 compatibility

Value

An object of class "logLik". The numeric value is the log-likelihood or its variational lower bound (ELBO), on the scale of the data the model was fitted on (rescaled or not, see NormalBlockData); use the heldout_loglik() method for a log-likelihood on Y's original scale. Attributes df and nobs hold the number of parameters and 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))
logLik(model)

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