I have some data which i am trying to work on. I am pretty new to R though, but i love R. First, I fit an arima
model to this data and used the detectIO
function in R to detect a single influential outlier (IO). I then incorporated this IO into my model and then developed an arimax
model, now with the IO.
I first used this model:
Model2 = arimax(mydata, order=c(0,2,1),
seasonal=list(order=c(0,0,1), period=12), io=c(48))
Then later, used the model below after seeing a similar code in a book:
Model4 = arima(mydata, order = c(0, 2, 1),
seasonal=list(order = c(0, 0, 1), period = 12),
xtransf=data.frame(I48=1*(seq(mydata)==48), I48=1*(seq(mydata)==48)),
transfer=list(c(0,0), c(1,0)))
I then run the predict
function on these two models and I keep getting this error:
> predict(Model4, n.ahead=24)
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
attempt to set an attribute on NULL
I don't know what I am doing wrong. I don't know if I am using the right functions and codes? Does there really exist a predict
function on arimax
?
I would also appreciate if I get any help on how to set-up the xtransf
with some real data values.
code
by selecting all code areas and pressing Ctrl+K $\endgroup$