Learn R Programming

bayesbr (version 0.0.1.0)

AIC_bayesbr: Akaike Information Criterion

Description

A function that receives the estimated model data, uses the information from the loglik and the number of estimated parameters and returns the AIC, an estimator for the quality of the estimation of a model.

Usage

AIC_bayesbr(x)

Arguments

x

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

Value

A number corresponding to the AIC (Akaike Information Criterion) of the estimated model.

Details

Proposed by Akaike (1974) the AIC (Akaike Information Criterion) measures the quality of the adjustment made by the model, when comparing adjusted models with the same data, the smaller the AIC the better the adjustment.

The AIC theory requires that the log-likelihood has been maximized, but as we are in the context of Bayesian statistics, the log-likelihood as explained in the logLik.bayesbr is made with the average of the a priori distribution for each theta and applying this value in the formula to calculate the loglik. The AIC is calculated by $$AIC = 2 * k - 2 * L ,$$ where k is the number of covariates used in the model, and L is the average of the loglik chain returned by the function logLik.bayesbr.

References

10.1109/TAC.1974.1100705 Akaike, H. (1974). A new look at the statistical model identification. IEEE transactions on automatic control, 19(6), 716-723.

See Also

logLik.bayesbr,BIC_bayesbr,DIC_bayesbr

Examples

Run this code
# NOT RUN {
data("CarTask",package = "bayesbr")

car_bayesbr <- bayesbr(probability ~ NFCCscale + task,
                      data = CarTask,iter =100)
aic = AIC_bayesbr(car_bayesbr)
# }

Run the code above in your browser using DataLab