I would like to extract the AR coefficients from a few models i created with auto.arima
. the problem is that I want to take the sum of the AR coefficients but without the intercept/mean.
bsp_ts <- ts(c(1,2,1,2,3,2,3,2,4,3,4,3,4,5,4,3,5,6,5,4,5,6,7,6))
bsp_auto <- auto.arima(bsp_ts, max.p = 12, max.q = 0, seasonal = FALSE, d=0)
summary(bsp_auto)
sum(coef(bsp_auto))
how can I access only the AR coefficients? I know the coefficients are saved in a list from auto.arima
, thus I think the solutions is to access the coefficients with the corresponding "list language", but I'm still unexperienced with lists. Can anybody help? :) thanks in advance...
Edit: Multiple models
bsp1_ts <- ts(c(1,2,1,2,3,2,3,2,4,3,4,3,4,5,4,3,5,6,5,4,5,6,7,6))
bsp2_ts <- ts(c(1,2,1,2,3,2,3,2,4,3,4,3,4,5,4,3,5,6,5,4,5,6,7,6))
bsp3_ts <- ts(c(1,2,1,2,3,2,3,2,4,3,4,3,4,5,4,3,5,6,5,4,5,6,7,6))
bsp_ts <- list(bsp1_ts, bsp2_ts, bsp3_ts)
bsp_auto <- lapply(bsp_ts, function(x) auto.arima(x, max.p = 12, max.q = 0, seasonal = FALSE, d=0))
coefficient extraction for multiple models, something like this:
ARcoef_li <- lapply(ARpers_li, function(x) sum(ARpers_li$x$coef)