Page 1 of 1
simulation
Posted: Tue Apr 12, 2011 1:48 am
by iloverats
dear all
how can i generate a series x,which is the granger causality of y?
for example
x=a*x{1}+b*y{1}+et
best
Re: simulation
Posted: Tue Apr 12, 2011 9:21 am
by TomDoan
iloverats wrote:dear all
how can i generate a series x,which is the granger causality of y?
for example
x=a*x{1}+b*y{1}+et
best
Something like this. You need a DGP for y as well, which is here an autoregression.
Code: Select all
all 120
set x = 0.0
set y = 0.0
frml xf x = .6*x{1}+.2*y{1}
frml yf y = .0*x{1}+.8*y{1}
group(cv=%identity(2)) twovar xf>>x yf>>y
simulate(model=twovar,from=2,to=120)
Typically, you would discard a certain number of early data points since the pre-sample zeros aren't representative of the process---this generates through 120 so that you can use 21-120 as 100 data points.
Re: simulation
Posted: Tue Apr 12, 2011 11:16 am
by iloverats
TomDoan wrote:iloverats wrote:dear all
how can i generate a series x,which is the granger causality of y?
for example
x=a*x{1}+b*y{1}+et
best
Something like this. You need a DGP for y as well, which is here an autoregression.
Code: Select all
all 120
set x = 0.0
set y = 0.0
frml xf x = .6*x{1}+.2*y{1}
frml yf y = .0*x{1}+.8*y{1}
group(cv=%identity(2)) twovar xf>>x yf>>y
simulate(model=twovar,from=2,to=120)
Typically, you would discard a certain number of early data points since the pre-sample zeros aren't representative of the process---this generates through 120 so that you can use 21-120 as 100 data points.
thank you
if i want x and y all have Garch(1,1) effect
how can i modify the code
Re: simulation
Posted: Tue Apr 12, 2011 3:11 pm
by TomDoan
iloverats wrote:thank you
if i want x and y all have Garch(1,1) effect
how can i modify the code
I've posted code for generating an MV-GARCH process at
http://www.estima.com/forum/viewtopic.php?f=11&t=1024
That would be the error process, so you would need to use
FORECAST with the
PATHS option, instead of
SIMULATE, for putting together your mean model with simulated GARCH errors.
Re: simulation
Posted: Sat Oct 01, 2011 7:29 am
by iloverats
all 120
set x = 0.0
set y = 0.0
frml xf x = .6*x{1}+.2*y{1}
frml yf y = .0*x{1}+.8*y{1}
group(cv=%identity(2)) twovar xf>>x yf>>y
simulate(model=twovar,from=2,to=120)
the code have no residual Contemporaneou-correlations
if i want residuals are cross Contemporaneou correlated,and the correlation coefficient is 0.8
how can i modify the code

Re: simulation
Posted: Sat Oct 01, 2011 8:17 am
by TomDoan
The CV option on GROUP is the covariance matrix of the residuals. Make it what you want instead of the identity.
Re: simulation
Posted: Thu Oct 06, 2011 3:55 am
by iloverats
TomDoan wrote:The CV option on GROUP is the covariance matrix of the residuals. Make it what you want instead of the identity.
Dear
If i want y and x are all nonstationary , how can i set it?
thank you very much
Re: simulation
Posted: Thu Oct 06, 2011 8:11 am
by TomDoan
The covariance matrix has nothing to do with non-stationarity. You need to pick a set of lag coefficients which will do that. Write down a model in VECM form and solve it out for the original variables.
Re: simulation
Posted: Thu Oct 06, 2011 7:34 pm
by iloverats
TomDoan wrote:The covariance matrix has nothing to do with non-stationarity. You need to pick a set of lag coefficients which will do that. Write down a model in VECM form and solve it out for the original variables.
Dear
May you give me an example?
thank you
Re: simulation
Posted: Fri Oct 07, 2011 9:22 am
by TomDoan
Engle and Granger(1987) in "Co-Integration and Error Correction", Econometrica, vol 55, no 2 give about six examples of DGP's for non-stationary VAR's.