Skip to content

Simple function to calculate the AIC/BIC of autoregresive model with N lags.

Notifications You must be signed in to change notification settings

IanMullins/InfoCrit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

InfoCrit

This is a simple function that I ended up using quite often.

InfoCrit() returns a vector containing the AICs or BICs for autoregressive models of a given variable for lags 0:n .

Simple usage instructions

1.Download a copy of this function onto your machine

2.Pull the function into your R environment with source("your\path\InfoCrit")

3.The function can now be called like any other InfoCrit(data_, column, lags, Type)

Parameters

  • data_

Expects a dataframe containing atleast 1 named variable

  • column

String - Name of the column of the dataframe to be used in the AR model.

  • lags

int - Number of lags in the highest order model you want to run.

  • Type

String - Default = "AIC" , but also allows "BIC".At some point I may add others.

Technical Considerations

Formula used to calculate the AIC:

equation

Formula used to calculate the BIC:

equation

Where

  • equation

  • T is the total number of time periods

This may not agree with other R functions used to calculate Information criterion as they sometimes use different formulas.

Acknowledgments

Wesely Bundell Ph.D. http://www.wesleyblundell.com/ for assigning the homework that made this necessary.

About

Simple function to calculate the AIC/BIC of autoregresive model with N lags.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages