VAR model

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

lisa
Posts: 45
Joined: Thu Jul 28, 2011 3:27 pm

VAR model

Postby lisa » Sun Aug 21, 2011 7:21 am

hello,
In simulating a VAR(2) model (y=(x,z)'), the variable x depends on his own lags and the lags of the variable z; and the same whith z.
the problem is that when I generated the first equation
x=a11*x(-1)+a12*z(-1)+u1
eviews don't know the values of z; so I obtain "NA" as a result of coefficients estimated of the serie x.

Please who knows if there is an option or a command to generate the 2 equations of the model simultaneously
x=a11*x(-1)+a12*z(-1)
z=a21*x(-1)+a22*z(-1)

thanks.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: VAR model

Postby trubador » Mon Aug 22, 2011 4:41 am

You can start the simulation from the second observation via adjusting the sample:

Code: Select all

smpl 2 @last

lisa
Posts: 45
Joined: Thu Jul 28, 2011 3:27 pm

Re: VAR model

Postby lisa » Mon Aug 22, 2011 5:06 am

but the problem is that when we simulate x in the first time, x depends on z which is not known; and the same thing whith z. So there is a command that I should write before the 2 équations in order to simulate them (x=a11*x(-1)+a12*z-1)+u1 et z=a21*x(-1)+a22*z(-1)+u2)

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: VAR model

Postby trubador » Mon Aug 22, 2011 11:49 pm

That is the point of simulation. You should supply the initial values.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: VAR model

Postby startz » Tue Aug 23, 2011 6:09 am

The problem is a that given initial values, EViews will roll forward one equation but won't run forward two equations in tandem.

Can this be solved with the model object?

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: VAR model

Postby trubador » Tue Aug 23, 2011 7:07 am

I automatically assumed that simulation is carried out through a program, which I believe is the safest way...

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: VAR model

Postby trubador » Tue Aug 23, 2011 7:15 am

And yes, I believe it is possible to do something like that via the model object. Equations can be defined as a text and the values then can be generated the within context of stochastic simulation with dynamic option. I think, it is also necessary to explicitly assign a standard deviation to each equation. I will give it a try, it is an interesting suggestion indeed...

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: VAR model

Postby EViews Gareth » Tue Aug 23, 2011 7:56 am

I think Startz was just pointing out that if you have the following program:

Code: Select all

series y = 3+0.2*x(-1) series x = 4+0.1*y(-1) [code] EViews will generate all of the Ys, and then all of the Xs, rather than generating the first Y, then the first X, then the second Y, then the second X, etc..., so you won't get the interaction happening properly. There are two solutions. Either run a for loop to loop through the observations and set Y and X each time, or use a model. When you solve a model, it generates the solutions observation by observation: [code] model m m.append series y = 3+0.2*x(-1) m.append series x = 4+0.1*y(-1) m.solve
The only downside to the model approach is that the results would be in Y_0 and X_0 rather than Y and X.

lisa
Posts: 45
Joined: Thu Jul 28, 2011 3:27 pm

Re: VAR model

Postby lisa » Wed Aug 24, 2011 1:24 pm

thanks a lot. I obtain the simulation via the model object.
Please I have an other question.
for the VAR representation y=(x,z)'=A*y(-1)+u where u is normally distributed, the 2 equations to simulate are:
x=0.2*x(-1)+0.3*z(-1)+u1
z=0.1*x(-1)+0.7*z(-1)+u2
Shall I use the same parameters for the normal distribution of the error terms u1 and u2
genr u1=0.35*nrnd
genr u2=0.35*nrnd
or different parameters for each distribution
genr u1=0.35*nrnd
genr u2=2+0.5*nrnd

Thanks for your help.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest