Dear all, is there any package/function available which simulates a co-integrating VAR model once the model parameters are input over some arbitrary horizon? Please let me know anyone aware of that. Thanks -- View this message in context: http://n4.nabble.com/Simulation-of-VAR-tp1693295p1693295.html Sent from the R help mailing list archive at Nabble.com.
Dear Ron,
have you had a look at the package dse? Here, ARMA models can be
specified and simulated. The only exercise left for you, is to transform
the VECM coefficients into their level-VAR values.
Best,
Bernhard
|> -----Original Message-----
|> From: r-help-bounces at r-project.org
|> [mailto:r-help-bounces at r-project.org] On Behalf Of Ron_M
|> Sent: Saturday, March 27, 2010 12:14 PM
|> To: r-help at r-project.org
|> Subject: [R] Simulation of VAR
|>
|>
|> Dear all, is there any package/function available which simulates a
|> co-integrating VAR model once the model parameters are
|> input over some
|> arbitrary horizon? Please let me know anyone aware of that.
|>
|> Thanks
|> --
|> View this message in context:
|> http://n4.nabble.com/Simulation-of-VAR-tp1693295p1693295.html
|> Sent from the R help mailing list archive at Nabble.com.
|>
|> ______________________________________________
|> R-help at r-project.org mailing list
|> https://stat.ethz.ch/mailman/listinfo/r-help
|> PLEASE do read the posting guide
|> http://www.R-project.org/posting-guide.html
|> and provide commented, minimal, self-contained, reproducible code.
|>
*****************************************************************
Confidentiality Note: The information contained in this ...{{dropped:10}}
Yes I looked into "dse" package. Here I have implemented two approach
for
simulation like following :
library(dse)
A1 <- matrix(rnorm(16),4)
A2 <- matrix(rnorm(16),4)
mu <- rnorm(4)
sigma <- matrix(c(0.006594712,
0.006467731,
-0.000254914,
0.005939934,
0.006467731,
0.006654184,
-0.000384097,
0.005658247,
-0.000254914,
-0.000384097,
0.000310294,
4.34141E-05,
0.005939934,
0.005658247,
4.34141E-05,
0.00574024), 4)
initial.val <- matrix(c(-0.2347096,
-0.1803612,
-0.2780356,
-0.2154427 ,
3.740364,
3.757908,
3.50216 ,
3.57783), 2)
##### My approach
res <- matrix(NA, 4,4); res[c(1,2),] <- initial.val
library(mnormt); shocks <- rmnorm(2, rep(0,4), sigma)
for (i in 1:2) {
res[i+2,] <- mu + A1%*%res[i+2-1,] + A2%*%res[i+2-2,] + shocks[i,] }
res
##### dse approach
temp1 <- matrix(t(cbind(diag(4), A1, A2)), ncol = 4, byrow = TRUE)
model <- ARMA(A=array(temp1, c(3,4,4)), B=diag(4), TREND=mu)
simulate(model, y0=initial.val, sampleT=2, noise=shocks)
Ideally last two rows of "res" and simulate() should be exactly same.
However that is not what I am getting. Can anyone please tell me whether
there is any mistale in any of those approaches? Am I missing somthing?
Thanks
--
View this message in context:
http://n4.nabble.com/Simulation-of-VAR-tp1693295p1694899.html
Sent from the R help mailing list archive at Nabble.com.