I would like to use plotmo instruction from Plotmo package to plot an arima object I estimate arima model with a matrix of explanatory variables X ( transfer function)
arima.model<-arima(y,c(3,1,3),xreg=X)
When plotting this object I have the next error:
plotmo(arima.model) stats::predict(Arima.object, data.frame[3,1], type="response")
Error in predict.Arima(list(coef = c(0, 0, 0.426819838403672, -0.23337107002535, : 'xreg' and 'newxreg' have different numbers of columns
How could I fix this problem? Thanks C
Plotmo isn't really meant for time-series models like arima models and doesn't support them.
However, if you just want to plot the fitted model and some future values, the following function will do it (there may be a simpler way using the
ts.plotfunction):For example
gives the following plots
(I'm assuming you are using the arima function from the standard stats package. I think the forecast package also has an arima function.)