Package 'starvars'

Title: Vector Logistic Smooth Transition Models Estimation and Prediction
Description: Allows the user to estimate a vector logistic smooth transition autoregressive model via maximum log-likelihood or nonlinear least squares. It further permits to test for linearity in the multivariate framework against a vector logistic smooth transition autoregressive model with a single transition variable. The estimation method is discussed in Terasvirta and Yang (2014, <doi:10.1108/S0731-9053(2013)0000031008>). Also, realized covariances can be constructed from stock market prices or returns, as explained in Andersen et al. (2001, <doi:10.1016/S0304-405X(01)00055-1>).
Authors: Andrea Bucci [aut, cre, cph], Giulio Palomba [aut], Eduardo Rossi [aut], Andrea Faragalli [ctb]
Maintainer: Andrea Bucci <[email protected]>
License: GPL
Version: 1.1.10
Built: 2024-11-01 11:31:16 UTC
Source: https://github.com/andbucci/starvars

Help Index


Coefficient method for objects of class VLSTAR

Description

Returns the coefficients of a VLSTAR model for objects generated by VLSTAR()

Usage

## S3 method for class 'VLSTAR'
coef(object, ...)

Arguments

object

An object of class ‘VLSTAR’; generated by VLSTAR().

...

Currently not used.

Value

Estimated coefficients of the VLSTAR model

Author(s)

Andrea Bucci

References

Terasvirta T. and Yang Y. (2014), Specification, Estimation and Evaluation of Vector Smooth Transition Autoregressive Models with Applications. CREATES Research Paper 2014-8

Examples

mean(1:3)

Log-Likelihood method

Description

Returns the log-Likelihood of a VLSTAR object.

Usage

## S3 method for class 'VLSTAR'
logLik(object, type = c('Univariate', 'Multivariate'), ...)

Arguments

object

An object of class ‘VLSTAR’ obtained through VLSTAR().

type

Type of Log-Likelihood to be showed (univariate or multivariate).

...

further arguments to be passed to and from other methods

Details

The log-likelihood of a VLSTAR model is defined as:

logl(ytIt;θ)=Tn~2ln(2π)T2lnΩ12t=1T(ytG~tBzt)Ω1(ytG~tBzt)\log l(y_t|I_t;\theta)=-\frac{T\tilde{n}}{2}\ln(2\pi)-\frac{T}{2}\ln|\Omega|-\frac{1}{2}\sum_{t=1}^{T}(y_t-\tilde{G}_tB\,z_t)'\Omega^{-1}(y_t-\tilde{G}_tB\,z_t)

Value

An object with class attribute logLik.

Author(s)

Andrea Bucci

See Also

VLSTAR


Long-run variance using Bartlett kernel

Description

Function returns the long-run variance of a time series, relying on the Bartlett kernel. The window size of the kernel is the cube root of the sample size.

Usage

lrvarbart(x)

Arguments

x

a (T x 1) vector containing the time series over period T

Value

lrv

long-run variance

return

bandwidth size of the window

Author(s)

Andrea Bucci

References

Hamilton J. D. (1994), Time Series Analysis. Princeton University Press; Tsay R.S. (2005), Analysis of Financial Time Series. John Wiley & SONS

Examples

data(Realized)
lrvarbart(Realized[,1])

Multivariate CUMSUM test

Description

Function returns the test statistics for the presence of co-breaks in a set of multivariate time series.

Usage

multiCUMSUM(data, conf.level = 0.95, max.breaks = 7)

Arguments

data

a (T x N) matrix or data.frame containing the N time series over period T

conf.level

Confidence level. By default set to 0.95

max.breaks

Integer, determines the highest number of common breaks from 1 to 7.

Value

Lambda Test statistics

a matrix of test statistics on the presence of a number of co-break equal to max.breaks in the conditional mean

Omega Test statistics

a matrix of test statistics on the presence of a number of co-break equal to max.breaks in the conditional variance

Break location

the index and the Date where the common breaks are located

Author(s)

Andrea Bucci and Giulio Palomba

References

Aue A., Hormann S., Horvath L.and Reimherr M. (2009), Break detection in the covariance structure of multivariate time series models. The Annals of Statistics. 37: 4046-4087 Bai J., Lumsdaine R. L. and Stock J. H. (1998), Testing For and Dating Common Breaks in Multivariate Time Series. Review of Economic Studies. 65: 395-432 Barassi M., Horvath L. and Yuqian Z. (2018), Change-Point Detection in the Conditional Correlation Structure of Multivariate Volatility Models. Journal of Business \& Economic Statistics

Examples

data(Realized)
testCS <- multiCUMSUM(Realized[,1:10], conf.level = 0.95)
print(testCS)

Plot methods for a VLSTAR object

Description

Plot method for objects with class attribute VLSTAR.

Usage

## S3 method for class 'VLSTAR'
plot(
  x,
  names = NULL,
  main.fit = NULL,
  main.acf = NULL,
  main.pacf = NULL,
  main.logi = NULL,
  ylim.fit = NULL,
  ylim.resid = NULL,
  lty.fit = NULL,
  lty.resid = NULL,
  lty.logi = NULL,
  lwd.fit = NULL,
  lwd.resid = NULL,
  lwd.logi = NULL,
  lag.acf = NULL,
  lag.pacf = NULL,
  col.fit = NULL,
  col.resid = NULL,
  col.logi = NULL,
  ylab.fit = NULL,
  ylab.resid = NULL,
  ylab.acf = NULL,
  ylab.pacf = NULL,
  ylab.logi = NULL,
  xlab.fit = NULL,
  xlab.resid = NULL,
  xlab.logi = NULL,
  mar = par("mar"),
  oma = par("oma"),
  adj.mtext = NA,
  padj.mtext = NA,
  col.mtext = NA,
  ...
)

Arguments

x

An object of class ‘VLSTAR’.

names

Character vector, the variables names to be plotted. If left NULL, all variables are plotted.

main.fit

Character vector, main for diagram of fit.

main.acf

Character vector, main for residuals' ACF.

main.pacf

Character vector, main for residuals' PACF.

main.logi

Character vector, main for the plot of the logistic function.

ylim.fit

Vector, ylim for diagram of fit.

ylim.resid

Vector, ylim for residual plot.

lty.fit

Vector, lty for diagram of fit.

lty.resid

Vector, lty for residual plot.

lty.logi

Vector, lty for the plot of the logistic function.

lwd.fit

Vector, lwd for diagram of fit.

lwd.resid

Vector, lwd for residual plot.

lwd.logi

Vector, lwd for the plot of the logistic function.

lag.acf

Integer, lag.max for ACF of residuals.

lag.pacf

Integer, lag.max for PACF of residuals.

col.fit

Character vector, colors for diagram of fit.

col.resid

Character vector, colors for residual plot.

col.logi

Character vector, colors for logistic function plot.

ylab.fit

Character vector, ylab for diagram of fit.

ylab.resid

Character vector, ylab for residual plot.

ylab.acf

Character, ylab for ACF.

ylab.pacf

Character, ylab for PACF

ylab.logi

Character vector, ylab for the plot of the logistic function.

xlab.fit

Character vector, xlab for diagram of fit.

xlab.resid

Character vector, xlab for residual plot.

xlab.logi

Character vector, xlab for the plot of the logistic function.

mar

Setting of margins.

oma

Setting of outer margins.

adj.mtext

Adjustment for mtext().

padj.mtext

Adjustment for mtext().

col.mtext

Character, color for mtext(), only applicable.

...

Passed to internal plot function.

main

Character vector, the titles of the plot.

xlab

Character vector signifying the labels for the x-axis.

ylab

Character vector signifying the labels for the y-axis.

ylim

Vector, the limits of the y-axis.

Details

When the plot function is applied to a VLSTAR object, the values of the logistic function, given the estimated values of gamma and c through VLSTAR, are reported.

Value

Plot of VLSTAR fitted values, residuals, ACF, PACF and logistic function

Author(s)

Andrea Bucci

See Also

VLSTAR


Plot methods for a vlstarpred object

Description

Plot method for objects with class attribute vlstarpred.

Usage

## S3 method for class 'vlstarpred'
plot(
  x,
  type = c("single", "multiple"),
  names = NULL,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  lty.obs = 2,
  lty.pred = 1,
  lty.ci = 3,
  lty.vline = 1,
  lwd.obs = 1,
  lwd.pred = 1,
  lwd.ci = 1,
  lwd.vline = 1,
  col.obs = NULL,
  col.pred = NULL,
  col.ci = NULL,
  col.vline = NULL,
  ylim = NULL,
  mar = par("mar"),
  oma = par("oma"),
  ...
)

Arguments

x

An object of class ‘vlstarpred’.

type

Character, if multiple all plots are drawn in a single device, otherwise the plots are shown consecutively.

names

Character vector, the variables names to be plotted. If left NULL, all variables are plotted.

main

Character vector, the titles of the plot.

xlab

Character vector signifying the labels for the x-axis.

ylab

Character vector signifying the labels for the y-axis.

lty.obs

Vector, lty for the plot of the observed values.

lty.pred

Vector, lty for the plot of the predicted values.

lty.ci

Vector, lty for the interval forecast.

lty.vline

Vector, lty for the vertical line.

lwd.obs

Vector, lwd for the plot of the observed values.

lwd.pred

Vector, lwd for the plot of the predicted values.

lwd.ci

Vector, lwd for the interval forecast.

lwd.vline

Vector, lwd for the vertical line.

col.obs

Character vector, colors for the observed values.

col.pred

Character vector, colors for the predicted values.

col.ci

Character vector, colors for the interval forecast.

col.vline

Character vector, colors for the vertical line.

ylim

Vector, the limits of the y-axis.

mar

Setting of margins.

oma

Setting of outer margins.

...

Passed to internal plot function.

Value

Plot of predictions from VLSTAR with their prediction interval

Author(s)

Andrea Bucci

See Also

predict.VLSTAR


VLSTAR Prediction

Description

One-step or multi-step ahead forecasts, with interval forecast, of a VLSTAR object.

Usage

## S3 method for class 'VLSTAR'
predict(
  object,
  ...,
  n.ahead = 1,
  conf.lev = 0.95,
  st.new = NULL,
  M = 5000,
  B = 1000,
  st.num = NULL,
  newdata = NULL,
  method = c("naive", "Monte Carlo", "bootstrap")
)

Arguments

object

An object of class ‘VLSTAR’ obtained through VLSTAR()

...

further arguments to be passed to and from other methods

n.ahead

An integer specifying the number of ahead predictions

conf.lev

Confidence level of the interval forecast

st.new

Vector of new data for the transition variable

M

An integer with the number of errors sampled for the Monte Carlo method

B

An integer with the number of errors sampled for the bootstrap method

st.num

An integer with the index of dependent variable if st.new is NULL and the transition variable is a lag of one of the dependent variables

newdata

data.frame or matrix of new data for the exogenous variables

method

A character identifying which multi-step ahead method should be used among naive, Monte Carlo and bootstrap

Value

A list containing:

forecasts

data.frame of predictions for each dependent variable and the (1-α\alpha) prediction intervals

y

a matrix of values for y

Author(s)

Andrea Bucci and Eduardo Rossi

References

Granger C.W.J. and Terasvirta T. (1993), Modelling Non-Linear Economic Relationships. Oxford University Press;

Lundbergh S. and Terasvirta T. (2007), Forecasting with Smooth Transition Autoregressive Models. John Wiley and Sons;

Terasvirta T. and Yang Y. (2014), Specification, Estimation and Evaluation of Vector Smooth Transition Autoregressive Models with Applications. CREATES Research Paper 2014-8

See Also

VLSTAR for log-likehood and nonlinear least squares estimation of the VLSTAR model.


Print method for objects of class VLSTAR

Description

print’ methods for class ‘VLSTAR’.

Usage

## S3 method for class 'VLSTAR'
print(x, ...)

Arguments

x

An object of class ‘VLSTAR’ obtained through VLSTAR().

...

further arguments to be passed to and from other methods

Value

Print of VLSTAR results

Author(s)

Andrea Bucci

References

Terasvirta T. and Yang Y. (2014), Specification, Estimation and Evaluation of Vector Smooth Transition Autoregressive Models with Applications. CREATES Research Paper 2014-8

See Also

VLSTAR


Realized Covariance

Description

Function returns the vectorization of the lowest triangular of the Realized Covariance matrices for different frequencies.

Usage

rcov(
  data,
  freq = c("daily", "monthly", "quarterly", "yearly"),
  make.ret = TRUE,
  cholesky = FALSE
)

Arguments

data

a (T x N) xts object containing the N price/return series over period T

freq

a string defining the desired frequency for the Realized Covariance matrices between "daily", "monthly", "quarterly" or "yearly"

make.ret

boolean, in case it is TRUE the data are converted in returns, FALSE otherwise

cholesky

boolean, in case it is TRUE the Cholesky factors of the Realized Covariance matrices are calculated, FALSE by default

Value

Realized Covariances

a M×N(N+1)/2M \times N(N+1)/2 matrix of realized covariances, where M is the number of lower frequency data

Cholesky Factors (optional)

a M×N(N+1)/2M \times N(N+1)/2 matrix of Cholesky factors of the realized covariance matrices, where M is the number of lower frequency data

returns (optional)

a T×NT \times N matrix of returns, when make.ret = TRUE

Author(s)

Andrea Bucci

References

Andersen T.G., Bollerslev T., Diebold F.X. and Labys P. (2003), Modeling and Forecasting Realized Volatility. Econometrica. 71: 579-625

Barndorff-Nielsen O.E. and Shephard N. (2002), Econometric analysis of realised volatility and its use in estimating stochastic volatility models Journal of the Royal Statistical Society. 64(2): 253-280

Examples

data(Sample5minutes)
rc <- rcov(Sample5minutes, freq = 'daily', cholesky = TRUE, make.ret = TRUE)
print(rc)

Monthly time series used to test VLSTAR models.

Description

This data set contains the series of realized covariances in 4 stock market indices, i.e. SP-500, Nikkei, DAX, and FTSE, Dividend Yield and Earning Price growth rate, inflation growth rates for U.S., U.K., Japan and Germany, from August 1990 to June 2018.

Usage

data(Realized)

Format

A zoo data frame with 334 monthly observations, ranging from 1990:M8 until 2018:M6.

SP Monthly realized variances of S&P 500 index.
SP-NIKKEI Monthly realized covariances between S&P 500 and Nikkei.
SP-FTSE Monthly realized covariances between S&P 500 and FTSE.
SP-DAX Monthly realized covariances between S&P 500 and DAX.
NIKKEI Monthly realized variances of Nikkei index.
NIKKEI-FTSE Monthly realized covariances between Nikkei and FTSE.
NIKKEI-DAX Monthly realized covariances between Nikkei and DAX.
FTSE Monthly realized variances of FTSE index.
FTSE-DAX Monthly realized covariances between FTSE and DAX.
DAX Monthly realized variances of DAX index.
DP Monthly Dividends growth rate over the past year relative to current market prices; S&P 500 index.
EP Monthly Earnings growth rate over the past year relative to current market prices; S&P500 index.
Inf_US US monthly Industrial Production growth.
Inf_UK UK monthly Industrial Production growth.
Inf_JPN Japan monthly Industrial Production growth.
Inf_GER Germany monthly Industrial Production growth.

Author(s)

Andrea Bucci

See Also

rcov to build realized covariances from stock prices or returns.


Ten simulated prices series for 19 trading days in January 2010.

Description

Ten hypothetical price series were simulated according to the factor diffusion process discussed in Barndorff-Nielsen et al.

Usage

data("Sample5minutes")

Format

xts object

Author(s)

Andrea Bucci


Starting parameters for a VLSTAR model

Description

This function allows the user to obtain the set of starting values of Gamma and C for the convergence algorithm via searching grid.

Usage

startingVLSTAR(
  y,
  exo = NULL,
  p = 1,
  m = 2,
  st = NULL,
  constant = TRUE,
  n.combi = NULL,
  ncores = 2,
  singlecgamma = FALSE
)

Arguments

y

data.frame or matrix of dependent variables of dimension (Txn)

exo

(optional) data.frame or matrix of exogenous variables of dimension (Txk)

p

lag order

m

number of regimes

st

single transition variable for all the equation of dimension (Tx1)

constant

TRUE or FALSE to include or not the constant

n.combi

Number of combination for the searching grid of Gamma and C

ncores

Number of cores used for parallel computation. Set to 2 by default

singlecgamma

TRUE or FALSE to use single gamma and c

Details

The searching grid algorithm allows for the optimal choice of the parameters γ\gamma and c by minimizing the sum of the Squared residuals for each possible combination.

The parameter c is initialized by using the mean of the dependent(s) variable, while γ\gamma is sampled between 0 and 100.

Value

An object of class startingVLSTAR.

Author(s)

Andrea Bucci

References

Anderson H.M. and Vahid F. (1998), Testing multiple equation systems for common nonlinear components. Journal of Econometrics. 84: 1-36

Bacon D.W. and Watts D.G. (1971), Estimating the transition between two intersecting straight lines. Biometrika. 58: 525-534

Terasvirta T. and Yang Y. (2014), Specification, Estimation and Evaluation of Vector Smooth Transition Autoregressive Models with Applications. CREATES Research Paper 2014-8

See Also

VLSTAR

Examples

data(Realized)
y <- Realized[-1,1:10]
y <- y[-nrow(y),]
st <- Realized[-nrow(Realized),1]
st <- st[-length(st)]
starting <- startingVLSTAR(y, p = 1, n.combi = 3,
                           singlecgamma = FALSE, st = st,
                           ncores = 1)

Summary method for objects of class VLSTAR

Description

summary’ methods for class ‘VLSTAR’.

Usage

## S3 method for class 'VLSTAR'
summary(object, ...)

## S3 method for class 'summary.VLSTAR'
print(x, ...)

Arguments

object

An object of class ‘VLSTAR’ obtained through VLSTAR().

...

further arguments to be passed to and from other methods

x

A summary object of class ‘VLSTAR’ obtained through summary().

Value

An object of class summary.VLSTAR containing a list of summary information from VLSTAR estimates. When print is applied to this object, summary information are printed

Functions

  • print.summary.VLSTAR: Print of the summary

Author(s)

Andrea Bucci

References

Terasvirta T. and Yang Y. (2014), Specification, Estimation and Evaluation of Vector Smooth Transition Autoregressive Models with Applications. CREATES Research Paper 2014-8

See Also

VLSTAR


Daily closing prices of 3 tech stocks.

Description

This data set contains the series of daily prices of Google, Microsof and Amazon stocks from January 3, 2005 to June 16, 2020, gathered from Yahoo.

Usage

data("techprices")

Format

An xts object with 3890 daily observations, ranging from from January 3, 2005 to June 16, 2020.

Google daily closing prices of Google (GOOG) stock.
Microsoft daily closing prices of Microsoft (MSFT) stock.
Amazon daily closing stock prices of Amazon (AMZN) stock.

Author(s)

Andrea Bucci


VLSTAR- Estimation

Description

This function allows the user to estimate the coefficients of a VLSTAR model with m regimes through maximum likelihood or nonlinear least squares. The set of starting values of Gamma and C for the convergence algorithm can be either passed or obtained via searching grid.

Usage

VLSTAR(
  y,
  exo = NULL,
  p = 1,
  m = 2,
  st = NULL,
  constant = TRUE,
  starting = NULL,
  method = c("ML", "NLS"),
  n.iter = 500,
  singlecgamma = FALSE,
  epsilon = 10^(-3),
  ncores = NULL
)

Arguments

y

data.frame or matrix of dependent variables of dimension (Txn)

exo

(optional) data.frame or matrix of exogenous variables of dimension (Txk)

p

lag order

m

number of regimes

st

single transition variable for all the equation of dimension (Tx1)

constant

TRUE or FALSE to include or not the constant

starting

set of intial values for Gamma and C, inserted as a list of length m-1. Each element of the list should contain a data.frame with 2 columns (one for Gamma and one for c), and n rows.

method

Fitting method: maximum likelihood or nonlinear least squares.

n.iter

number of iteration of the algorithm until forced convergence

singlecgamma

TRUE or FALSE to use single gamma and c

epsilon

convergence check measure

ncores

Number of cores used for parallel computation. Set to NULL by default and automatically calculated.

Details

The multivariate smooth transition model is an extension of the smooth transition regression model introduced by Bacon and Watts (1971) (see also Anderson and Vahid, 1998). The general model is

yt=μ0+j=1pΦ0,jytj+A0xtGt(st;γ,c)[μ1+j=1pΦ1,jytj+A1xt]+εty_{t} = \mu_0+\sum_{j=1}^{p}\Phi_{0,j}\,y_{t-j}+A_0 x_t \cdot G_t(s_t;\gamma,c)[\mu_{1}+\sum_{j=1}^{p}\Phi_{1,j}\,y_{t-j}+A_1x_t]+\varepsilon_t

where μ0\mu_{0} and μ1\mu_{1} are the n~×1\tilde{n} \times 1 vectors of intercepts, Φ0,j\Phi_{0,j} and Φ1,j\Phi_{1,j} are square n~×n~\tilde{n}\times\tilde{n} matrices of parameters for lags j=1,2,,pj=1,2,\dots,p, A_0 and A_1 are n~×k\tilde{n}\times k matrices of parameters, x_t is the k×1k \times 1 vector of exogenous variables and εt\varepsilon_t is the innovation. Finally, Gt(st;γ,c)G_t(s_t;\gamma,c) is a n~×n~\tilde{n}\times \tilde{n} diagonal matrix of transition function at time t, such that

Gt(st;γ,c)={G1,t(s1,t;γ1,c1),G2,t(s2,t;γ2,c2),,Gn~,t(sn~,t;γn~,cn~)}.G_t(s_t;\gamma,c)=\{G_{1,t}(s_{1,t};\gamma_{1},c_{1}),G_{2,t}(s_{2,t};\gamma_{2},c_{2}), \dots,G_{\tilde{n},t}(s_{\tilde{n},t};\gamma_{\tilde{n}},c_{\tilde{n}})\}.

Each diagonal element Gi,trG_{i,t}^r is specified as a logistic cumulative density functions, i.e.

Gi,tr(si,tr;γir,cir)=[1+exp{γir(si,trcir)}]1G_{i,t}^r(s_{i,t}^r; \gamma_i^r, c_i^r) = \left[1 + \exp\big\{-\gamma_i^r(s_{i,t}^r-c_i^r)\big\}\right]^{-1}

for latexlatex and r=0,1,,m1r=0,1,\dots,m-1, so that the first model is a Vector Logistic Smooth Transition AutoRegressive (VLSTAR) model. The ML estimator of θ\theta is obtained by solving the optimization problem

θ^ML=argmaxθlogL(θ)\hat{\theta}_{ML} = arg \max_{\theta}log L(\theta)

where logL(θ)log L(\theta) is the log-likelihood function of VLSTAR model, given by

ll(ytIt;θ)=Tn~2ln(2π)T2lnΩ12t=1T(ytG~tBzt)Ω1(ytG~tBzt)ll(y_t|I_t;\theta)=-\frac{T\tilde{n}}{2}\ln(2\pi)-\frac{T}{2}\ln|\Omega|-\frac{1}{2}\sum_{t=1}^{T}(y_t-\tilde{G}_tB\,z_t)'\Omega^{-1}(y_t-\tilde{G}_tB\,z_t)

The NLS estimators of the VLSTAR model are obtained by solving the optimization problem

θ^NLS=argminθt=1T(ytΨtBxt)(ytΨtBxt).\hat{\theta}_{NLS} = arg \min_{\theta}\sum_{t=1}^{T}(y_t - \Psi_t'B'x_t)'(y_t - \Psi_t'B'x_t).

Generally, the optimization algorithm may converge to some local minimum. For this reason, providing valid starting values of θ\theta is crucial. If there is no clear indication on the initial set of parameters, θ\theta, this can be done by implementing a grid search. Thus, a discrete grid in the parameter space of Γ\Gamma and C is create to obtain the estimates of B conditionally on each point in the grid. The initial pair of Γ\Gamma and C producing the smallest sum of squared residuals is chosen as initial values, then the model is linear in parameters. The algorithm is the following:

  1. Construction of the grid for Γ\Gamma and C, computing Ψ\Psi for each poin in the grid

  2. Estimation of B^\hat{B} in each equation, calculating the residual sum of squares, QtQ_t

  3. Finding the pair of Γ\Gamma and C providing the smallest QtQ_t

  4. Once obtained the starting-values, estimation of parameters, B, via nonlinear least squares (NLS)

  5. Estimation of Γ\Gamma and C given the parameters found in step 4

  6. Repeat step 4 and 5 until convergence.

Value

An object of class VLSTAR, with standard methods.

Author(s)

Andrea Bucci

References

Anderson H.M. and Vahid F. (1998), Testing multiple equation systems for common nonlinear components. Journal of Econometrics. 84: 1-36

Bacon D.W. and Watts D.G. (1971), Estimating the transition between two intersecting straight lines. Biometrika. 58: 525-534

Terasvirta T. and Yang Y. (2014), Specification, Estimation and Evaluation of Vector Smooth Transition Autoregressive Models with Applications. CREATES Research Paper 2014-8

Examples

data(Realized)
y <- Realized[-1,1:10]
y <- y[-nrow(y),]
st <- Realized[-nrow(Realized),1]
st <- st[-length(st)]
stvalues <- startingVLSTAR(y, p = 1, n.combi = 3,
 singlecgamma = FALSE, st = st, ncores = 1)
fit.VLSTAR <- VLSTAR(y, p = 1, singlecgamma = FALSE, starting = stvalues,
 n.iter = 1, st = st, method ='NLS', ncores = 1)
# a few methods for VLSTAR
print(fit.VLSTAR)
summary(fit.VLSTAR)
plot(fit.VLSTAR)
predict(fit.VLSTAR, st.num = 1, n.ahead = 1)
logLik(fit.VLSTAR, type = 'Univariate')
coef(fit.VLSTAR)

Joint linearity test

Description

This function allows the user to test linearity against a Vector Smooth Transition Autoregressive Model with a single transition variable.

Usage

VLSTARjoint(y, exo = NULL, st, st.choice = FALSE, alpha = 0.05)

Arguments

y

data.frame or matrix of dependent variables of dimension (Txn)

exo

(optional) data.frame or matrix of exogenous variables of dimension (Txk)

st

single transition variable for all the equation of dimension (Tx1)

st.choice

boolean identifying whether the transition variable should be selected from a matrix of R potential variables of dimension (TxR)

alpha

Confidence level

Details

Given a VLSTAR model with a unique transition variable, s1t=s2t==sn~t=sts_{1t} = s_{2t} = \dots = s_{\widetilde{n}t} = s_t, a generalization of the linearity test presented in Luukkonen, Saikkonen and Terasvirta (1988) may be implemented.

Assuming a 2-state VLSTAR model, such that

yt=B1zt+GtB2zt+εt.y_t = B_{1}z_t + G_tB_{2}z_t + \varepsilon_t.

Where the null H0:γj=0H_{0} : \gamma_{j} = 0, j=1,,n~j = 1, \dots, \widetilde{n}, is such that Gt(1/2)/n~G_t \equiv (1/2)/\widetilde{n} and the previous Equation is linear. When the null cannot be rejected, an identification problem of the parameter cjc_{j} in the transition function emerges, that can be solved through a first-order Taylor expansion around γj=0\gamma_{j} = 0.

The approximation of the logistic function with a first-order Taylor expansion is given by

G(st;γj,cj)=(1/2)+(1/4)γj(stcj)+rjtG(s_t; \gamma_{j},c_{j}) = (1/2) + (1/4)\gamma_{j}(s_t-c_{j}) + r_{jt}

=ajst+bj+rjt= a_{j}s_t + b_{j} + r_{jt}

where aj=γj/4a_{j} = \gamma_{j}/4, bj=1/2ajcjb_{j} = 1/2 - a_{j}c_{j} and rjr_{j} is the error of the approximation. If GtG_t is specified as follows

Gt=diag{a1st+b1+r1t,,an~st+bn~+rn~t}G_t = diag\big\{a_{1}s_t + b_{1} + r_{1t}, \dots, a_{\widetilde{n}}s_t+b_{\widetilde{n}} + r_{\widetilde{n}t}\big\}

=Ast+B+Rt= As_t + B + R_t

where A=diag(a1,,an~)A = diag(a_{1}, \dots, a_{\widetilde{n}}), B=diag(b1,,bn~)B = diag(b_{1},\dots, b_{\widetilde{n}}) e Rt=diag(r1t,,rn~t)R_t = diag(r_{1t}, \dots, r_{\widetilde{n}t}), yty_t can be written as

yt=B1zt+(Ast+B+Rt)B2zt+εty_t = B_{1}z_t + (As_t + B + R_t)B_{2}z_t+\varepsilon_t

=(B1+BB2)zt+AB2ztst+RtB2zt+εt= (B_{1} + BB_{2})z_t+AB_{2}z_ts_t + R_tB_{2}z_t + \varepsilon_t

=Θ0zt+Θ1ztst+εt= \Theta_{0}z_t + \Theta_{1}z_ts_t+\varepsilon_t^{*}

where Θ0=B1+B2B\Theta_{0} = B_{1} + B_{2}'B, Θ1=B2A\Theta_{1} = B_{2}'A and εt=RtB2+εt\varepsilon_t^{*} = R_tB_{2} + \varepsilon_t. Under the null, Θ0=B1\Theta_{0} = B_{1} and Θ1=0\Theta_{1} = 0, while the previous model is linear, with εt=εt\varepsilon_t^{*} = \varepsilon_t. It follows that the Lagrange multiplier test, under the null, is derived from the score

logL(θ~)Θ1=t=1Tztst(ytB~1zt)Ω~1=S(YZB~1)Ω~1,\frac{\partial \log L(\widetilde{\theta})}{\partial \Theta_{1}} = \sum_{t=1}^{T}z_ts_t(y_t - \widetilde{B}_{1}z_t)'\widetilde{\Omega}^{-1} = S(Y - Z\widetilde{B}_{1})\widetilde{\Omega}^{-1},

where

S=z1s1ztstS = z_{1}'s_{1}\\\vdots\\ z_t's_t

and where B~1\widetilde{B}_{1} and Ω~\widetilde{\Omega} are estimated from the model in H0H_{0}. If PZ=Z(ZZ)1ZP_{Z} = Z(Z'Z)^{-1}Z' is the projection matrix of Z, the LM test is specified as follows

LM=tr{Ω~1(YZB~1)S[S(ItPZ)S]1S(YZB~1)}.LM = tr\big\{\widetilde{\Omega}^{-1}(Y - Z\widetilde{B}_{1})'S\big[S'(I_t - P_{Z})S\big]^{-1}S'(Y-Z\widetilde{B}_{1})\big\}.

Under the null, the test statistics is distributed as a χ2\chi^{2} with n~(pn~+k)\widetilde{n}(p\cdot\widetilde{n} + k) degrees of freedom.

Value

An object of class VLSTARjoint.

Author(s)

Andrea Bucci

References

Luukkonen R., Saikkonen P. and Terasvirta T. (1988), Testing Linearity Against Smooth Transition Autoregressive Models. Biometrika, 75: 491-499

Terasvirta T. and Yang Y. (2015), Linearity and Misspecification Tests for Vector Smooth Transition Regression Models. CREATES Research Paper 2014-4