# Tsay (1998) "Testing and Modeling Multivariate # Threshold Models", J. of American Statistical Assn, vol. 93, no. 443, # 1188-1202. # U.S. Interest Rates example. Data are similar, but not identical to # those used in the paper. install.packages("tsDyn") install.packages("texreg") library(tsDyn) library(texreg) tsaydata = read.csv("http://condor.depaul.edu/jlee141/datalib/usrates.csv", header=TRUE) attributes(tsaydata) indat <- tsaydata[2:410,] indat$g3month <- log(tsaydata$FCM3[2:410]/tsaydata$FCM3[1:409]) indat$g3year <- log(tsaydata$FTB3[2:410]/tsaydata$FTB3[1:409]) invar <- c("g3month", "g3year") indata1 <- indat[invar] head(indata1) model1 <- TVAR(indata1, lag=7, nthresh=3, thDelay=1, trim=0.1, mTh=1, plot=TRUE) summary(model1) invar <- c( "g3year","g3month") indata2 <- indat[invar] head(indata2) model2 <- TVAR(indata2, lag=7, nthresh=3, thDelay=1, trim=0.1, mTh=1, plot=TRUE) summary(model2)