Tests the null of linear cointegration against threshold cointegration following Hansen and Seo (2002). Fixed regressor anfd residual bootstrap are available.

1 2 3 4 |

`data` |
Time series |

`lag` |
Number of lags to include in each regime |

`ngridTh` |
Number of threshold points to estimate |

`trim` |
Trimming parameter indicating the minimal percentage of observations in each regime |

`nboot` |
Number of bootstrap replications |

`fixed.beta` |
Numeric. User pre-specified cointegrating value. When NULL (default), the value is estimated from the linear VECM. |

`intercept` |
Logical. Whether an intercept has to be included in the VECM |

`boot.type` |
Character. Type of bootstrap simulation (only if nboot>0) |

`hpc` |
Possibility to run the bootstrap on parallel core. See details |

This test follows the implementation done by Hansen and Seo (2002). The cointegrating value is estimated from the linear VECM. Then, conditional on this value, the LM test is run for a range of different threshold values. The maximum of those LM test values is reported.

Two bootstrap are available: a fixed regressor, as well as a usual residual bootstrap (using the function `TVECM.sim`

).

Available methods are `print()`

, `summary()`

and `plot()`

.

With the argument `hpc`

, the burdensome bootstrap replication can be run on parallel cores, thus alleviating the time of computation. The user needs simply to choose a package (among doMC, doMPI, doSNOW or doRedis) and register the backend. See the vignette for more details.

A list cointaining diverse values:

`stat` |
The sup-LM statistic. |

`values` |
The whole LM values. |

`PvalBoot` |
The bootstrap p-value |

`CriticalValBoot` |
The bootstrap critical values |

`allBoots` |
The boot sup-LM values |

`args` |
Some user given args (nboot, boot.type) |

Comparison with original paper is made difficult as values of the test are not shown in the paper, only their critical values, which depend on random bootstrap.

Comparison is done with the GAUSS code available on the page of Bruce Hansen. Running tar_ci, we have the same sup-LM value when lags=1 and lags=2, a higher value with lag=3. When the test is run with pre-specified beta values, we have different results, sometimes higher but also smaller sup-LM value.

Matthieu Stigler

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

`zeroyld`

: data used in the original paper of Hansen and Seo.

`TVECM.SeoTest`

: a similar test, but with null hypothesis of no-cointegration.

`TVECM`

for estimating a TVECM, `TVECM.sim`

for simulating/bootstrap a TVECM,

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
#Use original data from paper:
data(zeroyld)
dataPaper<-zeroyld
# Test: nboot, number of bootstrap replications, should be high
## Not run:
test1<-TVECM.HStest(dataPaper, lag=1, intercept=TRUE, nboot=1000)
## End(Not run)
#we use here for the example a much smaller number of bootstrap:
test1<-TVECM.HStest(dataPaper, lag=1, intercept=TRUE, nboot=10)
test1
summary(test1)
plot(test1)
#can have only specific plots:
plot(test1, which="LM values")
plot(test1, which="Density")
## Run the function in parallel:
## Not run:
#we show here the use with package doMC
library(doMC)
registerDoMC(2) #Number of cores
test1<-TVECM.HStest(dataPaper, lag=1, intercept=TRUE, nboot=1000, hpc="foreach")
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.