Reputation: 872
I want to take the parameters of the model of my full data and then run the model with those parameters against the 'in-sample' of the data but I don't know how to do that.
For example;
data<-c(79160.56266,91759.73029,91186.47551,106353.8192,70346.46525,80279.15139,82611.60076,131392.7209,93798.99391,105944.7752,103913.1296,154530.6937,110157.4025,117416.0942,127423.4206,156751.9979,120097.8068,121307.7534,115021.1187,150657.8258,113711.5282,115353.1395,112701.9846,154319.1785,116803.545,118352.535)
data<-ts(data,delta=1/4,start=c(8,1))
data<-log(data)
auto.arima(data,max.D=3,d=1,seasonal=TRUE,allowdrift=FALSE,stepwise=FALSE,trace=TRUE,seasonal.test="ch")
I need to extract the parameters/order of this to run arima on this data forcing the parameters to be the same as the extracted ones:
data2<-head(data,-4)
#arimab<-Arima(data2,order=order from auto.arima on full data)
#forecast(arimab,h=8,simulate=TRUE,fan=TRUE)
Can someone suggest how to firstly extract the parameters of the auto.arima and then how to run the model on 'data2' with those parameters.
Upvotes: 3
Views: 1807
Reputation: 977
AutoArimaFit <- auto.arima( Data )
Extract parameters with
arimaorder(AutoArimaFit)
Run the same Model with :
Arima(Data , model = AutoArimaFit)
Upvotes: 2
Reputation: 872
think i have figured it out now...
data<-c(79160.56266,91759.73029,91186.47551,106353.8192,70346.46525,80279.15139,82611.60076,131392.7209,93798.99391,105944.7752,103913.1296,154530.6937,110157.4025,117416.0942,127423.4206,156751.9979,120097.8068,121307.7534,115021.1187,150657.8258,113711.5282,115353.1395,112701.9846,154319.1785,116803.545,118352.535)
data<-ts(data,delta=1/4,start=c(8,1))
data<-log(data)
aaw<-auto.arima(data,max.D=3,d=1,seasonal=TRUE,allowdrift=FALSE,stepwise=FALSE,trace=TRUE,seasonal.test="ch")
orderWA<-c(aaw$arma[1], aaw$arma[6] , aaw$arma[2])
orderWS <- c(aaw$arma[3], aaw$arma[7] , aaw$arma[4])
data2<-head(data,-4)
arimaa<-Arima(data2,order=orderWA,seasonal=orderWS,method="ML")
Upvotes: 4