loglikelihood {cpr}R Documentation

Determine the (quasi) Log Likelihood for a regression object.

Description

Return, via logLik or a custom S3 method, the (quasi) log likelihood of a regression object.

Usage

loglikelihood(x, ...)

Arguments

x

a regression fit object

...

passed through to logLik

Details

This function is used by cpr and cnr to determine the (quasi) log likelihood returned in the cpr_cpr and cpr_cnr objects.

Generally this function defaults to logLik. Therefore, if an S3 method for determining the (quasi) log likelihood exists in the workspace everything should work. If an S3 method does not exist you should define one.

See methods(loglikelihood) for a list of the provided methods. The default method uses logLik.

Value

the numeric value of the (quasi) log likelihood.

See Also

cpr cnr logLik

Examples


fit <- lm(mpg ~ wt, data = mtcars)
stats::logLik(fit)
cpr:::loglikelihood(fit)


[Package cpr version 0.4.0 Index]