setarTest: Test of linearity against threshold (SETAR)

View source: R/setarTest.R

setarTestR Documentation

Test of linearity against threshold (SETAR)

Description

Test of linearity against threshold of Hansen (1999) with bootstrap distribution

Usage

setarTest(
  x,
  m,
  thDelay = 0,
  trim = 0.1,
  include = c("const", "trend", "none", "both"),
  nboot = 10,
  test = c("1vs", "2vs3"),
  hpc = c("none", "foreach"),
  boot.scheme = c("resample", "resample_block", "wild1", "wild2", "check"),
  seed = NULL
)

Arguments

x

time series

m, thDelay

lag and 'time delay' for the threshold variable

trim

trimming parameter indicating the minimal percentage of observations in each regime

include

Type of deterministic regressors to include: none, a constant, a trend, or constant and trend (both).

nboot

number of bootstrap replications

test

whether to test AR against SETAR, or SETAR(1 reg) against SETAR(2 reg)

hpc

Possibility to run the bootstrap on parallel core. See details in

boot.scheme

Type of resampling scheme to use for the residuals. See resample_vec.

seed

Seed used in the bootstrap resampling TVECM.HStest

Details

Estimation of the first threshold parameter is made with CLS, a conditional search with one iteration is made for the second threshold. The Ftest comparing the residual sum of squares (SSR) of each model is computed.

F_{ij}=T( (S_{i}-S_{j})/S_{j} )

where S_{i} is the SSR of the model with i regimes (and so i-1 thresholds).

Three test are available. The both first can be seen as linearity test, whereas the third can be seen as a specification test: once the 1vs2 or/and 1vs3 rejected the linearity and henceforth accepted the presence of a threshold, is a model with one or two thresholds preferable?

Test 1vs2: Linear AR versus 1 threshold TAR

Test 1vs3: Linear AR versus 2 thresholds TAR

Test 2vs3: 1 threshold TAR versus 2 thresholds TAR

The two first tests are computed together and available with test="1vs". The third test is available with test="2vs3".

The homoskedastic bootstrap distribution is based on resampling the residuals from H0 model (ar for test 1vs, and setar(1) for test 2vs3), estimating the threshold parameter and then computing the Ftest, so it involves many computations and is pretty slow.

Value

A object of class "Hansen99Test" containing:

SSRs

The residual Sum of squares of model AR, 1 threshold TAR and 2 thresholds TAR

Ftests

The Ftest statistic for the test

PvalBoot

The bootstrap p-values for the test selected

CriticalValBoot

The critical values for the test selected

Ftestboot

All the F-test computed

firstBests, secBests

The thresholds for the original series, obtained from search for 1 thresh (firstBests) and conditional search for 2 thresh (secBests)

nboot, m

The number of bootstrap replications (nboot), the lags used (m)

Author(s)

Matthieu Stigler

References

Hansen (1999) Testing for linearity, Journal of Economic Surveys, Volume 13, Number 5, December 1999 , pp. 551-576(26) available at: https://www.ssc.wisc.edu/~bhansen/papers/cv.htm

See Also

TVAR.LRtest for the multivariate version. SETAR for estimation of the model.

Examples


#Data used by Hansen
sun <- (sqrt(sunspot.year + 1) - 1) * 2

#Test 1vs2 and 1vs3
#setarTest(sun, m=11, thDelay=0:1, nboot=5,trim=0.1, test="1vs")

tsDyn documentation built on Oct. 31, 2024, 5:08 p.m.