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.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
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)thank youTomDoan wrote:Something like this. You need a DGP for y as well, which is here an autoregression.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
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.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)
I've posted code for generating an MV-GARCH process atiloverats wrote:thank you
if i want x and y all have Garch(1,1) effect
how can i modify the code
DearTomDoan wrote:The CV option on GROUP is the covariance matrix of the residuals. Make it what you want instead of the identity.
DearTomDoan 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.