aic: Information Criterion for model selection

Description Usage Arguments Details Examples

View source: R/aic.R

Description

Used for model selection.

Usage

1
2
aic(model)
bic(model)

Arguments

model

A model.

Details

aic() is to be used when comparing lags. bic() is to be used when comparing lags & leads.

Examples

1
2
3
4
5
6
7
8
9
## The functions are currently defined as
aic <- function(model){
  n <- df.residual(model) + length(variable.names(model))
  log(sum(resid(model) ^ 2) / n) + (length(variable.names(model)) / n) * 2
} 
bic <- function(model){
    n <- df.residual(model) + length(variable.names(model))
    log(sum(resid(model) ^ 2) / n) + length(variable.names(model)) * log(n) / n
  }

efriedland/friedland documentation built on Feb. 9, 2021, 11:53 a.m.