Learn R Programming

tsDyn (version 11.0.4.1)

selectSETAR: Automatic selection of SETAR hyper-parameters

Description

Automatic selection of SETAR hyper-parameters

Usage

selectSETAR(x, m, d=1, steps=d, series, mL, mH,mM, thDelay=0, mTh, thVar, 
	    th=MakeThSpec(), trace=TRUE, include = c("const", "trend","none", "both"), 
	    common=c("none", "include","lags", "both"), model=c("TAR", "MTAR"), 
	    ML=seq_len(mL), MH=seq_len(mH), MM=seq_len(mM), nthresh=1, trim=0.15,
	    criterion = c("pooled-AIC", "AIC","BIC", "SSR"),  plot=TRUE,
	    max.iter=2, type=c("level", "diff", "ADF"), same.lags=FALSE, 
	    restriction=c("none","OuterSymAll","OuterSymTh"),  hpc=c("none", "foreach") )

Value

An object of class selectSETAR (print and plot methods) with:

res

A data-frame, with columns giving hyper-parameter values and the computed AIC for each row (only the best 10/5s are returned)

res2

Same as res, returned if nthresh=2 otherwise set to NULL

bests

estimated hyper-parameters

th, firstBests, bests2th, ML, MM, MH

estimated parameters, from first and conditional search

criterion, nthresh,same.lags

returns args given by user

allTh

all threshold values and corresponding criterion from first search

Arguments

x

time series

m, d, steps

embedding parameters. For their meanings, see help about nlar

series

time series name (optional)

mL, mH,mM

autoregressive order for ‘low’ (mL) ‘middle’ (mM, only useful if nthresh=2) and ‘high’ (mH) regime (default values: m). Must be <=m. Alternatively, you can specify ML

thDelay

Vector of possible ‘threshold delay’ values to check for

mTh

coefficients for the lagged time series, to obtain the threshold variable

thVar

external threshold variable

th

Different specifications of the grid search, to pre-specify a value or set the number of points to search. SeeMakeThSpec

trace

should additional infos be printed? (logical)

include

Type of deterministic regressors to include

common

Indicates which elements are common to all regimes: no, only the include variables, the lags or both

model

Currently not implemented

ML,MM,MH

vector of lags for order for ‘low’ (ML) ‘middle’ (MM, only useful if nthresh=2) and ‘high’ (MH)regime. Max must be <=m

nthresh

Number of threshold of the model

trim

trimming parameter indicating the minimal percentage of observations in each regime. Default to 0.15

criterion

Model selection criterion

plot

Should a plot showing the criterion values be printed? (logical)

max.iter

Number of iterations for the algorithm

type

Whether the variable is taken is level, difference or a mix (diff y= y-1, diff lags) as in the ADF test

same.lags

Logical. When AIC or pooled-AIC is used and arg m is given, should it search for same number of lags in each regime (TRUE) or allow for different (FALSE) lags in each regime. Different lags involves more computation

restriction

Restriction on the threshold. OuterSymAll will take a symmetric threshold and symmetric coefficients for outer regimes. OuterSymTh currently unavailable

hpc

Possibility to run the bootstrap on parallel core. See details

Author

Antonio, Fabio Di Narzo and Stigler, Matthieu

Details

Routine for automatic selection of SETAR models hyper parameters.

An exhaustive search over all possible combinations of values of specified hyper-parameters is performed. Thus the threshold delay, the number of lags in each regime and the threshold value are computed.

Embedding parameters d,steps are kept fixed.

Possible criteria are the usual SSR, AIC and a pooled AIC formula: \(AIC(low regime model) + AIC(high regime model)\). The default criterion is the pooled AIC formula. SSR criterion can't be used to compare models with different lags.

When two thresholds(nthresh=2) have to be computed, the search for the second is made conditional on results for first threshold as suggested in Gonzalo and Pittarakis (2002). Refinements can be obtained by using max.iter (first threshold being re-estimated based on the second one). If SSR is used, the number of lags in the inner regime is either the same if only arg m was given, otherwise it has to be pre-specified. Criterion AIC can be used to determine the number of lags in the nner regime, whereas pooled-AIC is currently not implemented for nthresh=2.

By default, all threshold values excluding the upper and lower trim of the threshold values are taken as potential threshold. restriction can be made with arg th. See function MakeThSpec.

With the argument hpc, the heavy grid search can be run on parallel cores, thus alleviating the time of computation. Preliminary results indicate however that the length of the series must be very considerable in order that the parallel code becomes advantageous. To use it, the user needs simply to choose a package (among doMC, doMPI, doSNOW or doRedis) and register the backend. See the vignette for more details.

References

Gonzalo, J. & Pitarakis, J. (2002) Estimation and model selection based inference in single and multiple threshold models, Journal of Econometrics, 110, 319 - 352

See Also

selectLSTAR, selectNNET, MakeThSpec

Examples

Run this code
llynx <- log10(lynx)
selectSETAR(llynx, m=2)
#Suggested model is the following:
setar(llynx, m=2, thDelay=1, th=3.4)

Run the code above in your browser using DataLab