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 )
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).
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