[R] arima prediction
bhh at xs4all.nl
Sun May 19 06:53:27 CEST 2013
On 19-05-2013, at 05:25, Preetam Pal <lordpreetam at gmail.com> wrote:
> Thanks Rui, but the problem is at this point, I don't want to predict.
> I want to see for the time being, how good my model fits the previous data
> So, if I specify n.ahead=-1 (or any -ve value) , R shows an error like:
> Error in rep(1, n.ahead) : invalid 'times' argument
> How do I get this comparison done?
One of the components of the return value of arima() is "residuals".
Why don't you compute the predicted series by actual_series - residuals?
> Another problem I am facing here is (and this is about prediction):
> To get the model, I entered : arima=arima((y,order=c(2,0,2),xreg=g);
> Suppose, I want tot predict the next value of y, but when I type
> predict=predict(arima,n.ahead=1,newxreg=g), the following
> warning appears:
> Warning message:
> In predict = predict(arima, n.ahead = 1, newxreg = g) :
> number of items to replace is not a multiple of replacement length
> So these are the 2 issues I am facing.Any help is welcome.
> On Sun, May 19, 2013 at 3:58 AM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
>> At an R prompt type
>> Hope this helps,
>> Rui Barradas
>> Em 18-05-2013 21:42, Preetam Pal escreveu:
>> Hi all,
>>> I have a time series Y which I have modelled as ARIMA(2,0,2) by using the
>>> arima function .
>>> I want to know the model predicted values so that I can compare them with
>>> the actual values.
>>> Which function do I need to use to get the predicted values? I have tried
>>> to find out, but with no luck till now.
>>> Appreciate your help.
> Preetam Pal
> M-Stat 2nd Year, Room No. N-114
> Statistics Division, C.V.Raman
> Indian Statistical Institute, B.H.O.S.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help