fitSSTVAR {sstvars} | R Documentation |
Maximum likelihood estimation of a structural STVAR model based on preliminary estimates from a reduced form model.
Description
fitSSTVAR
uses a robust method and a variable metric algorithm to estimate
a structural STVAR model based on preliminary estimates from a reduced form model.
Usage
fitSSTVAR(
stvar,
identification = c("recursive", "heteroskedasticity", "non-Gaussianity"),
B_constraints = NULL,
maxit = 1000,
maxit_robust = 1000,
robust_method = c("Nelder-Mead", "SANN", "none"),
print_res = TRUE,
calc_std_errors = TRUE
)
Arguments
stvar |
a an object of class |
identification |
Which identification should the structural model use? (see the vignette or the references for details)
|
B_constraints |
Employ further constraints on the impact matrix?
A |
maxit |
the maximum number of iterations in the variable metric algorithm. |
maxit_robust |
the maximum number of iterations on the first phase robust estimation, if employed. |
robust_method |
Should some robust estimation method be used in the estimation before switching to the gradient based variable metric algorithm? See details. |
print_res |
should summaries of estimation results be printed? |
calc_std_errors |
should approximate standard errors be calculated? |
Details
When the structural model does not impose overidentifying constraints, it is directly obtained from the reduced form model, and estimation is not required. When overidentifying constraints are imposed, the model is estimated via ..
Structural models can be provided in the argument stvar
if overidentifying constraints should be
imposed.
Using the robust estimation method before switching to the variable metric can be useful if the initial estimates are not very close to the ML estimate of the structural model, as the variable metric algorithm (usually) converges to a nearby local maximum or saddle point. However, if the initial estimates are far from the ML estimate, the resulting solution is likely local only due to the complexity of the model. Note that Nelder-Mead algorithm is much faster than SANN but can get stuck at a local solution. This is particularly the case when the imposed overidentifying restrictions are such that the unrestricted estimate is not close to satisfying them. Nevertheless, in most practical cases, the model is just identified and estimation is not required, and often reasonable overidentifying constraints are close to the unrestricted estimate.
Employs the estimation function optim
from the package stats
that implements the optimization
algorithms. See ?optim
for the documentation on the
Value
Returns an S3 object of class 'stvar'
defining a smooth transition VAR model. The returned list
contains the following components (some of which may be NULL
depending on the use case):
data |
The input time series data. |
model |
A list describing the model structure. |
params |
The parameters of the model. |
std_errors |
Approximate standard errors of the parameters, if calculated. |
transition_weights |
The transition weights of the model. |
regime_cmeans |
Conditional means of the regimes, if data is provided. |
total_cmeans |
Total conditional means of the model, if data is provided. |
total_ccovs |
Total conditional covariances of the model, if data is provided. |
uncond_moments |
A list of unconditional moments including regime autocovariances, variances, and means. |
residuals_raw |
Raw residuals, if data is provided. |
residuals_std |
Standardized residuals, if data is provided. |
structural_shocks |
Recovered structural shocks, if applicable. |
loglik |
Log-likelihood of the model, if data is provided. |
IC |
The values of the information criteria (AIC, HQIC, BIC) for the model, if data is provided. |
all_estimates |
The parameter estimates from all estimation rounds, if applicable. |
all_logliks |
The log-likelihood of the estimates from all estimation rounds, if applicable. |
which_converged |
Indicators of which estimation rounds converged, if applicable. |
which_round |
Indicators of which round of optimization each estimate belongs to, if applicable. |
References
Kilian L., Lütkepohl H. 20017. Structural Vector Autoregressive Analysis. 1st edition. Cambridge University Press, Cambridge.
Lütkepohl H., Netšunajev A. 2017. Structural vector autoregressions with smooth transition in variances. Journal of Economic Dynamics & Control, 84, 43-57.
See Also
Examples
## These are long running examples that take approximately 1 minute to run.
## Estimate first a reduced form Gaussian STVAR p=3, M=2 model with the weighted relative
# stationary densities of the regimes as the transition weight function, and the means and
# AR matrices constrained to be identical across the regimes:
fit32cm <- fitSTVAR(gdpdef, p=3, M=2, AR_constraints=rbind(diag(3*2^2), diag(3*2^2)),
weight_function="relative_dens", mean_constraints=list(1:2), parametrization="mean",
nrounds=1, seeds=1, ncores=1)
# Then, we estimate/create various structural models based on the reduced form model.
# Create a structural model with the shocks identified recursively:
fit32cms_rec <- fitSSTVAR(fit32cm, identification="recursive")
# Create a structural model with the shocks identified by conditional heteroskedasticity:
fit32cms_hetsked <- fitSSTVAR(fit32cm, identification="heteroskedasticity")
fit32cms_hetsked # Print the estimates
# Estimate a structural model with the shocks identified by conditional heteroskedasticity
# and overidentifying constraints imposed on the impact matrix: positive diagonal element
# and zero upper right element:
fit32cms_hs2 <- fitSSTVAR(fit32cm, identification="heteroskedasticity",
B_constraints=matrix(c(1, NA, 0, 1), nrow=2))
# Estimate a structural model with the shocks identified by conditional heteroskedasticity
# and overidentifying constraints imposed on the impact matrix: positive diagonal element
# and zero off-diagonal elements:
fit32cms_hs3 <- fitSSTVAR(fit32cms_hs2, identification="heteroskedasticity",
B_constraints=matrix(c(1, 0, 0, 1), nrow=2))
# Estimate first a reduced form three-regime Student's t Threshold VAR p=3 model with
# the first lag of the second variable as the switching variable, the means and AR
# matrices constrained to be identical across the regimes:
fit32cml <- fitSTVAR(gdpdef, p=3, M=3, cond_dist="Student",
AR_constraints=rbind(diag(3*2^2), diag(3*2^2), diag(3*2^2)),
weight_function="threshold", weightfun_pars=c(2, 1), mean_constraints=list(1:3),
parametrization="mean", nrounds=1, seeds=1, ncores=1)
# Then, we estimate/create various structural models based on the reduced form model.
# Create a structural model with the shocks identified recusively:
fit32cmls_rec <- fitSSTVAR(fit32cml, identification="recursive")
# Estimate a structural model with the shocks identified by conditional heteroskedasticity,
# the model is overidentifying, as it has more than two regimes:
fit32cmls_hs <- fitSSTVAR(fit32cml, identification="heteroskedasticity")
fit32cmls_hs # Print the estimates
# Estimate a structural model with the shocks identified by conditional heteroskedasticity
# and overidentifying constraints imposed on the impact matrix: zero lower left element,
# estimation without employing a robust estimation method:
fit32cmls_hs2 <- fitSSTVAR(fit32cmls_hs, identification="heteroskedasticity",
B_constraints=matrix(c(NA, 0, NA, NA), nrow=2),
robust_method="none")
# Relax the zero constraint on the impact matrix and re-estimate the model:
fit32cmls_hs3 <- fitSSTVAR(fit32cmls_hs2, identification="heteroskedasticity",
B_constraints=matrix(c(NA, NA, NA, NA), nrow=2),
robust_method="none")