Learn R Programming

bayesbr (version 0.0.1.0)

logLik.bayesbr: Model Log Likelihood for bayesbr Objects

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

# S3 method for 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.

Value

The function returns a list with

matrix_loglik

A matrix with all loglik's chain.

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.

References

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<U+2013>815.

See Also

bayesbr,residuals.bayesbr,loglikPlot

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab