Learn R Programming

starvars (version 1.1.10)

VLSTAR: 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.

Value

An object of class VLSTAR, with standard methods.

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 $$y_{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 \(\mu_{0}\) and \(\mu_{1}\) are the \(\tilde{n} \times 1\) vectors of intercepts, \(\Phi_{0,j}\) and \(\Phi_{1,j}\) are square \(\tilde{n}\times\tilde{n}\) matrices of parameters for lags \(j=1,2,\dots,p\), A_0 and A_1 are \(\tilde{n}\times k\) matrices of parameters, x_t is the \(k \times 1\) vector of exogenous variables and \(\varepsilon_t\) is the innovation. Finally, \(G_t(s_t;\gamma,c)\) is a \(\tilde{n}\times \tilde{n}\) diagonal matrix of transition function at time t, such that $$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 \(G_{i,t}^r\) is specified as a logistic cumulative density functions, i.e. $$G_{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 \(latex\) and \(r=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 $$\hat{\theta}_{ML} = arg \max_{\theta}log L(\theta)$$ where \(log L(\theta)\) is the log-likelihood function of VLSTAR model, given by $$ 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 $$\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 \(\hat{B}\) in each equation, calculating the residual sum of squares, \(Q_t\)

  3. Finding the pair of \(\Gamma\) and C providing the smallest \(Q_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.

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

Run this code
# NOT RUN {
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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab