Page 1 of 1
VAR model
Posted: Sun Aug 21, 2011 7:21 am
by lisa
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.
Re: VAR model
Posted: Mon Aug 22, 2011 4:41 am
by trubador
You can start the simulation from the second observation via adjusting the sample:
Re: VAR model
Posted: Mon Aug 22, 2011 5:06 am
by lisa
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)
Re: VAR model
Posted: Mon Aug 22, 2011 11:49 pm
by trubador
That is the point of simulation. You should supply the initial values.
Re: VAR model
Posted: Tue Aug 23, 2011 6:09 am
by startz
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?
Re: VAR model
Posted: Tue Aug 23, 2011 7:07 am
by trubador
I automatically assumed that simulation is carried out through a program, which I believe is the safest way...
Re: VAR model
Posted: Tue Aug 23, 2011 7:15 am
by trubador
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...
Re: VAR model
Posted: Tue Aug 23, 2011 7:56 am
by EViews Gareth
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.
Re: VAR model
Posted: Wed Aug 24, 2011 1:24 pm
by lisa
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.