Description Usage Arguments Details Examples
Used for model selection.
1 2 |
model |
A model. |
aic() is to be used when comparing lags. bic() is to be used when comparing lags & leads.
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
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.