logLik.bayesbr: Model Log Likelihood for 'bayesbr' Objects

Description Usage Arguments Details Value References See Also Examples

View source: R/logLik.bayesbr.R

Description

A function that receives the information from the estimated model, the response variable and the theta and zeta chains and returns a vector containing loglik values for each iteration excluding warmups.

Usage

1
2
## S3 method for class 'bayesbr'
logLik(object,...)

Arguments

object

an object of the class bayesbr, containing the list returned from the bayesbr function.

...

further arguments passed to or from other methods.

Details

Loglik is commonly used to measure fit quality, or to assess whether an fit has converged. The loglik is calculated using maximum likelihood, but as we are in the Bayesian context we will use the mean of the posterior distribution of the parameters, so the calculation occurs from an adaptation of the original form to the loglik.

Value

The function returns a list with

loglik

A vector with the estimated model loglik chain,

matrix_loglik

A matrix with all loglik's chain.

References

doi: 10.1080/0266476042000214501 Ferrari, S.L.P., and Cribari-Neto, F. (2004). Beta Regression for Modeling Rates and Proportions. Journal of Applied Statistics, 31(7), 799–815.

See Also

bayesbr,residuals.bayesbr,loglikPlot

Examples

1
2
3
4
5
6
data("CarTask", package = "bayesbr")
bbr = bayesbr(probability~task + NFCCscale, iter = 100,
             data=CarTask, mean_betas = c(1, 0.5,1.2))
loglik = bbr$loglik

loglikPlot(loglik)

bayesbr documentation built on July 17, 2021, 1:07 a.m.