TVECM: Threshold Vector Error Correction model (VECM)

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/TVECM.R

Description

Estimate a Threshold Vector Error Correction model (VECM)

Usage

1
2
3
4
5
6
7
8
TVECM(data, lag = 1, nthresh = 1, trim = 0.05, ngridBeta = 50,
  ngridTh = 50, plot = TRUE, th1 = list(exact = NULL, int = c("from",
  "to"), around = "val"), th2 = list(exact = NULL, int = c("from", "to"),
  around = "val"), beta = list(exact = NULL, int = c("from", "to"), around =
  c("val", "by")), restr = c("none", "equal", "signOp"), common = c("All",
  "only_ECT"), include = c("const", "trend", "none", "both"),
  dummyToBothRegimes = TRUE, beta0 = 0, methodMapply = FALSE,
  trace = TRUE)

Arguments

data

time series

lag

Number of lags to include in each regime

nthresh

number of threshold (see details)

trim

trimming parameter indicating the minimal percentage of observations in each regime

ngridBeta

number of elements to search for the cointegrating value

ngridTh

number of elements to search for the threshold value

plot

Whether the grid with the SSR of each threshold should be ploted.

th1

different possibilities to pre-specify an exact value, an interval or a central point for the search of the threshold (or first threshold if nthresh=2)

th2

different possibilities to pre-specify an exact value or a central point for the search of the second threshold (used only if nthresh=2)

beta

different possibilities to pre-specify an exact value, an interval or a central point for the search of the cointegrating value

restr

Currently not avalaible

common

Whether the regime-specific dynamics are only for the ECT or for the ECT and the lags

include

Type of deterministic regressors to include

dummyToBothRegimes

Whether the dummy in the one threshold model is applied to each regime or not.

beta0

Additional regressors to include in the cointegrating relation

methodMapply

only for programming. Is to make the choice between a for loop or mapply implementation

trace

should additional infos be printed? (logical)

Details

For fixed threshold and cointegrating vector, the model is linear, so estimation of the regression parameters can be done directly by CLS (Conditional Least Squares). The search of the threshold and cointegrating parameters values which minimize the residual sum of squares (SSR) is made on a grid of potential values. For specification of the grids, see below.

The function can estimate one as well as two thresholds:

nthresh=1:

estimation of one threshold model (two regimes) upon a grid of ngridTh values (default to ALL) possible thresholds and delays values.

nthresh=2:

estimation of two thresholds model (three regimes). Conditional on the threshold found in model where nthresh=1, the second threshold is searched. When both are found, a second grid search is made with 30 values around each threshold.

The model can be either with a threshold effect on all variables ("All") or only on the error correction term (ECT) (argument "only ECT"). In the second case, the value for the middle threshold is taken a null, as in Balke and Fomby (1997).

The grid for the threshold parameters can be set in different ways, through the argument th1, th2 and beta:

exact:

Pre-specified value.

int:

Specify an interval (of length ngridTh) in which to search.

around:

Specify to take ngridTh points around the value given.

The default is to do an interval search. Interval bounds for the threshold interval are simply the trim and 1-trim percents of the sorted error correction term. For the cointegrating parameter, bounds of the interval are obtained from the (OLS) confidence interval of the linear cointegration case. It is often found however that this interval is too tight. It is hence recommended to inspect the plot of the grid search.

Value

Fitted model data

Author(s)

Matthieu Stigler

References

Hansen, B. and Seo, B. (2002), Testing for two-regime threshold cointegration in vector error-correction models, Journal of Econometrics, 110, pages 293 - 318

Seo, M. H. (2009) Estimation of non linear error-correction models, Working paper

See Also

VECM for the linear VECM, TVAR for the threshold VAR, TVECM.SeoTest to test for TVECM, TVECM.sim to simulate/bootstrap a TVECM.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(zeroyld)
data<-zeroyld

##Estimate a TVECM (we use here minimal grid, it should be usually much bigger!)

tv<-TVECM(data, nthresh=2,lag=1, ngridBeta=20, ngridTh=30, plot=TRUE,trim=0.05, common="All")

print(tv)
summary(tv)

#Obtain diverse infos:
AIC(tv)
BIC(tv)

res.tv<-residuals(tv)

#export the equations as Latex:
toLatex(tv)

Example output

29 (4.8%) points of the grid lead to regimes with percentage of observations < trim and were not computed
Best threshold from first search -1.312 
Best cointegrating value 1.045747 
Second best (conditionnal on the first one) -1.312 0.774 	 SSR 155.4941 
Second step best thresholds -1.312 0.774 			 SSR 155.4941 
Model TVECM with  2  thresholds

$Bdown
                         ECT     Const short.run t -1 long.run t -1
Equation short.run 0.2343191 0.5627267      0.2133872   -0.13045497
Equation long.run  1.1492230 1.9445867      0.7652367    0.02490849

$Bmiddle
                           ECT        Const short.run t -1 long.run t -1
Equation short.run -0.01031875  0.007322243     0.09944158    0.06907443
Equation long.run   0.01991474 -0.005735839     0.32699066    0.23687489

$Bup
                           ECT       Const short.run t -1 long.run t -1
Equation short.run -0.04920032  0.06691590    -0.11216037    0.04637838
Equation long.run   0.10732160 -0.09079342     0.08524092   -0.02873180


Threshold value[1] -1.312  0.774
#############
###Model TVECM
#############
Full sample size: 482 	End sample size: 480
Number of variables: 2 	Number of estimated parameters 24
AIC -2223.223 	BIC -2114.704 	SSR 155.4941 


Cointegrating vector: (1, - 1.045747 )
$Bdown
                   ECT                Const              short.run t -1  
Equation short.run 0.2343(0.0207)*    0.5627(0.0041)**   0.2134(0.2238)  
Equation long.run  1.1492(1.0e-11)*** 1.9446(2.1e-09)*** 0.7652(0.0077)**
                   long.run t -1   
Equation short.run -0.1305(0.1683) 
Equation long.run  0.0249(0.8718)  

$Bmiddle
                   ECT              Const            short.run t -1 
Equation short.run -0.0103(0.7758)  0.0073(0.6884)   0.0994(0.3462) 
Equation long.run  0.0199(0.7362)   -0.0057(0.8473)  0.3270(0.0580).
                   long.run t -1   
Equation short.run 0.0691(0.2101)  
Equation long.run  0.2369(0.0086)**

$Bup
                   ECT              Const            short.run t -1  
Equation short.run -0.0492(0.4402)  0.0669(0.4232)   -0.1122(0.2911) 
Equation long.run  0.1073(0.3022)   -0.0908(0.5053)  0.0852(0.6227)  
                   long.run t -1   
Equation short.run 0.0464(0.5256)  
Equation long.run  -0.0287(0.8095) 


Threshold
Values: -1.312 0.774
Percentage of Observations in each regime 6.7% 56.9% 36.5% 
[1] -2223.223
[1] -2114.704
%insert in the preamble and uncomment the line you want for usual /medium /small matrix
%\usepackage{amsmath} \newenvironment{smatrix}{\begin{pmatrix}}{\end{pmatrix}} %USUAL
%\usepackage{amsmath} \newenvironment{smatrix}{\left(\begin{smallmatrix}}{\end{smallmatrix}\right)} %SMALL
%\usepackage{nccmath} \newenvironment{smatrix}{\left(\begin{mmatrix}}{\end{mmatrix}\right)} %MEDIUM
\begin{equation}
\begin{smatrix} %explained vector
\Delta X_{t}^{1} \\ \Delta X_{t}^{2}
\end{smatrix}=
\left\{
\begin{array}{ll}
\begin{smatrix} %ECT
0.2343 \\ 1.1492
\end{smatrix}ECT_{-1}+
\begin{smatrix}     %const
0.5627 \\ 1.9446
\end{smatrix}
+\begin{smatrix}      %Lag1
0.2134 & -0.1305 \\
0.7652 & 0.0249 
\end{smatrix}
\begin{smatrix}
\Delta X_{t-1}^{1} \\ \Delta X_{t-1}^{2}
\end{smatrix}
& \text{if Th}< -1.312 \\
\begin{smatrix} %ECT
-0.0103 \\ 0.0199
\end{smatrix}ECT_{-1}+
\begin{smatrix}     %const
0.0073 \\ -0.0057
\end{smatrix}
+\begin{smatrix}      %Lag1
0.0994 & 0.0691 \\
0.3270 & 0.2369 
\end{smatrix}
\begin{smatrix}
\Delta X_{t-1}^{1} \\ \Delta X_{t-1}^{2}
\end{smatrix}
& \text{if } -1.312 < \text{Th} < 0.774 \\
\begin{smatrix} %ECT
-0.0492 \\ 0.1073
\end{smatrix}ECT_{-1}+
\begin{smatrix}     %const
0.0669 \\ -0.0908
\end{smatrix}
+\begin{smatrix}      %Lag1
-0.1122 & 0.0464 \\
0.0852 & -0.0287 
\end{smatrix}
\begin{smatrix}
\Delta X_{t-1}^{1} \\ \Delta X_{t-1}^{2}
\end{smatrix}
& \text{if Th}> 0.774 \\
\end{array}
\right.
\end{equation}

tsDyn documentation built on May 29, 2017, 10:48 a.m.