Skip to content

Commit 8c1e759

Browse files
VECM LR include: more precise message, update tests
1 parent decf1ab commit 8c1e759

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

R/lineVar.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ lineVar<-function(data, lag, r=1,include = c( "const", "trend","none", "both"),
122122
warning("Lag=0 not fully implemented, methods not expected to work: fevd, predict, irf,...")
123123
}
124124
if(LRinclude%in%c("const", "both") & include !="none") {
125-
warning("When `LRinclude` is either 'const' or 'both', `include` can only be `none`")
125+
warning("When `LRinclude` is either 'const' or 'both', `include` can only be `none`.\n Setting include='none'.")
126126
include <- "none"
127127
}
128128

tests/VECM_TEST.Rout.save

+29-2
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,29 @@ Warning message:
6161
In lineVar(data, lag, r = r, include = include, model = "VECM", :
6262
Lag=0 not fully implemented, methods not expected to work: fevd, predict, irf,...
6363
> vecm_ML_l0_LRco <-VECM(barry, lag=0, LRinclude="const", estim="ML")
64-
Warning message:
65-
In lineVar(data, lag, r = r, include = include, model = "VECM", :
64+
Warning messages:
65+
1: In lineVar(data, lag, r = r, include = include, model = "VECM", :
6666
Lag=0 not fully implemented, methods not expected to work: fevd, predict, irf,...
67+
2: In lineVar(data, lag, r = r, include = include, model = "VECM", :
68+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
69+
Setting include='none'.
6770
> vecm_ML_l0_LRtr <-VECM(barry, lag=0, LRinclude="trend", estim="ML")
6871
Warning message:
6972
In lineVar(data, lag, r = r, include = include, model = "VECM", :
7073
Lag=0 not fully implemented, methods not expected to work: fevd, predict, irf,...
7174
>
7275
> vecm_OLS_l1_LRco <-VECM(barry, lag=1, LRinclude="const")
76+
Warning message:
77+
In lineVar(data, lag, r = r, include = include, model = "VECM", :
78+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
79+
Setting include='none'.
7380
> vecm_OLS_l1_LRtr <-VECM(barry, lag=1, LRinclude="trend")
7481
> vecm_OLS_l1_LRtr_noCo <-VECM(barry, lag=1, LRinclude="trend", include="none")
7582
> vecm_OLS_l1_LRbo <-VECM(barry, lag=1, LRinclude="both")
83+
Warning message:
84+
In lineVar(data, lag, r = r, include = include, model = "VECM", :
85+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
86+
Setting include='none'.
7687
>
7788
> vecm_ML_l1_co <-VECM(barry, lag=1, estim="ML")
7889
> vecm_ML_l3_co <-VECM(barry, lag=3, include="const", estim="ML")
@@ -86,12 +97,28 @@ In lineVar(data, lag, r = r, include = include, model = "VECM", :
8697
> set.seed(1234)
8798
> exoVar <- rnorm(n=nrow(barry))
8899
> vecm_ML_l1_LRco <-VECM(barry, lag=1, LRinclude="const", estim="ML")
100+
Warning message:
101+
In lineVar(data, lag, r = r, include = include, model = "VECM", :
102+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
103+
Setting include='none'.
89104
> vecm_ML_l1_LRc_exo <-VECM(barry, lag=1, LRinclude="const", estim="ML", exogen=exoVar)
105+
Warning message:
106+
In lineVar(data, lag, r = r, include = include, model = "VECM", :
107+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
108+
Setting include='none'.
90109
> vecm_ML_l1_LRtr <-VECM(barry, lag=1, LRinclude="trend", estim="ML")
91110
> vecm_ML_l1_LRtr_exo <-VECM(barry, lag=1, LRinclude="trend", estim="ML", exogen=exoVar)
92111
> vecm_ML_l1_LRtr_noCo <-VECM(barry, lag=1, LRinclude="trend", include="none", estim="ML")
93112
> vecm_ML_l1_LRbo <-VECM(barry, lag=1, LRinclude="both", estim="ML")
113+
Warning message:
114+
In lineVar(data, lag, r = r, include = include, model = "VECM", :
115+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
116+
Setting include='none'.
94117
> vecm_ML_l1_LRbo_exo <-VECM(barry, lag=1, LRinclude="both", estim="ML", exogen=exoVar)
118+
Warning message:
119+
In lineVar(data, lag, r = r, include = include, model = "VECM", :
120+
When `LRinclude` is either 'const' or 'both', `include` can only be `none`.
121+
Setting include='none'.
95122
>
96123
> vecm_all <- list(
97124
+ vecm_OLS_l1_co=vecm_OLS_l1_co,

tests/compare_tsDyn_vars.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ vecm_l3_bo_var <- ca.jo(Canada, K=4, ecdet="none", spec="transitory", dumvar = t
2626

2727

2828
### restricted cons
29-
vecm_l1_LRco_tsD <-VECM(Canada, lag=1, LRinclude="const", estim="ML")
29+
vecm_l1_LRco_tsD <-VECM(Canada, lag=1, LRinclude="const", estim="ML", include="none")
3030
vecm_l1_LRco_var <- ca.jo(Canada, K=2, ecdet="const", spec="transitory")
3131

32-
vecm_l3_LRco_tsD <-VECM(Canada, lag=3, LRinclude="const", estim="ML")
32+
vecm_l3_LRco_tsD <-VECM(Canada, lag=3, LRinclude="const", estim="ML", include="none")
3333
vecm_l3_LRco_var <- ca.jo(Canada, K=4, ecdet="const", spec="transitory")
3434

3535
### restricted trend

tests/compare_tsDyn_vars.Rout.save

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ Loading required package: lmtest
5858
>
5959
>
6060
> ### restricted cons
61-
> vecm_l1_LRco_tsD <-VECM(Canada, lag=1, LRinclude="const", estim="ML")
61+
> vecm_l1_LRco_tsD <-VECM(Canada, lag=1, LRinclude="const", estim="ML", include="none")
6262
> vecm_l1_LRco_var <- ca.jo(Canada, K=2, ecdet="const", spec="transitory")
6363
>
64-
> vecm_l3_LRco_tsD <-VECM(Canada, lag=3, LRinclude="const", estim="ML")
64+
> vecm_l3_LRco_tsD <-VECM(Canada, lag=3, LRinclude="const", estim="ML", include="none")
6565
> vecm_l3_LRco_var <- ca.jo(Canada, K=4, ecdet="const", spec="transitory")
6666
>
6767
> ### restricted trend

0 commit comments

Comments
 (0)