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
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
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)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.
iloverats wrote:thank you
if i want x and y all have Garch(1,1) effect
how can i modify the code
TomDoan wrote:The CV option on GROUP is the covariance matrix of the residuals. Make it what you want instead of the identity.
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.
iloverats wrote:Dear sir
May you tell me how can i simulate the series that is AR(2) process and contain the unit root and AR(2) process with a maximum root 0.9
thank you
TomDoan wrote:iloverats wrote:Dear sir
May you tell me how can i simulate the series that is AR(2) process and contain the unit root and AR(2) process with a maximum root 0.9
thank you
No, because neither one of those is a well-defined DGP---you can't give just one root for an AR(2). Write down a full DGP with the properties that you want and convert it to a VAR by substituting out any differences that you used. Once you have that, just replace the definition for the two equations above.
iloverats wrote:Dear
I just want simulate the AR(2) model that contains the unit root or has a maximum root 0.9, rather than VAR
may you help me?
thank you very much
TomDoan wrote:iloverats wrote:Dear
I just want simulate the AR(2) model that contains the unit root or has a maximum root 0.9, rather than VAR
may you help me?
thank you very much
Yes, I will help you by making two suggestions.
1. Get a book on time series.
2. READ IT.
You don't understand what you're trying to do well enough to even ask a well-formed question.
Return to VARs (Vector Autoregression Models)
Users browsing this forum: Google [Bot] and 1 guest