Philip Olsson
Philip Olsson

Reputation: 17

Why does my ARIMA model work (2,0,3), but not in the first difference (2,1,3)?

What to run an arima function in the first difference (2,1,3), but i keep getting an error message. However, if i run it without the differencing (2,3) it works. What am I doing wrong.

Data= https://docs.google.com/spreadsheets/d/1cQvoI9kuF4wNEDBcJjDz5x60wgLSNjjBpECGJ0TnJYo/edit#gid=0

y=data[1:504] 
s=12
st=c(1976,1)
y=ts(y,frequency = s,start=st)

Create seasonal dummies for the time series.

 S2 = rep(c(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), T/s)
    S3 = rep(c(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0), T/s)
    S4 = rep(c(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0), T/s)
    S5 = rep(c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), T/s)
    S6 = rep(c(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), T/s)
    S7 = rep(c(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), T/s)
    S8 = rep(c(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), T/s)
    S9 = rep(c(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), T/s)
    S10 = rep(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0), T/s)
    S11 = rep(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), T/s)
    S12 = rep(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), T/s)

TrSeas = model.matrix(~ t+S2+S3+S4+S5+S6+S7+S8+S9+S10+S11+S12)
TrSeas 

This model works

ar3.model = arima(y,order = c(2, 0, 3),include.mean = FALSE,xreg=TrSeas)

The one in first difference does not

arima213=Arima(y,order = c(2,1,3),xreg = TrSeas,include.mean = FALSE,include.drift = TRUE,method = "ML")

This gives me the following error message: Error in optim(init[mask], armaCSS, method = optim.method, hessian = TRUE, : non-finite value supplied by optim

Upvotes: 0

Views: 565

Answers (1)

Zeeshan
Zeeshan

Reputation: 1238

In arima function we specify (p,d,q) values here d stand for difference. d is used when our time series data is seasonal and d will remove the seasonality present in data. Here in your case data is not seasonal therefore no need to differentiate, it will work on d=0. If your data is seasonal then you can differentiate.

Upvotes: 1

Related Questions