Nonlinear Time Series Models - Notes | ECON 584, Study notes of Economics

Material Type: Notes; Class: ECONOMETRIC THY II; Subject: Economics; University: University of Washington - Seattle; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 03/18/2009

koofers-user-dvs
koofers-user-dvs 🇺🇸

5

(1)

10 documents

1 / 59

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
This is page 651
Printer: Opaque this
18
Nonlinear Time Series Models
18.1 Introduction
Most of the time series models discussed in the previous chapters are lin-
ear time series models. Although they remain at the forefront of academic
and applied research, it has often been found that simple linear time series
models usually leave certain aspects of economic and financial data un-
explained. Since economic and financial systems are known to go through
both structural and behavioral changes, it is reasonable to assume that dif-
ferent time series models may be required to explain the empirical data at
dierent times. This chapter introduces some popular nonlinear time series
models that have been found to be eective at modeling nonlinear behavior
in economic and financial time series data.
To model nonlinear behavior in economic and financial time series, it
seems natural to allow for the existence of dierent states of the world or
regim es and to allow the dynamics to be dierent in dierent regimes. This
chapter focuses on models that assume in each regime the dynamic be-
havior of the time series is determined by an autoregressive (AR) model,
such as threshold AR, self-exciting threshold AR and smooth transition AR
models. This is because simple AR models are arguably the most popular
time series model and are easily estimated using regression methods. By ex-
tending AR models to allow for nonlinear behavior, the resulting nonlinear
models are easy to understand and interpret. In addition, this chapter also
covers more general Markov switching models using state space represen-
tations. The types of models that can be cast into this form are enormous.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b

Partial preview of the text

Download Nonlinear Time Series Models - Notes | ECON 584 and more Study notes Economics in PDF only on Docsity!

This is page 651 Printer: Opaque this

Nonlinear Time Series Models

18.1 Introduction

Most of the time series models discussed in the previous chapters are lin- ear time series models. Although they remain at the forefront of academic and applied research, it has often been found that simple linear time series models usually leave certain aspects of economic and financial data un- explained. Since economic and financial systems are known to go through both structural and behavioral changes, it is reasonable to assume that dif- ferent time series models may be required to explain the empirical data at different times. This chapter introduces some popular nonlinear time series models that have been found to be effective at modeling nonlinear behavior in economic and financial time series data. To model nonlinear behavior in economic and financial time series, it seems natural to allow for the existence of different states of the world or regimes and to allow the dynamics to be different in different regimes. This chapter focuses on models that assume in each regime the dynamic be- havior of the time series is determined by an autoregressive (AR) model, such as threshold AR, self-exciting threshold AR and smooth transition AR models. This is because simple AR models are arguably the most popular time series model and are easily estimated using regression methods. By ex- tending AR models to allow for nonlinear behavior, the resulting nonlinear models are easy to understand and interpret. In addition, this chapter also covers more general Markov switching models using state space represen- tations. The types of models that can be cast into this form are enormous.

652 18. Nonlinear Time Series Models

However, there are many other types of nonlinear time series models that are not covered in this chapter, such as bilinear models, k nearest neighbor methods and neural network models^1. Book length treatment of nonlinear time series models can be found in Tong (1990), Granger and Ter¨asvirta (1993) and Franses and van Dijk (2000). Kim and Nelson (1999) provides a comprehensive account of different Markov switching models that have been used in economic and financial research. Given the wide range of nonlinear time series models available and the inherent flexibility of these models, the possibility of getting a spuriously good fit to any time series data set is very high. Therefore it is usually rec- ommended to perform a test of linearity against nonlinearity before building a possibly complex nonlinear model. Section 18.2 first introduces a popular test for nonlinearity, the BDS test, which has been found to have power against a wide range of nonlinear time series models. There are many other types of nonlinearity tests that are developed to test against specific non- linear models. Some of these tests will be introduced together with the nonlinear models in later sections. For example, Section 18.3 introduces threshold AR models and two tests for threshold nonlinearity, and Sec- tion 18.4 introduces smooth transition AR (STAR) models and a test for STAR nonlinearity. Finally Section 18.5 describes the Markov switching state space models and Section 18.6 gives an extended example of how to estimate Markov switching models in S+FinMetrics.

18.2 BDS Test for Nonlinearity

The BDS test developed by Brock, Dechert and Scheinkman (1987) (and later published as Brock, Dechert, Scheinkman and LeBaron, 1996) is ar- guably the most popular test for nonlinearity. It was originally designed to test for the null hypothesis of independent and identical distribution (iid) for the purpose of detecting non-random chaotic dynamics.^2 How- ever, many studies have shown that BDS test has power against a wide range of linear and nonlinear alternatives, for example, see Brock, Hsieh and LeBaron (1991) and Barnett, Gallant, Hinich, Jungeilges, Kaplan and Jensen (1997). In addition, it can also be used as a portmanteau test or mis-specification test when applied to the residuals from a fitted model. In particular, when applied to the residuals from a fitted linear time se- ries model, the BDS test can be used to detect remaining dependence and the presence of omitted nonlinear structure. If the null hypothesis cannot be rejected, then the original linear model cannot be rejected; if the null

(^1) A function to estimate single-hidden-layer neural network models is in the nnet library provided with S-PLUS. (^2) Loosely speaking, a time series is said to be “chaotic” if it follows a nonlinear de- terministic process but looks random.

654 18. Nonlinear Time Series Models

Nominal Size

Monte Carlo Size

0.2 0.4 0.6 0.

m= m= m= m=

FIGURE 18.1. Size of BDS test statistics using t distribution.

args(BDSTest) function(x, m = 3, eps = NULL, variable.removal = T)

where x specifies the time series to be tested, m instructs the test to use the embedding dimensions from 2 to m, and eps specifies in units of sample standard deviations the distance threshold  in (18.1). By default, BDSTest computes the BDS statistics with  set to 0.5, 1, 1.5 and 2 standard deviations of the data set. When the optional argument variable.removal is set to TRUE, different numbers of points in the sample are removed for different values of m such that the test is always computed using all the sample observations available; if it is set to FALSE, the same points are removed for different values of m such that the test is always computed using the same sample observations.

Example 116 Size of BDS test

The following script illustrates how to use the BDSTest function in a Monte Carlo experiment to investigate the size of the BDS test:

set.seed(10) size.mat = matrix(0, 1000, 4) for (i in 1:1000) { if (i %% 100 == 0) { cat("i =", i, "\n") }

18.2 BDS Test for Nonlinearity 655

test.dat = rt(500, df=8) size.mat[i,] = BDSTest(test.dat, m=5, eps=1)$stat[,1] }

One advantage of the BDS test is that it is a statistic which requires no distributional assumption on the data to be tested. In fact, in the above Monte Carlo experiment, the data are simulated from a t distribution with 8 degrees of freedom. Each simulated sample has 500 observations, which is usually thought to be the minimal sample size for the BDS test to have reliable performance. The data are simulated 1000 times and BDS statistics using embedding dimensions from 2 to 5 are computed by setting  to one standard deviation of the sample observations. The following commands plot the size of the “one-sided” test against its nominal value:^4

size.p = seq(0.05, 0.95, by=0.05) size.q = qnorm(size.p) size.bds = apply(size.mat, 2,

  • function(x) colMeans(outer(x, size.q, FUN="<=")))

par(fty="s") matplot(matrix(size.p, nrow=length(size.p), ncol=4),

  • size.bds, type="l",
  • xlab="Nominal Size", ylab="Monte Carlo Size")

legend(0.6, 0.3, paste("m=",2:5,sep=""), type="l", lty=1:4)

and the result is shown in Figure 18.1. Considering the Monte Carlo experiment is conducted using only 1000 replications, the plot shows the test has very good size behavior for all the chosen embedding dimensions.

18.2.3 BDS Test As a Nonlinearity Test and a

Mis-specification Test

Another advantage of the BDS test is that when applied to model residu- als, the first order asymptotic distribution of BDS statistic given in (18.3) is independent of estimation errors under certain sufficient conditions. In general, de Lima (1996) shows that for linear additive models, or models that can be transformed into that format, the BDS test is nuisance param- eter free and does not require any adjustment when applied to fitted model residuals. Thus the BDS test can be used as a test for nonlinearity, or as a test for model mis-specification.

Example 117 Nonlinearity in weekly returns of Dutch Guilder foreign ex- change rates

(^4) The BDS test is actually a two-sided test. However, for the purpose of illustrating distributional properties of BDS statistics, the plots are generated using the “incorrect” one-sided test.

18.2 BDS Test for Nonlinearity 657

All the estimated parameters in DFX.garch are highly significant ex- cept for the conditional mean parameter C. To evaluate if the GARCH(1,1) model adequately captures the nonlinear structure in DFX.ts, the BDS test can be used again on the standardized residuals of DFX.garch as a mis- specification test. There are two ways to apply the BDS test to GARCH standardized residuals: one is to apply the BDS test directly to the stan- dardized residuals:

BDSTest(residuals(DFX.garch, standard=T), m=5,

  • eps=c(0.5, 1, 1.5))

BDS Test for Independence and Identical Distribution

Null Hypothesis: residuals(DFX.garch, standard = T) is independently and identically distributed.

Embedding dimension = 2 3 4 5

Epsilon for close points = 0.5002 1.0004 1.

Test Statistics = [ 0.5 ] [ 1 ] [ 1.5 ] [ 2 ] -1.9487 -1.5430 -1. [ 3 ] -1.4581 -1.1172 -1. [ 4 ] -1.2832 -0.9735 -1. [ 5 ] -0.8634 -0.6079 -0.

p-value = [ 0.5 ] [ 1 ] [ 1.5 ] [ 2 ] 0.0513 0.1228 0. [ 3 ] 0.1448 0.2639 0. [ 4 ] 0.1994 0.3303 0. [ 5 ] 0.3879 0.5432 0.

and the other is to apply it to the logarithms of squared standardized residuals:^5

BDSTest(log(residuals(DFX.garch, standard=T)^2),

  • m=5, eps=c(0.5, 1, 1.5))

BDS Test for Independence and Identical Distribution

(^5) When BDSTest function is applied to a fitted model object, it is currently always applied to the residuals of the fittd model, instead of standardized residuals or logarithms of squared standardized residuals.

658 18. Nonlinear Time Series Models

Null Hypothesis: log(residuals(DFX.garch, standard = T)^2) is independently and identically distributed.

Embedding dimension = 2 3 4 5

Epsilon for close points = 1.1218 2.2435 3.

Test Statistics = [ 1.12 ] [ 2.24 ] [ 3.37 ] [ 2 ] -0.6461 -0.5538 -0. [ 3 ] -0.8508 -0.9030 -0. [ 4 ] -0.7540 -0.9977 -1. [ 5 ] -0.9397 -0.8581 -1.

p-value = [ 1.12 ] [ 2.24 ] [ 3.37 ] [ 2 ] 0.5182 0.5797 0. [ 3 ] 0.3949 0.3665 0. [ 4 ] 0.4509 0.3184 0. [ 5 ] 0.3474 0.3909 0.

Here, both ways of applying the BDS test suggest that the GARCH(1,1) model provides an adequate fit to the original data and successfully removes the nonlinearity in the data. In general, when applied to standardized resid- uals from a fitted GARCH model, earlier studies (for example, see Brock, Hsieh and LeBaron, 1991) suggest that the BDS statistic needs to be ad- justed to have the right size and Monte Carlo simulations are usually relied upon to derive the adjustment factor for specific GARCH models. How- ever, following suggestions in Brock and Potter (1993) and de Lima (1996), recent studies (for example, see Caporale, Ntantamis, Pantelidis and Pittis, 2004 and Fernandes and Preumont, 2004) show that if applied to the loga- rithms of squared standardized residuals from a fitted GARCH model, the BDS test actually has correct size, because the logarithmic transformation casts the GARCH model into a linear additive model which satisfies the conditions in de Lima (1996) for the BDS test to be nuisance parameter free.^6

Example 118 Size of BDS mis-specification test for GARCH models

The following script performs a Monte Carlo experiment to illustrate the different size behavior of the BDS test when applied to standardized resid- uals and logarithms of squared standardized residuals for the GARCH(1,1) model. The data sets are simulated using the GARCH fit in DFX.garch with

(^6) Since GARCH models with leverage effects cannot be transformed into a linear additive model, BDS test may not have good size behavior for those models.

660 18. Nonlinear Time Series Models

1000 observations. The GARCH estimation and BDS test are repeated 1000 times.

set.seed(10) sim.garch.dat = simulate(DFX.garch, sigma=F, n.start=500, n=1000, n.rep=1000) size.garch.res = matrix(0, 1000, 4) size.garch.log = matrix(0, 1000, 4) for (i in 1:1000) { tmp = garch(sim.garch.dat[,i]~1, ~garch(1,1), trace=F) if (i %% 10 == 0) cat("Simulation No.", i, "\n") tmp.res = residuals(tmp, standardized=T) size.garch.res[i,] = BDSTest(tmp.res, m=5, eps=1)$stat[,1] size.garch.log[i,] = BDSTest(log(tmp.res^2), m=5, eps=1)$stat[,1] }

size.p = seq(0.05, 0.95, by=0.05) size.q = qnorm(size.p) size.garch.res = apply(size.garch.res, 2, function(x) colMeans(outer(x, size.q, FUN="<="))) size.garch.log = apply(size.garch.log, 2, function(x) colMeans(outer(x, size.q, FUN="<="))) As in Example 116, the sizes of the “one-sided” test applied to the stan- dardized residuals and the logarithms of squared standardized residuals are plotted against the nominal sizes in Figure 18.3 and Figure 18.2, respec- tively. Obviously the sizes of the BDS test computed using standardized residuals are off and become more conservative for larger values of m, but those using logarithms of squared standardized residuals are reliable.

18.3 Threshold Autoregressive Models

As discussed in the previous section, when there is no prior knowledge about the type of nonlinearity a time series may have, the BDS test can be used to test for the existence of nonlinearity in either the time series itself or the residuals from a fitted linear time series model. However, sometimes economic or financial theory, or even stylized empirical facts, may suggest a specific form of nonlinearity for a time series. In these cases, it is usually preferred to perform the test for the specific form of nonlinearity and build a nonlinear time series model for the form of nonlinearity detected. One popular class of nonlinear time series models is the threshold autore- gressive (TAR) models, which is probably first proposed by Tong (1978) and discussed in detail in Tong (1990). The TAR models are simple and

18.3 Threshold Autoregressive Models 661

easy to understand, but rich enough to generate complex nonlinear dy- namics. For example, it can be shown that the TAR models can have limit cycles and thus be used to model periodic time series, or produce asymme- tries and jump phenomena that cannot be captured by a linear time series model. In spite of the simplicity of the TAR model form, there are many free parameters to estimate and variables to choose when building a TAR model, and this has hindered its early use. Recently, however, much progress has been made with regard to specification and estimation of TAR models. The next section introduces the general form of TAR models and a special class called SETAR models, and then illustrates how to perform tests for threshold nonlinearity and estimate unknown parameters in TAR models using ready-to-use functions in S+FinMetrics.

18.3.1 TAR and SETAR Models

Consider a simple AR(p) model for a time series yt:^7

yt = μ + φ 1 yt− 1 + φ 2 yt− 2 + · · · + φpyt−p + σt (18.4)

where φi (i = 1, 2 , · · · , p) are the AR coefficients, t ∼ W N (0, 1) and σ > 0 is the standard deviation of disturbance term. The model parameters φ = (μ, φ 1 , φ 2 , · · · , φp) and σ are independent of time t and remain constant. To capture nonlinear dynamics, TAR models allow the model parameters to change according to the value of a weakly exogenous threshold variable zt:

yt = Xtφ(j)^ + σ(j)t if rj− 1 < zt ≤ rj (18.5)

where Xt = (1, yt− 1 , yt− 2 , · · · , yt−p), j = 1, 2 , · · · , k, and −∞ = r 0 < r 1 < · · · < rk = ∞. In essence, the k − 1 non-trivial thresholds (r 1 , r 2 , · · · , rk− 1 ) divide the domain of the threshold variable zt into k different regimes. In each different regime, the time series yt follows a different AR(p) model.^8 When the threshold variable zt = yt−d, with the delay parameter d being a positive integer, the dynamics or regime of yt is determined by its own lagged value yt−d and the TAR model is called a self-exciting TAR or SETAR model. For the ease of notation, let SETAR(1) denote the one- regime linear AR model with k = 1, SETAR(2) denote the two-regime TAR model with k = 2, etc. For the one-regime SETAR(1) model, −∞ = r 0 < r 1 = ∞ and the unknown parameters are Θ = (φ(1), σ(1)); for the

(^7) See Chapter 3 and the references therein for basic concepts in linear time series analysis. (^8) Although the AR order p is assumed to be the same in different regimes throughout this chapter and in the related S+FinMetrics functions for the ease of illustration and programming, in theory the AR order can be different for different regimes.

18.3 Threshold Autoregressive Models 663

To test for the existence of threshold-type nonlinearity, Tsay suggests to compute RLS estimates of φˆ in (18.6). If there is no threshold nonlinearity, the standardized predictive residuals ˆeπi from RLS of (18.6) should be white noise asymptotically and orthogonal to Xπi. However, if yt is a SETAR(j) process with j > 1, the RLS estimates of φˆ are biased and Ψˆ in the following auxiliary regression will be statistically significant:

ˆeπi = X^0 πi Ψ + uπi (18.7)

Thus the conventional F statistic for testing Ψ = 0 the above regression can be used as a test for threshold nonlinearity.

Example 119 SETAR nonlinearity in NASDAQ realized volatility

To illustrate the usage of Tsay’s F test for threshold nonlinearity, consider the weekly realized volatility of NASDAQ 100 index constructed as follows from the S+FinMetrics data set ndx.dat:

ndx.ret2 = getReturns(ndx.dat[,"Close"])^ ndx.rvol = sqrt(aggregate(ndx.ret2, FUN=sum, by="weeks",

  • week.align=1))

colIds(ndx.rvol) = "RVOL" par(mfrow=c(2,2)) plot(ndx.rvol, reference.grid=F, main="RVOL") plot(log(ndx.rvol), reference.grid=F, main="Log RVOL")

The levels and the logarithms of the weekly realized volatility series are shown in the top half of Figure ??. The time series plots suggest that the volatility may have switched to a different regime after the first quarter of

  1. Before testing for threshold nonlinearity, the ACF and PACF plots can be used to help identify the autoregressive order to use:

ndx.acf = acf(log(ndx.rvol)) ndx.pacf = acf(log(ndx.rvol), type="partial")

The resulting plots are shown in the bottom half of Figure 18.4. The ACF function decays very slowly and remains significant even after 30 lags, while the PACF function is significant for the first six lags. This suggests that an AR model with order from 2 to 6 may be considered as a starting point for modeling the logarithms of realized volatility log(ndx.rvol).^9 The S+FinMetrics function nonlinearTest can now be used to test for threshold nonlinearity:

nonlinearTest(log(ndx.rvol), method="threshold", p=6, d=1:6)

(^9) Hereinafter the logarithms of ndx.rvol are used because usually the logarithms of realized volatility tend to be normally distributed. See Andersen, Bollerslev, Diebold and Ebens (2001) for a detailed analysis of properties of realized volatility for stock returns.

664 18. Nonlinear Time Series Models

RVOL

Q1 Q3 Q1 1996 1997 1998 Q3 1999 Q3 Q1 Q3 2000 2001 Q

RVOL

Q1 Q3 Q1 1996 1997 1998 Q3 1999 Q3 Q1 Q3 2000 2001 Q

-4.

-3.

-2.

Lag

ACF

0 5 10 15 20

Series : log(ndx.rvol)

Lag

Partial ACF

0 5 10 15 20

Series : log(ndx.rvol)

FIGURE 18.4. Weekly realized volatility of NASDAQ 100 index.

Nonlinearity Test: Threshold Nonlinearity

Null Hypothesis: no threshold nonlinearity

F-stat dof P-val d=1 1.2568 (7,253) 0. d=2 1.4203 (7,253) 0. d=3 1.2586 (7,253) 0. d=4 0.5104 (7,253) 0. d=5 0.5224 (7,253) 0. d=6 0.1179 (7,253) 0.

Note that the optional argument p specifies the AR order to use in the arranged autoregression, and the optional argument d is used to select the delay parameters from 1 to 6. The output gives the F statistics and their corresponding p-values for all chosen values of delay parameter d, and shows that the evidence for threshold nonlinearity is not strong with the AR(6) specification. Since a high order AR model may actually approximate non- linear dynamics relatively well, a lower order AR(2) specification may also be tried:

nonlinearTest(log(ndx.rvol), method="threshold", p=2, d=1:2)

666 18. Nonlinear Time Series Models

Y_{t-1}

t-ratio of AR(1)

-3.5 -3.0 -2.5 -2.0 -1.

0

2

4

6

Y_{t-1}

t-ratio of AR(2)

-3.5 -3.0 -2.5 -2.0 -1.

FIGURE 18.5. Scatter plot of t-statistics of RLS estimates of AR coefficients versus ordered threshold variable.

par(mfrow=c(2,1)) plot(ndx.test$yd, ndx.test$tRatio[,1], xlab="Y_{t-1}",

  • ylab="t-ratio of AR(1)")

plot(ndx.test$yd, ndx.test$tRatio[,2], xlab="Y_{t-1}",

  • ylab="t-ratio of AR(2)")

The plots in Figure 18.5 show that both estimates are significant with t-statistics greater than 2 in absolute values in most cases. In addition, the trend in the t-statistics seems to have two breaks: one occurs when the threshold variable is around − 2 .8; and the other occurs when the threshold variable is around − 2 .4. This suggests a SETAR(3) model with two non- trivial threshold values: r 1 = − 2 .8 and r 2 = − 2 .4.

LS Estimates of SETAR Model

After choosing the delay parameter d and the thresholds, other unknown parameters in Θ of the SETAR model may be simply estimated by LS using the S+FinMetrics function SETAR, which takes the following arguments:

args(SETAR) function(x, threshold, p = 1, d = NULL)

where the first argument specifies the data to be used, the second ar- gument gives the vector of threshold values, and the optional arguments

18.3 Threshold Autoregressive Models 667

p and d specify the AR order and delay parameter, respectively. To esti- mate the SETAR(3) model with thresholds (− 2. 8 , − 2 .4), use the following command:

ndx.setar = SETAR(log(ndx.rvol), c(-2.8, -2.4), p=2, d=1) summary(ndx.setar)

Call: SETAR(x = log(ndx.rvol), threshold = c(-2.8, -2.4), p = 2, d = 1)

Coefficients: regime.1 regime.2 regime. Intercept -1.5043 -2.4463 -3. (std.err) 0.2778 1.1323 0. (t.stat) -5.4157 -2.1605 -3.

lag1 0.2866 -0.0373 -0. (std.err) 0.0776 0.4400 0. (t.stat) 3.6942 -0.0848 -1.

lag2 0.2573 0.1381 0. (std.err) 0.0687 0.1305 0. (t.stat) 3.7449 1.0577 1.

Std. Errors of Residuals: regime.1 regime.2 regime. 0.4291 0.3794 0.

Information Criteria: logL AIC BIC HQ -157.5830 333.1659 366.5000 346.

total regime.1 regime.2 regime. Degree of freedom: 300 228 44 19 Time period: from 01/15/1996 to 10/08/

Note that the AR coefficients for the first regime are estimated to be (0. 29 , 0 .26) which appear to be significant, while the AR coefficients for the second and third regimes are estimated to be (− 0. 03 , 0 .14) and (− 0. 63 , 0 .22), respectively, and are not very significant. The estimated regime indices can be plotted as follows:

plot(timeSeries(ndx.setar$regime,

  • pos=positions(ndx.rvol)[-(1:2)]), reference.grid=F,

18.3 Threshold Autoregressive Models 669

0 20 40 60 80 100

-3.

-3.

-3.

-3.

-2.

-2.

-2.

FIGURE 18.7. Predicted realized volatility (in logarithm scale) from ndx.setar.

ify the number of forecasts to obtain in the future, the argument CI.alpha is used to specify 60% pointwise confidence intervals for the forecasts based on Monte Carlo simulations, and the argument n.sim is used to specify the number of simulations to be used for computing the forecasts. The forecasts and their pointwise confidence intervals can be plotted as follows:

tsplot(cbind(ndx.pred$values, ndx.pred$CI), lty=c(1,6,6))

and the plot is shown Figure 18.7. After less than 20 steps, the forecasts settle down to the asymptotic mean of the SETAR process.

18.3.3 Hansen’s Approach

Although the procedure introduced in the above subsection for identifying and estimating SETAR models is easy to perform, it requires some human decisions especially for choosing the threshold values. This subsection in- troduces another test for threshold nonlinearity and another procedure for estimating SETAR models as proposed by Hansen (1997). The advantage of this procedure is that the thresholds can be estimated together with other model parameters and valid confidence intervals can be constructed for the estimated thresholds. The disadvantage is that the current imple-

670 18. Nonlinear Time Series Models

mentation only supports the two-regime SETAR model and thus only one threshold can be estimated.^10

Hansen’s sup-LR Test

Hansen (1997) considers the following two-regime variant of (18.5):

yt = Xtφ(1)(1 − I(yt−d > r 1 )) + Xtφ(2)I(yt−d > r 1 ) + t (18.8)

where I(A) is the indicator function that is equal to 1 if A is true and 0 otherwise, t ∼ iid(0, σ^2 ), and there is only one non-trivial threshold r 1. As discussed in the previous subsection, if d and r 1 are known, then the model parameters Θ = (φ(1), φ(2), σ^2 ) can be estimated by least squares:

Θˆ = argmin φ(1),φ(2)

σ ˆ^2 (r 1 ) = argmin φ(1),φ(2)

n^0

X^ n

t=h

ˆ^2 t (18.9)

where h = max(1, p + 1 − d) and n^0 = n − d − h + 1 is the effective sample size after adjusting for starting values and the delay parameter. To test the null hypothesis of SETAR(1) against the alternative hypoth- esis of SETAR(2), the likelihood ratio test assuming normally distributed errors can be used:

F (r 1 ) =

RSS 0 − RSS 1

σ ˆ^21 (r 1 )

= n^0

σˆ^20 − σˆ^21 (r 1 ) ˆσ^21 (r 1 )

where RSS 0 is the residual sum of squares from SETAR(1), RSS 1 is the residual sum of squares from SETAR(2) given the threshold r 1 , and ˆσ^20 is the residual variance of SETAR(1). The above test is also the standard F test since (18.8) is a linear regression. However, since the threshold r 1 is usually unknown, Hansen (1997) suggests to compute the following sup-LR test: Fs = sup r 1 ∈Yd

F (r 1 ) (18.11)

by searching over all the possible values of the threshold variable yt−d. In practice, to ensure each regime has a non-trivial proportion of observations, a certain percentage of Yd at both ends are usually trimmed and not used. The sup-LR test has near-optimal power as long as the error term t is iid. If t is not iid, the F test needs to be replaced by heteroskedasticity- consistent Wald or Lagrange multiplier test. One complicating issue is that since r 1 is only identified under the alternative, the asymptotic distribution of Fs is not χ^2 and non-standard. Hansen (1996) shows that the asymptotic distribution may be approximated by a bootstrap procedure in general, and

(^10) Hansen (1999) has generalized this procedure to SETAR models with more than two regimes.