[R-SIG-Finance] VECM estimation
Megh Dal
megh700004 at yahoo.com
Mon Dec 20 00:03:45 CET 2010
Let consider the example with SVEC()
SR <- matrix(NA, nrow = 4, ncol = 4)
SR[4, 2] <- 0
SR
LR <- matrix(NA, nrow = 4, ncol = 4)
LR[1, 2:4] <- 0
LR[2:4, 4] <- 0
LR
vecm <- ca.jo(Canada[, c("prod", "e", "U", "rw")], type = "trace", ecdet = "trend", K = 3, spec = "transitory")
# Here I do not have option to put both trend and intercept with ecdet
SVEC(vecm, LR = LR, SR = SR, r = 1, lrtest = FALSE, boot = FALSE)
# this is okay with me.
I really could not understand, what is the actual job of ca.jo(). Is it to determine rank of the system? Does it also estimate the VECM parameters? If it does then what rank it uses and how to specify that rank?
I also noticed that values from SVEC() do not match with jMulti estimation.
SVEC() gives following:
> vecm <- ca.jo(Canada[, c("prod", "e", "U", "rw")], type = "trace", ecdet = "none", K = 3, spec = "transitory")
> SVEC(vecm, LR = LR, SR = SR, r = 1, lrtest = FALSE, boot = FALSE)
SVEC Estimation Results:
========================
Estimated contemporaneous impact matrix:
prod e U rw
prod 0.51477 0.09477 -0.323277 0.006354
e -0.15117 0.24352 -0.116054 0.122847
U 0.05164 -0.26747 0.004129 0.037027
rw 0.36441 0.00000 0.432744 0.457597
Estimated long run impact matrix:
prod e U rw
prod 0.52448 0.0000 0.0000 0
e -0.03750 0.5807 -0.5355 0
U 0.05365 -0.3530 0.1064 0
rw 0.46911 0.5521 -0.6817 0
Similar input on jMulti, gives following result:
This is a B-model with long run restrictions
Long run restrictions provide(s) 5 independent restriction(s).
Contemporaneous restrictions provide(s) 1 additional restriction(s).
Structural VAR Estimation Results
ML Estimation, Scoring Algorithm (see Amisano & Giannini (1992))
Convergence after 10 iterations
Log Likelihood: 129.1165
Structural VAR is just identified
Estimated B matrix
0.5965 -0.1364 0.1266 0.1291
0.0435 0.2727 -0.1454 0.1228
-0.0711 -0.2599 0.0091 0.0477
-0.1442 0.0000 0.6046 0.3948
Estimated long run impact matrix
1.4477 0.0000 0.0000 0.0000
2.5655 0.9560 -0.8542 0.0000
-0.4426 -0.3369 0.1923 0.0000
4.7192 1.5188 -0.7510 0.0000
SigmaU~*100
40.7114 -1.3784 0.0349 4.1515
-1.3784 11.2499 -6.9452 -4.5702
0.0349 -6.9452 7.4965 3.4569
4.1515 -4.5702 3.4569 54.2212
end of ML estimation
Is it differing just because of different algorithm?
Thanks,
--- On Mon, 12/20/10, mat <matthieu.stigler at gmail.com> wrote:
> From: mat <matthieu.stigler at gmail.com>
> Subject: Re: [R-SIG-Finance] VECM estimation
> To: "Megh Dal" <megh700004 at yahoo.com>
> Cc: "r-sig-finance at stat.math.ethz.ch" <r-sig-finance at stat.math.ethz.ch>
> Date: Monday, December 20, 2010, 4:10 AM
> Le 19. 12. 10 23:35, Megh Dal a
> écrit :
> > Thanks Matthieu the VECM() function is quite okay on
> what I need however I also need to have structural analysis
> (atleast B-model) of my fitted model. It seems that tsDyn
> package does not have any option for that, whereas vars
> package has with SVEC() function.
>
> if you need structural analysis, then vars is definitely
> more appropriate
> > But problem I am facing is again, it needs specific
> object type as: "Object of class ‘ca.jo’; generated by
> ca.jo() contained in urca".
> >
> did you check the help file of SVEC? There is a "r"
> argument:
>
> r: Integer, the cointegration rank of x.
>
> Is this not what you need? If not, please indicate more
> precisely (i.e.
> also with code) where the problem is
>
> Hope this helps
>
> Mat
>
> > Is there any option to use object returned from VECM()
> in SVEC()? Or can you suggest anything else?
> >
> > Thanks,
> >
> > --- On Mon, 12/20/10, mat<matthieu.stigler at gmail.com>
> wrote:
> >
> >> From: mat<matthieu.stigler at gmail.com>
> >> Subject: Re: [R-SIG-Finance] VECM estimation
> >> To: "Megh Dal"<megh700004 at yahoo.com>
> >> Cc: "r-sig-finance at stat.math.ethz.ch"<r-sig-finance at stat.math.ethz.ch>
> >> Date: Monday, December 20, 2010, 3:47 AM
> >> Le 19. 12. 10 21:38, Megh Dal a
> >> écrit :
> >>> Hi, I wanted to estimate a VEC model using
> vars
> >> package and gone through it's ca.jo() function.
> However I
> >> could not find any option to have following
> inputs:
> >> Starting with:
> >>
> >> library(vars)
> >> data(Canada)
> >> ve<-ca.jo(Canada, spec="transitory")
> >>> 1. Intercept and linear trend in
> cointegration
> >> equation (either one is available but not both
> option)
> >> indeed I think it is not possible...
> >>> 2. I want to explicitly specify the rank. It
> seems
> >> ca.jo() chooses rank through testing. However what
> if I want
> >> to put my own rank disregarding any statistical
> test?
> >> cajorls(ve, r=2)
> >>> 3. I also want to get all estimated
> coefficients
> >> also obtained with cajorls()
> >>
> >> Another possibility would have been to use package
> tsDyn
> >> (but less
> >> features than vars):
> >>
> >> ve2<-VECM(Canada, lag=1, r=2, estim="ML")
> >>
> >> summary(ve2)
> >>> I have tried following, however getting
> error:
> >>>
> >>>
> >>>> data(denmark)
> >>>> sjd<- as.matrix(denmark[, c("LRM",
> "LRY",
> >> "IBO", "IDE")])
> >>>> ca.jo(sjd, ecdet = c("const", "trend"),
> >> type="eigen", K=2, spec="transitory")
> >>> Error in match.arg(ecdet) : 'arg' must be of
> length 1
> >>>
> >>> I would be grateful I somebody points me how
> to
> >> achieve that.
> >>> Thanks,
> >>>
> >>>
> _______________________________________________
> >>> R-SIG-Finance at r-project.org
> >> mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> >>> -- Subscriber-posting only. If you want to
> post,
> >> subscribe first.
> >>> -- Also note that this is not the r-help list
> where
> >> general R questions should go.
> >>
> >>
> >
> >
>
>
More information about the R-SIG-Finance
mailing list