estim.varma | R Documentation |
Use this function to estimate a Vector Autoregressive Moving Average model.
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
)
data |
A list that determines data and other required information for the search process.
Use |
params |
An integer vector that determines the values for the parameters of the VARMA model: |
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 |
pcaOptionsX |
A list of options to use principal components of |
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 |
simUsePreviousEstim |
If |
simMaxConditionNumber |
A number representing the maximum value for the condition number in simulation. |
The VARMA model can be used to analyze multivariate time series data with seasonal or non-seasonal patterns. According to \insertCitelutkepohl2005new;textualldt, 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 \insertCitelutkepohl2005new;textualldt). In this function, diagonal MA equation form is used (see \insertCitedufour2022practical;textualldt).
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 \insertCitetrefethen1997numerical;textualldt). 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 \insertCitelutkepohl2005new;textualldt).
Finally, note that the main purpose of exporting this method is to show the inner calculations of the search process in search.varma function.
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. |
search.varma
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.