tsDyn icon indicating copy to clipboard operation
tsDyn copied to clipboard

coefA does not work with ca.jo containing ecdet terms

Open MatthieuStigler opened this issue 9 years ago • 1 comments

ca.jo can contain deterministic components in cointegration, see parameter ecdet. This will fail now the results:

library(urca)
library(tsDyn)
example(ca.jo)
coefA(sjd.vecm, r=2)

Maybe adding something like this would solve:

C <- rbind(C1, C2)
# New
if(object@ecdet=="const") C <- rbind(C,0)
alpha <- alpha %*% t(beta)  %*% C

Although needs also to look at if contains trend/both?

MatthieuStigler avatar Dec 12 '16 19:12 MatthieuStigler

reprex:

library(urca)
library(tsDyn)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
packageVersion("tsDyn")
#> [1] '11.0.0'
example(ca.jo, echo=FALSE)
coefA(sjd.vecm, r=2)
#> Error in alpha %*% t(beta) %*% C: non-conformable arguments

Created on 2020-12-05 by the reprex package (v0.3.0)

MatthieuStigler avatar Dec 05 '20 20:12 MatthieuStigler