lstar: Logistic Smooth Transition AutoRegressive model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/lstar.R

Description

Logistic Smooth Transition AutoRegressive model.

Usage

1
2
3
lstar(x, m, d=1, steps=d, series, mL, mH, mTh, thDelay, 
          thVar, th, gamma, trace=TRUE, include = c("const", "trend","none", "both"), 
          control=list(), starting.control=list())

Arguments

x

time series

m, d, steps

embedding dimension, time delay, forecasting steps

series

time series name (optional)

mL

autoregressive order for 'low' regime (default: m). Must be <=m

mH

autoregressive order for 'high' regime (default: m). Must be <=m

thDelay

'time delay' for the threshold variable (as multiple of embedding time delay d)

mTh

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

thVar

external threshold variable

th, gamma

starting values for coefficients in the LSTAR model. If missing, a grid search is performed

trace

should additional infos be printed? (logical)

include

Type of deterministic regressors to include

control

further arguments to be passed as control list to optim

starting.control

further arguments for the grid search (dimension, bounds). See details below.

Details

x[t+steps] = ( phi1[0] + phi1[1] x[t] + phi1[2] x[t-d] + … + phi1[mL] x[t - (mL-1)d] ) G( z[t], th, gamma ) + ( phi2[0] + phi2[1] x[t] + phi2[2] x[t-d] + … + phi2[mH] x[t - (mH-1)d] ) (1 - G( z[t], th, gamma ) ) + eps[t+steps]

with z the threshold variable, and G the logistic function, computed as plogis(q, location = th, scale = 1/gamma), so see plogis documentation for details on the logistic function formulation and parameters meanings. The threshold variable can alternatively be specified by:

mTh

z[t] = x[t] mTh[1] + x[t-d] mTh[2] + … + x[t-(m-1)d] mTh[m]

thDelay

z[t] = x[t - thDelay*d ]

thVar

z[t] = thVar[t]

Note that if starting values for phi1 and phi2 are provided, isn't necessary to specify mL and mH. Further, the user has to specify only one parameter between mTh, thDelay and thVar for indicating the threshold variable.

Estimation of the transition parameters th and gamma, as well as the regression parameters phi1 and phi2, is done using concentrated least squares, as suggested in Leybourne et al. (1996).

Given th and gamma, the model is linear, so regression coefficients can be obtained as usual by OLS. So the nonlinear numerical search needs only to be done for th and gamma; the regression parameters are then recovered by OLS again from the optimal th and gamma.

For the nonlinear estimation of the parameters th and gamma, the program uses the optim function, with optimization method BFGS using the analytical gradient. For the estimation of standard values, optim is re-run using the complete Least Squares objective function, and the standard errors are obtained by inverting the hessian. You can pass further arguments to optim directly with the control list argument. For instance, the option maxit maybe useful when there are convergence issues (see examples).

Starting parameters are obtained doing a simple two-dimensional grid-search over th and gamma. Parameters of the grid (interval for the values, dimension of the grid) can be passed to starting.control.

nTh

The number of threshold values (th) in the grid. Defaults to 200

nGamma

The number of smoothing values (gamma) in the grid. Defaults to 40

trim

The minimal percentage of observations in each regime. Defaults to 10% (possible threshold values are between the 0.1 and 0.9 quantile)

gammaInt

The lower and higher smoothing values of the grid. Defaults to c(1,40)

thInt

The lower and higher threshold values of the grid. When not specified (default, i.e NA), the interval are the trim quantiles above.

Value

An object of class nlar, subclass lstar, i.e. a list with fitted model informations.

Author(s)

Antonio, Fabio Di Narzo

References

Non-linear time series models in empirical finance, Philip Hans Franses and Dick van Dijk, Cambridge: Cambridge University Press (2000).

Non-Linear Time Series: A Dynamical Systems Approach, Tong, H., Oxford: Oxford University Press (1990).

Leybourne, S., Newbold, P., Vougas, D. (1998) Unit roots and smooth transitions, Journal of Time Series Analysis, 19: 83-97

See Also

plot.lstar for details on plots produced for this model from the plot generic.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#fit a LSTAR model. Note 'maxit': slow convergence
mod.lstar <- lstar(log10(lynx), m=2, mTh=c(0,1), control=list(maxit=3000))
mod.lstar

#fit a LSTAR model without a constant in both regimes. 
mod.lstar2 <- lstar(log10(lynx), m=1,  include="none")
mod.lstar2

#Note in example below that the initial grid search seems to be to narrow. 
# Extend it, and evaluate more values (slow!):
controls <- list(gammaInt=c(1,2000), nGamma=50)
mod.lstar3 <- lstar(log10(lynx), m=1,  include="none", starting.control=controls)
mod.lstar3

# a few methods for lstar:
summary(mod.lstar)
residuals(mod.lstar)
AIC(mod.lstar)
BIC(mod.lstar)
plot(mod.lstar)
predict(mod.lstar, n.ahead=5)

Example output

Using maximum autoregressive order for low regime: mL = 2 
Using maximum autoregressive order for high regime: mH = 2 
Performing grid search for starting values...
Starting values fixed: gamma =  11.15385 , th =  3.337486 ; SSE =  4.337664 
Optimization algorithm converged
Optimized values fixed for regime 2  : gamma =  11.15383 , th =  3.339199 ; SSE =  4.337643 

Non linear autoregressive model

LSTAR model
Coefficients:
Low regime:
   const.L     phiL.1     phiL.2 
 0.4891014  1.2465399 -0.3664328 

High regime:
   const.H     phiH.1     phiH.2 
-1.0240758  0.4232669 -0.2546088 

Smoothing parameter: gamma = 11.15 

Threshold
Variable: Z(t) = + (0) X(t) + (1) X(t-1)

Value: 3.339 
Using maximum autoregressive order for low regime: mL = 1 
Using maximum autoregressive order for high regime: mH = 1 
Using default threshold variable: thDelay=0
Performing grid search for starting values...
Starting values fixed: gamma =  100 , th =  3.230438 ; SSE =  12.76176 
Grid search selected lower/upper bound gamma (was:  1 100 ]). 
					  Might try to widen bound with arg: 'starting.control=list(gammaInt=c(1,200))'
Optimization algorithm converged
Optimized values fixed for regime 2  : gamma =  100.0002 , th =  3.23264 ; SSE =  12.76049 

Non linear autoregressive model

LSTAR model
Coefficients:
Low regime:
  phiL.1 
1.037037 

High regime:
     phiH.1 
-0.08546338 

Smoothing parameter: gamma = 100 

Threshold
Variable: Z(t) = + (1) X(t) 

Value: 3.233 
Using maximum autoregressive order for low regime: mL = 1 
Using maximum autoregressive order for high regime: mH = 1 
Using default threshold variable: thDelay=0
Performing grid search for starting values...
Starting values fixed: gamma =  2000 , th =  3.244443 ; SSE =  12.70589 
Grid search selected lower/upper bound gamma (was:  1 2000 ]). 
					  Might try to widen bound with arg: 'starting.control=list(gammaInt=c(1,200))'
Optimization algorithm converged
Problem: singular hessian
Optimized values fixed for regime 2  : gamma =  2000 , th =  3.244443 ; SSE =  12.70589 

Non linear autoregressive model

LSTAR model
Coefficients:
Low regime:
  phiL.1 
1.036671 

High regime:
    phiH.1 
-0.0857092 

Smoothing parameter: gamma = 2000 

Threshold
Variable: Z(t) = + (1) X(t) 

Value: 3.244 

Non linear autoregressive model

LSTAR model
Coefficients:
Low regime:
   const.L     phiL.1     phiL.2 
 0.4891014  1.2465399 -0.3664328 

High regime:
   const.H     phiH.1     phiH.2 
-1.0240758  0.4232669 -0.2546088 

Smoothing parameter: gamma = 11.15 

Threshold
Variable: Z(t) = + (0) X(t) + (1) X(t-1)

Value: 3.339 

Residuals:
      Min        1Q    Median        3Q       Max 
-0.594820 -0.107360  0.014309  0.111098  0.510342 

Fit:
residuals variance = 0.03805,  AIC = -357, MAPE = 5.58%

Coefficient(s):
         Estimate  Std. Error  t value  Pr(>|z|)    
const.L  0.489101    0.204915   2.3868 0.0169935 *  
phiL.1   1.246540    0.067871  18.3663 < 2.2e-16 ***
phiL.2  -0.366433    0.104301  -3.5132 0.0004427 ***
const.H -1.024076    2.430098  -0.4214 0.6734532    
phiH.1   0.423267    0.172146   2.4588 0.0139417 *  
phiH.2  -0.254609    0.585422  -0.4349 0.6636243    
gamma   11.153834   10.004788   1.1148 0.2649149    
th       3.339199    0.092749  36.0024 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Non-linearity test of full-order LSTAR model against full-order AR model
 F = 12.446 ; p-value = 1.3815e-05 

Threshold 
Variable: Z(t) = + (0) X(t) + (1) X(t-1)
Time Series:
Start = 1821 
End = 1934 
Frequency = 1 
  [1]            NA            NA  0.0439596565 -0.0799424338  0.0296362769
  [6]  0.0935630324  0.0133224099  0.3647016559  0.1410530832  0.1173543382
 [11] -0.1576278447 -0.1244043127  0.2905810078 -0.1370323403 -0.0960143228
 [16]  0.5103424014 -0.2900418196  0.2373734406 -0.0812883564 -0.1609731814
 [21] -0.1499794497 -0.5948201776  0.0810628229  0.1607739567  0.0171644839
 [26] -0.0338205356  0.0854144058 -0.1192652416 -0.3299656453  0.0237121494
 [31]  0.0041552020 -0.4111811531  0.0793056510  0.0502086092  0.0920128305
 [36] -0.0091239268 -0.0582936774  0.1094613597 -0.1406417593 -0.0175662451
 [41] -0.1608416827 -0.1506551087  0.1441724040  0.1787611814  0.0342681047
 [46]  0.1944061190 -0.0765475189 -0.3124514367  0.4295499469  0.2281414973
 [51] -0.3876890281  0.2022318635  0.0414033970 -0.1934667765  0.1024421346
 [56] -0.2398177246 -0.0227016236 -0.3772964935 -0.2130070854 -0.0930800649
 [61]  0.0844147200 -0.0872171674  0.2263668694 -0.1140296252  0.2419082808
 [66] -0.0938177283 -0.3036790480 -0.0824114287 -0.2714906590 -0.0994482231
 [71] -0.2421280407  0.1969619859 -0.0986903504  0.2439783220  0.1821276382
 [76] -0.2787105556 -0.3957427943  0.0635812735  0.1921187334  0.1159347606
 [81] -0.0345734092 -0.0141200676  0.2238343262  0.1094862671  0.0851048177
 [86]  0.1546298085  0.1797807063 -0.1901527153  0.3609028981  0.1296807871
 [91] -0.0246666763  0.0960939020 -0.0006180222  0.0806360882  0.3760121187
 [96]  0.4093932086 -0.5249877987 -0.1051366303  0.0746398196 -0.1286237214
[101]  0.0333448315 -0.0846442523  0.1872590175  0.0433069223 -0.0229849010
[106]  0.0299501892  0.0992457490 -0.0167516015  0.0747866006 -0.0175605556
[111] -0.0209187347  0.0077835633  0.0535460110  0.0152960354
[1] -356.6509
[1] -334.7613
Time Series:
Start = 1935 
End = 1939 
Frequency = 1 
[1] 3.346300 2.913213 2.560114 2.607046 2.800682

tsDyn documentation built on May 29, 2017, 10:48 a.m.