Extract Log-Likelihood of a Normal-Block Model
Source:R/NormalBlockBase-S3methods.R
logLik.NormalBlockBase.RdReturns 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, ...)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)
#> 'log Lik.' -640.7911 (df=48)