### reproduce basic example in "urca" ###
library("urca")
data(denmark)
sjd = denmark[ , c("LRM", "LRY", "IBO", "IDE")]
# rank test and estimation of the full VECM as in "urca" #
R.JOrank = coint.JO(y=sjd, dim_p=2, type="Case2", t_D2=list(n.season=4))
R.JOvecm = VECM(y=sjd, dim_r=1, dim_p=2, type="Case2", t_D2=list(n.season=4))
# ... and of the partial VECM, i.e. after imposing weak exogeneity #
R.KNrank = coint.JO(y=sjd[ , c("LRM"), drop=FALSE], dim_p=2,
x=sjd[ , c("LRY", "IBO", "IDE")], dim_q=2,
type="Case2", t_D1=list(t_shift=36), t_D2=list(n.season=4))
R.KNvecm = VECM(y=sjd[ , c("LRM"), drop=FALSE], dim_p=2,
x=sjd[ , c("LRY", "IBO", "IDE")], dim_q=2, dim_r=1,
type="Case2", t_D1=list(t_shift=36), t_D2=list(n.season=4))
### reproduce Oersal,Arsova 2016:22, Tab.7.5 "France" ###
data("ERPT")
names_k = c("lpm5", "lfp5", "llcusd") # variable names for "Chemicals and related products"
names_i = levels(ERPT$id_i)[c(1,6,2,5,4,3,7)] # ordered country names
L.data = sapply(names_i, FUN=function(i)
ts(ERPT[ERPT$id_i==i, names_k], start=c(1995, 1), frequency=12),
simplify=FALSE)
R.TSLrank = coint.SL(y=L.data$France, dim_p=3, type_SL="SL_trend", t_D=list(t_break=89))
Run the code above in your browser using DataLab