[Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-02 Thread ismael ismael via R-devel
Hello I am trying to extract AICs from an ARIMA estimation with different combinations of p & q ( p =0,1,2,3 and q=0,1.2,3). I have tried using the following code unsucessfully. Can anyone help? code: storage1 <- numeric(16) for (p in 0:3){     for (q in 0:3){       storage1[p]  <- arima(x,order=

Re: [Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-03 Thread ismael ismael via R-devel
;i <- i + 1L >storage1[[i]] <- arima(etc) > } > } > > lapply(storage1, '[[', "aic") # get the aic's. > > Maybe sapply is better it will return a vector. > > > Hope this helps, > > Rui Barradas > > > > > Às

Re: [Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-04 Thread ismael ismael via R-devel
ector("list", 16) i <- 0L for(p in 0:3){   for(q in 0:3){     i <- i + 1L     storage1[[i]] <- arima(etc)   } } lapply(storage1, '[[', "aic")  # get the aic's. Maybe sapply is better it will return a vector. Hope this helps, Rui Barradas Às

Re: [Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-04 Thread ismael ismael via R-devel
;> for(q in 0:3){ >> storage1[p + 1, q + 1] <- arima(etc)$aic >> } >> } >> 2. define storage1 as a list. >> storage1 <- vector("list", 16) >> i <- 0L >> for(p in 0:3){ >> for(q in 0:3){ >> i <- i + 1L >