[R] Extracting AICc and BIC from an ARIMA model.

David Winsemius dwinsemius at comcast.net
Sat Oct 19 19:32:40 CEST 2013


On Oct 19, 2013, at 3:44 AM, Chris89 wrote:

> Hi everyone!
> 
> I am making some time series models, and as i want to compare a lot of
> models I thought it would be smart to compare the AIC, AICc and BIC values
> from the models. My question is, how can I extract the BIC and AICc from the
> model?
> 
> As an example:
> 
> kings <- scan("http://robjhyndman.com/tsdldata/misc/kings.dat",skip=3)
> mod = arima(kings, order = c(1,0,0), include.mean=T)
> 
> obviously summary(mod) would suffice,

How would that "obviously" suffice? There is no summary.Arima function, at least that I see. (Maybe you have loaded an additonal package that you were asked to tell us about?)


> but I don't want to have to look
> through all the models (as there are alot... )

The models already have an "aic" element:

> modList <-list(mod,mod2);  sapply(modList, "[", "aic")
$aic
[1] 352.8227

$aic
[1] 352.8227

(Please read the Fine Posting Guide.)

-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list