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 )mapply implementationThe function can estimate one as well as two thresholds:
[object Object],[object Object]
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:
[object Object],[object Object],[object Object]
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.
Seo, M. H. (2009) Estimation of non linear error-correction models, Working paper
VECM for the linear VECM, TVAR for the threshold VAR, TVECM.SeoTest to test for TVECM, TVECM.sim to simulate/bootstrap a TVECM.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)Run the code above in your browser using DataLab