A blog by Rob J Hyndman 

Twitter Gplus RSS

Different results from different software

Published on 26 October 2010

I’ve had a few ques­tions on this topic lately. Here is an email received today:

I use Eviews to esti­mate time series, but I have been check­ing out R recently, and your Fore­cast package.

I can­not under­stand why 2 sim­i­lar equa­tions in Eviews and R are giv­ing dif­fer­ent esti­mated out­put. Your insights will be invalu­able for my work.

The equa­tions are:

R:      Arima(log(fee), order=c(1,1,0), seasonal=list(order=c(1,0,0),
              period=4), include.drift=TRUE)
Eviews: dlog(fee) c ar(1) sar(1)

Even with include.drift=FALSE in R or with­out c in Eviews they give dif­fer­ent output.

Much appre­ci­ated if you could share your view.

There are sev­eral issues here.

  1. The Eviews model is not what it seems. To fit an ARIMA(1,1,0)(1,0,0)4 in Eviews, you need to use
    dlog(fee) c ar(1) sar(4)

    The sea­sonal order needs to be spec­i­fied in the sar term. I’ve always thought this was a bizarre choice of syn­tax because it is so easy to make mistakes.

  2. Even with that cor­rec­tion, the two mod­els are not quite equiv­a­lent. In the Eviews code, the dif­fer­enc­ing is done before esti­ma­tion, whereas in the R code the dif­fer­enc­ing is implicit in the model. In esti­mat­ing the model in R, a state space rep­re­sen­ta­tion is used and the non-​​stationary com­po­nents are given a dif­fuse prior, rather than sim­ply dif­fer­enced away. (See help(arima) in R.) This will lead to dif­fer­ent para­me­ter esti­mates. A model equiv­a­lent to the (cor­rected) Eviews for­mu­la­tion can be spec­i­fied in R using
    Arima(diff(log(fee),order=c(1,0,0),seasonal=list(order=c(1,0,0),period=4),
         include.mean=TRUE)

    Here the dif­fer­enc­ing is explicit.

  3. R and Eviews use dif­fer­ent esti­ma­tion meth­ods. Eviews uses non­lin­ear least squares while R uses max­i­mum like­li­hood esti­ma­tion. So the objec­tive func­tions are not the same and the para­me­ter esti­mates will there­fore differ.
  4. Even if the two mod­els were iden­ti­cal, and the two opti­miza­tion cri­te­ria were iden­ti­cal, it is pos­si­ble for dif­fer­ent pack­ages to give dif­fer­ent results because they use dif­fer­ent opti­miza­tion algo­rithms. With non­lin­ear opti­miza­tion, such as in esti­mat­ing ARIMA mod­els, there are sev­eral avail­able algo­rithms for find­ing the opti­mal para­me­ters. While they should all give very sim­i­lar results, they often dif­fer after the first few dec­i­mal places.

Pro­vided the model is cor­rectly spec­i­fied, none of this should make too much dif­fer­ence to the fore­casts obtained, but be pre­pared for some vari­a­tions from dif­fer­ent pack­ages, and even from dif­fer­ent ver­sions of the same pack­age.


Related Posts:


 
No Comments  comments