ECM forecast

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

PMaier
Posts: 36
Joined: Sat Sep 11, 2010 10:12 am

ECM forecast

Postby PMaier » Wed Nov 30, 2011 7:34 am

Hi,

I would appreciate some help forecasting an ECM model. The equation I'm trying to forecast is a traditional ECB equation:

f2 = beta(1)*f2(-1) - beta(2)*(f2_level(-1)-beta(3)*oil(-1) - beta(4)*comm_agriculture(-1)-beta(5)*comm_metals(-1)),

whereby f2 is the series in first differences and f2_level the series in levels. The attached workfile contains all series.
ecm model.wf1
(23.43 KiB) Downloaded 451 times


Here's the code to set up the basic framework:

Code: Select all

coef(5) beta
series f2_level = @cumsum(f2)

' Test the cointegration relationship -- first the LR relationship, then the SR relationship
smpl 1980q1 2007q4

equation eq_lr.ls f2_level = c(1)*oil - c(2)*comm_agriculture-c(3)*comm_metals
equation eq_ecm.ls(n) f2=beta(1)*f2(-1) -beta(2)*(f2_level(-1) -beta(3)*oil(-1) - beta(4)*comm_agriculture(-1)-beta(5)*comm_metals(-1))
fit f2_hat
plot f2_level @cumsum(f2_hat)


' Forecasting

' Build a model

model model_test
model_test.merge eq_lr
model_test.merge eq_ecm


In other words, I'm first generating f2_levels, then test the cointegration relationship, then estimate the ECM (don't look too hard on the econometrics; I'm just using this data as illustration).

Then, however, I run into difficulties as I'm trying to cast this in model form. I think I need to make explicit to the model that f2=d(f2_level), but if I try adding this equation, I get the error message that "f2 is specified as endogenous in another equation" (not surprising). So I'm a bit at a loss how to accomplish this.

Any advice would be greatly appreciated!

Many thanks, Philipp

PMaier
Posts: 36
Joined: Sat Sep 11, 2010 10:12 am

Re: ECM forecast

Postby PMaier » Wed Nov 30, 2011 11:55 am

I probably overlooked the simple solution. I think the following should be correct:

Code: Select all

    coef(5) beta
    series f2_level = @cumsum(f2)

    ' Test the cointegration relationship -- first the LR relationship, then the SR relationship
    smpl 1980q1 2007q4

    equation eq_lr.ls f2_level = c(1)*oil - c(2)*comm_agriculture-c(3)*comm_metals
    equation eq_ecm.ls(n) f2=beta(1)*f2(-1) -beta(2)*(f2_level(-1) -beta(3)*oil(-1) - beta(4)*comm_agriculture(-1)-beta(5)*comm_metals(-1))


    ' Forecasting
    model model_test
    model_test.merge eq_ecm
    model_test.append f2_level = f2_level(-1)+f2


... and then solve the model dynamically.

I'm posting this in case anyone else struggles with the same issue -- or, if I'm wrong, to be corrected! :-)

Thanks, Philipp


Return to “Models”

Who is online

Users browsing this forum: No registered users and 2 guests