tsDyn
tsDyn copied to clipboard
coefA does not work with ca.jo containing ecdet terms
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?
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)