logLik.xpose_data: Log-likelihood, AIC and BIC for 'xpose_data' objects

View source: R/fit_stats.R

logLik.xpose_dataR Documentation

Log-likelihood, AIC and BIC for xpose_data objects

Description

[Experimental]

NONMEM (and nlmixr2) objective function values (OFV) are -2*log-likelihood, so the log-likelihood of a model is derived as -ofv/2. The number of estimated parameters (thetas, and unfixed omegas/sigmas) is used as the degrees of freedom.

Because <stats::AIC> and <stats::BIC> dispatch through <stats::logLik> by default, only logLik.xpose_data needs to be defined here for AIC()/BIC() to work as expected on xpose_data/xp_xtras objects; no AIC/BIC methods are defined for a single model.

Not calculable for a model-averaged ("franken") xpose_data object (eg, the output of <modavg_xpdb>), since such an object does not correspond to a single fitted model; an error is thrown instead.

Usage

## S3 method for class 'xpose_data'
logLik(object, .problem = NULL, .subprob = NULL, .method = NULL, ...)

Arguments

object

<xpose_data> or <xp_xtras> object

.problem

<numeric> Problem number to use. Uses the xpdb default if not provided.

.subprob

<numeric> Subproblem number to use. Uses the xpdb default if not provided.

.method

<numeric> Method to use. Uses the xpdb default if not provided.

...

Not used.

Value

<logLik> object, as documented in <stats::logLik>, with "df" (number of estimated parameters) and "nobs" (number of observations) attributes set.

Examples


logLik(xpdb_x)
AIC(xpdb_x)
BIC(xpdb_x)


xpose.xtras documentation built on Sept. 1, 2026, 5:08 p.m.