[R-SIG-Finance] Help with VECM

Pfaff, Bernhard Dr. Bernhard_Pfaff at fra.invesco.com
Fri Nov 18 10:39:48 CET 2011


Hello Ram,

you have provided invalid matrix objects for SR and LR. See ?SVEC and the cited literature therein for pointers about how to set-up these restrictions properly. Hint and as a first fix to your problem: the LR matrix should contain one columne of zeros. 

Best,
Bernhard

-----Ursprüngliche Nachricht-----
Von: r-sig-finance-bounces at r-project.org [mailto:r-sig-finance-bounces at r-project.org] Im Auftrag von vramaiah at neo.tamu.edu
Gesendet: Donnerstag, 17. November 2011 23:55
An: r-sig-finance at r-project.org
Betreff: [R-SIG-Finance] Help with VECM

Hi
I am new R user and I am working on a VECM problem.
I am following R Code 8-13 & 8-14 from "Analysis of Integrated & Cointegrated Time Series with R" by Bernhard Pfaff and repeatedly running into this problem, 
"> svec<-SVEC(vecm,LR=LR,SR=SR,r=1,lrtest=FALSE,boot=TRUE,runs=100): Error in solve.default(infgamma) :   system is computationally singular: reciprocal condition number = 1.02342e-018"
I followed the example given in the book for "Canada" with the only difference is specifying the triangular matrix.I hope you can point out the mistake I am making.
Ram Ramaiah
For the background info; here are the output for 8-13 and partial 8-14 (upto the error message)> us=read.table("USData.4.txt",header=T)
> vecm<-ca.jo(us[,c("Y","C")],type="trace",ecdet="trend",K=3,spec="trans
> itory")
> vecm.r1<-cajorls(vecm,r=1)
> alpha<-coef(vecm.r1$rlm)[1,]
> beta<-vecm.r1$beta
> vecm.r1
$rlm
Call:
lm(formula = substitute(form1), data = data.mat)
Coefficients:
          Y.d       C.d     
ect1      -0.11653  -0.01562
constant   0.06338   0.01019
Y.dl1      0.14179   0.14814
C.dl1      0.27211  -0.07662
Y.dl2      0.03149  -0.07692
C.dl2      0.18011   0.27390
$beta
                  ect1
Y.l1      1.000000e+00
C.l1     -9.217918e-01
trend.l1  5.260375e-05
> alpha
        Y.d         C.d 
-0.11652600 -0.01561989 
> resids<-resid(vecm.r1$rlm)
> N<-nrow(resids)
> sigma<-crossprod(resids)/N
> sigma
             Y.d          C.d
Y.d 1.453332e-05 7.791666e-06
C.d 7.791666e-06 1.214965e-05
> alpha.se<-sqrt(solve(crossprod(cbind(vecm at ZK%*%beta,vecm at Z1)))[1,1]*di
> ag(sigma))
> alpha.t<-alpha/alpha.se
> beta.se<-sqrt(diag(kronecker(solve(crossprod(vecm at RK[,-1])),solve(t(al
> pha)%*%solve(sigma)%*%alpha))))
> beta.t<-c(NA,beta[-1]/beta.se)
> alpha.se

       Y.d        C.d 
0.02906554 0.02657529 
> alpha.t
      Y.d       C.d 
-4.009078 -0.587760 
> beta.se
[1] 0.1414234204 0.0003404039
> beta.t
[1]         NA -6.5179575  0.1545333
> SR<-matrix(NA,nrow=2,ncol=2)
> SR[1,2]<-0
> SR
     [,1] [,2]
[1,]   NA    0
[2,]   NA   NA
> LR<-matrix(NA,nrow=2,ncol=2)
> LR[1,2]<-0
> LR
     [,1] [,2]
[1,]   NA    0
[2,]   NA   NA> svec<-SVEC(vecm,LR=LR,SR=SR,r=1,lrtest=FALSE,boot=TRUE,runs=100)
Error in solve.default(infgamma) : 
  system is computationally singular: reciprocal condition number = 1.02342e-018

_______________________________________________
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.
*****************************************************************
Confidentiality Note: The information contained in this ...{{dropped:10}}



More information about the R-SIG-Finance mailing list