[R] Apply a Seasonal ARMA process
rolf.turner at xtra.co.nz
Sat Jun 22 01:04:49 CEST 2013
On 22/06/13 01:48, Stefano Sofia wrote:
> Dear R users,
> I have a seasonal time series of period 4 (my_ts).
> I would like to apply to my_ts a Seasonal ARMA(2,0) process (only the seasonal part), with Seasonal AR coefficients respectively 0.54 and 0.5.
> I tried to use the arima command from the stats package, but this code is not correct:
> arima(my_ts, order=c(0,0,0), seasonal=list(order=c(2,0,0), sar=c(0.54, 0.5), period=4), n=220)
> The error is:
> "Error in optim(init[mask], armaCSS, method = optim.method, hessian = FALSE: initial value in 'vmmin' not finite".
> I am not even sure of the syntax about sar=c(0.54, 0.5).
> I looked for this topic in the R archive, but I have not been able to find an example or a useful hint.
> Could you please help me? Does arima handle seasonal ARMA processes? If yes, how? Is there a better specific package for that?
I am not at all sure what you are trying to do, but I'm pretty sure that
it is, arima() is *not* the appropriate tool. The arima() function is
used to *fit*
models to time series. E.g. in your context to *estimate* the
coefficients of your
seasonal model. Here you appear to *know* the values of these coefficients
(they are 0.54 and 0.5) so whatever you are trying to do it would seem that
you are not trying to estimate anything.
Perhaps you want to *filter* your time series through a seasonal AR(2)
with coefficients 0.54 and 0.5? In this case the function filter()
might help you.
You might also consider using arima.sim() with argument "innov" equal to
given time series (which you call --- ugh!!! --- "my_ts", using that
Micro$oft originating "my this", "my that" convention).
Where on earth did you get that "sar= ..." syntax (of which you quite
say you are "unsure") anyhow? The arima() function has no such argument.
More information about the R-help