Skip to content

AR1 model using ARIMA

5 messages · T.Riedle, Duncan Murdoch, Jeff Newmiller

#
Dear R users,
I am trying to run a rolling window AR1 model by combining the rollapply() with the arima() function. Hence, my code looks as follows:

rollingarma<-rollapply(data,width=36,function(data) coef(arima(data,order=c(1,0,0))))
Error in arima(data, order = c(1, 0, 0)) :
  non-stationary AR part from CSS

However, what is wrong with my code?

Can I use the arma() function as alternative? In this case the code is


rollingarma<-rollapply(data,width=36,function(data) coef(arma(data,order=c(1,0),include.intercept = FALSE)))

There were 50 or more warnings (use warnings() to see the first 50)
Warning messages:

1: In optim(coef, err, gr = NULL, hessian = TRUE, ...) :

  one-dimensional optimization by Nelder-Mead is unreliable:

use "Brent" or optimize() directly

In this case, I get a warning message. How can I use Brent or optimize in this code?

Thanks for your support.
3 days later
#
Dear R users,
I have not received any help regarding my problem. The rolling window AR1 model returns an error if I run my code as follows:

rollingarma<-rollapply(data,width=36,function(data) coef(arima(data,order=c(1,0,0))))
Error in arima(data, order = c(1, 0, 0)) :
  non-stationary AR part from CSS

However, what is wrong with my code?

Can I use the arma() function as alternative? In this case the code is


rollingarma<-rollapply(data,width=36,function(data) coef(arma(data,order=c(1,0),include.intercept = FALSE)))

There were 50 or more warnings (use warnings() to see the first 50)
Warning messages:

1: In optim(coef, err, gr = NULL, hessian = TRUE, ...) :

  one-dimensional optimization by Nelder-Mead is unreliable:

use "Brent" or optimize() directly

In this case, I get a warning message. How can I use Brent or optimize in this code?

Thanks for your support.
#
On 14/06/2016 7:46 AM, T.Riedle wrote:
Please read the posting guide (see the link at the bottom of every 
message).  If you don't post reproducible code, it's much harder to help 
you.

Duncan Murdoch


The rolling window AR1 model returns an error if I run my code as follows:
#
Sorry, I forgot to attach the file.
________________________________________

 Dear R users,
I have not received any help regarding my problem.

The rolling window AR1 model returns an error if I run my code as follows:

data<-GSDAF[,2]
rollingarma<-rollapply(data,width=36,function(data) coef(arima(data,order=c(1,0,0))))
Error in arima(data, order = c(1, 0, 0)) :
non-stationary AR part from CSS

However, what is wrong with my code?

 Can I use the arma() function as alternative? In this case the code is

 rollingarma<-rollapply(data,width=36,function(data) coef(arma(data,order=c(1,0),include.intercept = FALSE)))

Unfortunately, I get following message:

 There were 50 or more warnings (use warnings() to see the first 50)

warnings()
Warning messages:
In optim(coef, err, gr = NULL, hessian = TRUE, ...) :
one-dimensional optimization by Nelder-Mead is unreliable:
use "Brent" or optimize() directly

How can I use Brent or optimize in this code?

 Thanks for your support.
______________________________________________
#
Looks like you forgot to read the Posting Guide, too.