estim.varma {ldt}R Documentation

Estimate a VARMA Model

Description

Use this function to estimate a Vector Autoregressive Moving Average model.

Usage

estim.varma(
  data,
  params = NULL,
  seasonsCount = 0,
  lbfgsOptions = get.options.lbfgs(),
  olsStdMultiplier = 2,
  pcaOptionsY = NULL,
  pcaOptionsX = NULL,
  maxHorizon = 0,
  simFixSize = 0,
  simHorizons = NULL,
  simUsePreviousEstim = FALSE,
  simMaxConditionNumber = Inf
)

Arguments

data

A list that determines data and other required information for the search process. Use get.data() function to generate it from a matrix or a data.frame.

params

An integer vector that determines the values for the parameters of the VARMA model: (p,d,q,P,D,Q). If NULL, c(1,0,0,0,0,0) is used.

seasonsCount

An integer value representing the number of observations per unit of time.

lbfgsOptions

A list containing L-BFGS optimization options. Use get.options.lbfgs function for initialization.

olsStdMultiplier

A number used as a multiplier for the standard deviation of OLS, used for restricting maximum likelihood estimation.

pcaOptionsY

A list of options to use principal components of y, instead of the actual values. Set to NULL to disable. Use get.options.pca() for initialization.

pcaOptionsX

A list of options to use principal components of x, instead of the actual values. Set to NULL to disable. Use get.options.pca() for initialization.

maxHorizon

An integer representing the maximum prediction horizon. Set to zero to disable prediction.

simFixSize

An integer that determines the number of out-of-sample simulations. Use zero to disable simulation.

simHorizons

An integer vector representing the prediction horizons to be used in out-of-sample simulations. See also get.search.metrics().

simUsePreviousEstim

If TRUE, parameters are initialized only in the first step of the simulation. The initial values of the n-th simulation (with one more observation) are the estimations from the previous step.

simMaxConditionNumber

A number representing the maximum value for the condition number in simulation.

Details

The VARMA model can be used to analyze multivariate time series data with seasonal or non-seasonal patterns. According to Lütkepohl (2005), it considers interdependencies between the series, making it a powerful tool for prediction. The specification of this model is given by:

\Delta^d \Delta_s^D y_t = c + \sum_{i=1}^p A_i y_{t-i} + \sum_{i=1}^q B_i \epsilon_{t-i} + C x_t + \sum_{i=1}^P A_{is} y_{t-is} + \sum_{i=1}^Q B_{is} v_{t-is} + v_t,

where y_t:m\times 1 is the vector of endogenous variables, x_t:k\times 1 is the vector exogenous variables, s is the number of seasons and (p,d,q,P,D,Q) determines the lag structure of the model. Furthermore, c,C,A_i and B_i for all available i determines the model’s parameters. v_t is the disturbance vector and is contemporaneously correlated between different equations, i.e., E(v_tv_t')=\Sigma. Given a sample of size T, the model can be estimated using maximum likelihood estimation. However, to ensure identifiability, it is necessary to impose additional constraints on the parameters (see chapter 12 in Lütkepohl (2005)). In this function, diagonal MA equation form is used (see Dufour and Pelletier (2022)). In this function, the feasible GLS estimator is used to initialize the maximum likelihood, and the OLS estimator is used to calculate the initial value of the variance matrix of the error term. The condition number is calculated similar to the other models (see estim.sur or e.g., page 94 in Trefethen and Bau (1997)). Furthermore, given a prediction horizon and required exogenous data, prediction is performed in a recursive schema, in which the actual estimated errors are used if available and zero otherwise. The variance of the predictions is also calculated recursively. Note that this function does not incorporate the coefficients uncertainty in calculation of the variance (see section 3.5 in Lütkepohl (2005)).

Finally, note that the main purpose of exporting this method is to show the inner calculations of the search process in search.varma function.

Value

A nested list with the following items:

counts

Information about different aspects of the estimation such as the number of observation, number of exogenous variables, etc.

estimations

Estimated coefficients, standard errors, z-statistics, p-values, etc.

metrics

Value of different goodness of fit and out-of-sample performance metrics.

prediction

Information on the predicted values.

simulation

Information on the simulations.

info

Some other general information.

References

Dufour J, Pelletier D (2022). “Practical methods for modeling weak VARMA processes: Identification, estimation and specification with a macroeconomic application.” Journal of Business & Economic Statistics, 40(3), 1140–1152. doi:10.1080/07350015.2021.1904960.

Lütkepohl H (2005). New introduction to multiple time series analysis. Springer, Berlin. ISBN 3540401725, doi:10.1007/978-3-540-27752-1.

Trefethen LN, Bau D (1997). Numerical linear algebra. Society for Industrial and Applied Mathematics. ISBN 9780898714876.

See Also

search.varma

Examples

# Example 1 (simulation, ARMA):
num_eq <- 1L
num_ar <- 2L
num_ma <- 1L
num_exo <- 1L
sample <- sim.varma(num_eq, arList = num_ar, maList = num_ma, exoCoef = num_exo, nObs = 110)
# estimate:
fit <- estim.varma(data = get.data(cbind(sample$y, sample$x)[1:100,],
                                   endogenous = num_eq,
                                   newData = sample$x[101:110,, drop=FALSE]),
                   params = c(num_ar, 0, num_ma, 0, 0, 0),
                   maxHorizon = 10,
                   simFixSize = 5,
                   simHorizons = c(1:10))
print(fit)

pred <- predict(fit, actualCount = 10)
plot(pred, simMetric = "mape")

# split coefficient matrix:
get.varma.params(fit$estimations$coefs, numAR = num_ar, numMA = num_ma, numExo = num_exo)

# Example 2 (simulation, VARMA):
num_eq <- 3L
num_ar <- 2L
num_ma <- 1L
num_ma <- 1L
num_exo <- 2L
sample <- sim.varma(num_eq, arList = num_ar, maList = num_ma, exoCoef = num_exo, nObs = 110)
# estimate:
fit <- estim.varma(data = get.data(cbind(sample$y, sample$x)[1:100,],
                                   endogenous = num_eq,
                                   newData = sample$x[101:110,]),
                   params = c(num_ar, 0, num_ma, 0, 0, 0),
                   maxHorizon = 10,
                   simFixSize = 5,
                   simHorizons = c(1:10))

pred <- predict(fit, actualCount = 10)
plot(pred, simMetric = "mape")

# split coefficient matrix:
get.varma.params(fit$estimations$coefs, numAR = num_ar, numMA = num_ma, numExo = num_exo)

[Package ldt version 0.5.3 Index]