[R-SIG-Finance] VECM
vramaiah at neo.tamu.edu
vramaiah at neo.tamu.edu
Fri Nov 18 21:46:36 CET 2011
Hello Prof Pfaff
Thank you for your help. I ran with many combinations of SR and LR with only exception is NA in both [1,1] positions. It is a bivariate, so it is 2X2 matrix. No reprive; the same error.
Then I tried to mimic Code 8-11 and Table 8-14 of Analysis of Int & Coint TS with R for my data. Interestingly, Serial Test both asymptotic and adjusted looked fine, but JB Test and arch test had zero p-value. I ran normality test again with P=1,2,3,4,5 for my data and got p-value for Residuals of VAR and Kurtosis around 2 times e(-16). Skewness had highest value of 0.015 for P=4 and 0.001 for P=3 but of the order of e-10 for P=1 and 2. Does that mean my distribution of error term is not normal? If so what can I do about the input data?
My data are quarterly US GDP and Consumption expressed as log per capital for a period of 1949-2009 and ranges from 4.2661 to 4.8116 for GDP and 4.0714-4.6601 for consumption with steady upward trend except for last 4 quarters.
Do I need any "de=trending" adjustments to the data?
I hope you can provide me some guidance in this area.
Thank you in advance
Ram Ramaiah
----- Original Message -----
From: "Bernhard Dr. Pfaff" <Bernhard_Pfaff at fra.invesco.com>
To: vramaiah at neo.tamu.edu, r-sig-finance at r-project.org
Sent: Friday, November 18, 2011 3:39:48 AM GMT -06:00 US/Canada Central
Subject: AW: [R-SIG-Finance] Help with VECM
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:9}}
More information about the R-SIG-Finance
mailing list