Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Understanding ARIMA results between stata12 and eviews7

    Hi,

    I am new to time series forecasting (in fact, I've never done it before! so apologizes if I do something stupid... ) but am asked to take over a work by a colleague who used to estimate in eviews.

    Here is his command in eviews and results.

    ls d(life_expectancy_rwa) c ar(1) ma(1)

    Dependent Variable: D(LIFE_EXPECTANCY_RWA)
    Method: Least Squares
    Date: 05/23/14 Time: 15:53
    Sample (adjusted): 1962 2012
    Included observations: 51 after adjustments
    Convergence achieved after 65 iterations
    MA Backcast: OFF (Roots of MA process too large)

    Variable Coefficient Std. Error t-Statistic Prob.

    C 0.162130 0.099824 1.624160 0.1109
    AR(1) 0.927800 0.049352 18.79952 0.0000
    MA(1) 1.362460 0.336141 4.053235 0.0002

    R-squared 0.979104 Mean dependent var 0.410669
    Adjusted R-squared 0.978233 S.D. dependent var 1.807632
    S.E. of regression 0.266690 Akaike info criterion 0.251562
    Sum squared resid 3.413928 Schwarz criterion 0.365199
    Log likelihood -3.414832 Hannan-Quinn criter. 0.294986
    F-statistic 1124.542 Durbin-Watson stat 0.210275
    Prob(F-statistic) 0.000000

    Inverted AR Roots .93
    Inverted MA Roots -1.36
    Estimated MA process is noninvertible



    I tried to replicate this in stata, but failed to get the same results.

    . arima D.life_expectancy_rwa, ar(1) ma(1)

    (setting optimization to BHHH)
    Iteration 0: log likelihood = -37.511483
    Iteration 1: log likelihood = -27.47726
    Iteration 2: log likelihood = -19.615086
    Iteration 3: log likelihood = -17.964063
    Iteration 4: log likelihood = -17.921561 (backed up)
    (switching optimization to BFGS)
    Iteration 5: log likelihood = -17.918088 (backed up)
    Iteration 6: log likelihood = -15.461307
    Iteration 7: log likelihood = -15.294291
    Iteration 8: log likelihood = -15.273493
    Iteration 9: log likelihood = -15.268665
    Iteration 10: log likelihood = -15.267692
    Iteration 11: log likelihood = -15.267676
    Iteration 12: log likelihood = -15.267676

    ARIMA regression

    Sample: 1961 - 2012 Number of obs = 52
    Wald chi2(1) = 573.25
    Log likelihood = -15.26768 Prob > chi2 = 0.0000

    ------------------------------
    -------------------------------------------------------
    D. | OPG
    life_expectancy_rwa | Coef. Std. Err. z P>|z| [95%
    Conf. Interval]
    --------------------+----------------------------------------------------------------
    life_expectancy_rwa |
    _cons | .4095347 1.426149 0.29 0.774
    -2.385666 3.204736
    --------------------+----------------------------------------------------------------
    ARMA |
    ar |
    L1. | .9264644 .0386951 23.94 0.000
    .8506233 1.002305
    |
    ma |
    L1. | .9999997 . . .
    . .
    --------------------+----------------------------------------------------------------
    /sigma | .3027849 .0237213 12.76 0.000
    .256292 .3492779
    -------------------------------------------------------------------------------------
    Note: The test of the variance against zero is one sided, and the
    two-sided confidence
    interval is truncated at zero.




    Thus, the results from forecast in Eviews and predict,y in Stata are quite different (increasing steadily in Eviews and reducing in Stata). What am I doing wrong?

    Best regards.


    --
    Amadou B. DIALLO, PhD.
    Senior Economist, AfDB.
    [email protected]
    +21671101789

  • #2
    Hi,
    This is the answer I received from StataCorp Tech Support.
    Best regards.


    Dear Amadou,

    The reason for the differences is that Stata uses Kalman filter approach to estimate the -arima- models. For theoretical aspects see:

    Hamilton, James "Time Series analysis".
    Princeton University Press. 1994

    Harvey, A. C. 1989. Forecasting, Structural Time Series Models and the
    Kalman Filter. Cambridge: Cambridge University Press.

    There will be differences when the sample size is small, but as the sample size gets large the results converge to the same coefficient estimates.

    You may confirm this by running the following example (using an artificial dataset generated with the user-written command -sim_arma-. Type, "findit sim_arma" to locate and install the command) in Stata:

    clear
    ** Generate artificial dataset **
    set seed 123
    sim_arma y, nobs(50) ar(.92) ma(.75) spin(500)
    rename _t time
    tsset time

    arima y , ar(1) ma(1)

    And the output for the last command:

    . arima y , ar(1) ma(1)

    (setting optimization to BHHH)
    Iteration 0: log likelihood = -72.584945
    Iteration 1: log likelihood = -72.486973
    Iteration 2: log likelihood = -72.482757
    Iteration 3: log likelihood = -72.482314
    Iteration 4: log likelihood = -72.481642
    (switching optimization to BFGS)
    Iteration 5: log likelihood = -72.481434
    Iteration 6: log likelihood = -72.480168
    Iteration 7: log likelihood = -72.480168

    ARIMA regression

    Sample: 1 - 50 Number of obs = 50
    Wald chi2(2) = 131.62
    Log likelihood = -72.48017 Prob > chi2 = 0.0000

    ----------------------------------------------------------------------------
    | OPG
    y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -----------+------------------------------------------------------------
    -----------+----
    y |
    _cons | -3.181352 .9924067 -3.21 0.001 -5.126433 -1.23627
    -----------+------------------------------------------------------------
    -----------+----
    ARMA |
    ar |
    L1. | .7544613 .0948148 7.96 0.000 .5686277 .9402948
    |
    ma |
    L1. | .7223277 .1098259 6.58 0.000 .5070729 .9375825
    -----------+------------------------------------------------------------
    -----------+----
    /sigma | 1.006188 .1368285 7.35 0.000 .7380088 1.274367
    ----------------------------------------------------------------------------
    Note: The test of the variance against zero is one sided, and the two-sided
    confidence interval is truncated at zero.


    You may copy and paste the data in E-views and run the command:

    ls Y c ar(1) ma(1)

    To get:

    Dependent Variable: Y
    Method: Least Squares
    Date: 05/28/14 Time: 16:24
    Sample (adjusted): 2 50
    Included observations: 49 after adjustments
    Failure to improve SSR after 12 iterations
    MA Backcast: 1

    Variable Coefficient Std. Error t-Statistic Prob.

    C -2.776981 0.784088 -3.541669 0.0009
    AR(1) 0.708605 0.096439 7.347735 0.0000
    MA(1) 0.999950 0.043335 23.07466 0.0000
    . . .
    . . .


    You may now repeat the experiment with more observations (e.g. change
    "nobs(50) to nobs(500)" and you will see that the coefficient estimates get much more closer.

    Comment

    Working...
    X