[R] Beginner problems forecasting arma model
Alex Chen
chen.alexz at gmail.com
Tue Mar 13 01:51:58 CET 2012
Hello,
I am new to the R software and attempting to create a time series
model with trend, seasonality, as well as cycles. I have already been
able to create a model that incorporates both the trend and
seasonality and my approach is to then use the fitted results from
this model in order to create an ARMA model. My code looks like this:
> model1=tslm(m2ts~poly(t,9)+season)
> model2=arma(model1$fit,c(1,0))
But after attempting to create the second model I receive this error message:
"Error in AA %*% t(X) : requires numeric/complex matrix/vector arguments"
I have seen code that works in using $fit to create an ARMA model but
I cannot figure out what is wrong with my models. Why is it that
model1$fit does not meet the requirements as a numeric/complex
matrix/vector? Does it not return as a time-series? Also, is this the
best approach to creating a model that incorporates all three of these
elements: trend, seasonality, and cycles? or is there a better method
which may be simpler?
Thank you very much for helping a novice R programmer out. I can
provide more information if needed.
Sincerely,
Alex
More information about the R-help
mailing list