[R-SIG-Finance] VECM estimation
Megh Dal
megh700004 at yahoo.com
Mon Dec 20 00:51:07 CET 2010
I have got few more questions on ca.jo(), while I was playing with it. In the help page, it is written that: "ecdet Character, ‘none’ for no intercept in cointegration, ‘const’ for constant term in cointegration and ‘trend’ for trend variable in cointegration."
So if I choose "none" then I should not expect any intercept term in my equation. But it is not the case here:
> vec2var(ca.jo(Canada[, c("prod", "e", "U", "rw")], type = "trace", ecdet = "none", K = 3, spec = "transitory"), 2)
Coefficient matrix of lagged endogenous variables:
A1:
prod.l1 e.l1 U.l1 rw.l1
prod 1.17313085 -0.1988161 -0.7607317 0.051311441
e 0.16357256 1.7650576 0.1244759 -0.089332240
U -0.10372069 -0.6093859 0.6805110 0.008815039
rw -0.02333968 -0.5437062 -0.1599481 0.952450235
A2:
prod.l2 e.l2 U.l2 rw.l2
prod -0.21526728 -0.2382885 0.83809495 -0.19924884
e -0.10115954 -1.1704565 -0.05430437 -0.02535674
U 0.09230408 0.5342155 -0.08776523 0.06871551
rw -0.24738219 0.5644188 -0.26581284 -0.13807970
A3:
prod.l3 e.l3 U.l3 rw.l3
prod 0.0870002364 0.58547868 0.32084340 0.09149056
e 0.0001627702 0.58526677 0.36095879 0.03854017
U -0.0201851094 -0.03920456 0.08150674 -0.03682937
rw 0.2822890641 -0.09079635 0.03126377 0.18140798
Coefficient matrix of deterministic regressor(s).
constant
prod -136.73773
e -165.37988
U 106.15426
rw 68.44533
Similarly if I choose "const" then I should expect constant in C.I. but not any intercept in diff. equation. Comparing with jMulti, this is exactly coming correct!!!
Next if I choose "trend" then only trend variable and no intercept I should expect. However I am getting both intercept and trend. Comparing with jMulti figures I got that: Intercept is for diff. equation but linear trend is for C.I. equation.
> vec2var(ca.jo(Canada[, c("prod", "e", "U", "rw")], type = "trace", ecdet = "trend", K = 3, spec = "transitory"), 2)
Coefficient matrix of lagged endogenous variables:
A1:
prod.l1 e.l1 U.l1 rw.l1
prod 1.2273127 -0.2301307 -1.0248394 -0.013479836
e 0.1949000 1.7546123 0.0766481 -0.068519800
U -0.1449562 -0.6105280 0.7398885 -0.005188448
rw -0.1238361 -0.5472103 -0.2113089 0.870432067
A2:
prod.l2 e.l2 U.l2 rw.l2
prod -0.2720027 -0.3491925 0.83323529 -0.19363998
e -0.1194676 -1.2182065 -0.03025085 -0.02284172
U 0.1180995 0.5931123 -0.11283118 0.06605628
rw -0.2198719 0.6347517 -0.39091786 -0.13828306
A3:
prod.l3 e.l3 U.l3 rw.l3
prod 0.01052027 0.54370168 0.07683680 0.20433062
e 0.03020434 0.61157061 0.31515346 0.03773604
U -0.03940489 -0.06214962 0.14851820 -0.04902809
rw 0.15169818 -0.27519714 -0.04045504 0.23160048
Coefficient matrix of deterministic regressor(s).
constant trend.l1
prod 49.86523 0.01486974
e -161.45187 -0.01521660
U 98.31138 0.02031367
rw 274.89572 0.09372355
I would be really grateful, if somebody clarify me what is really going on. or I am missing something?
Thanks,
--- On Mon, 12/20/10, Megh Dal <megh700004 at yahoo.com> wrote:
> From: Megh Dal <megh700004 at yahoo.com>
> Subject: Re: [R-SIG-Finance] VECM estimation
> To: "mat" <matthieu.stigler at gmail.com>
> Cc: "r-sig-finance at stat.math.ethz.ch" <r-sig-finance at stat.math.ethz.ch>
> Date: Monday, December 20, 2010, 4:33 AM
> 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