View source: R/STVARconstruction.R
| alt_stvar | R Documentation | 
fitSTVARalt_stvar constructs a STVAR model based on results from an arbitrary estimation
round of fitSTVAR
alt_stvar(stvar, which_largest = 1, which_round, calc_std_errors = FALSE)
stvar | 
 object of class   | 
which_largest | 
 based on estimation round with which largest log-likelihood should the model be constructed?
An integer value in 1,...,  | 
which_round | 
 based on which estimation round should the model be constructed? An integer value in 1,...,  | 
calc_std_errors | 
 should approximate standard errors be calculated?  | 
It's sometimes useful to examine other estimates than the one with the highest log-likelihood. This function
is wrapper around STVAR that picks the correct estimates from an object returned by fitSTVAR.
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.  | 
seeds | 
 The seeds used in the estimation in   | 
LS_estimates | 
 The least squares estimates of the parameters in the form
  | 
Anderson H., Vahid F. 1998. Testing multiple equation systems for common nonlinear components. Journal of Econometrics, 84:1, 1-36.
Hubrich K., Teräsvirta. T. 2013. Thresholds and Smooth Transitions in Vector Autoregressive Models. CREATES Research Paper 2013-18, Aarhus University.
Lanne M., Virolainen S. 2025. A Gaussian smooth transition vector autoregressive model: An application to the macroeconomic effects of severe weather shocks. Journal of Economic Dynamics and Control, 178, 105162.
Kheifets I.L., Saikkonen P.J. 2020. Stationarity and ergodicity of Vector STAR models. Econometric Reviews, 39:4, 407-414.
Lütkepohl H., Netšunajev A. 2017. Structural vector autoregressions with smooth transition in variances. Journal of Economic Dynamics & Control, 84, 43-57.
Tsay R. 1998. Testing and Modeling Multivariate Threshold Models. Journal of the American Statistical Association, 93:443, 1188-1202.
Virolainen S. 2025. Identification by non-Gaussianity in structural smooth transition vector autoregressive models. Unpublished working paper, available as arXiv:2404.19707.
STVAR
## These are long-running examples that take approximately 10 seconds to run.
# Estimate a Gaussian STVAR p=1, M=2 model with threshold weight function and
# the first lag of the second variable as the switching variables. Run only two
# estimation rounds and use the two-phase estimation method:
fit12 <- fitSTVAR(gdpdef, p=1, M=2, weight_function="threshold", weightfun_pars=c(2, 1),
 nrounds=2, seeds=c(1, 4), estim_method="two-phase")
fit12$loglik # Log-likelihood of the estimated model
# Print the log-likelihood obtained from each estimation round:
fit12$all_logliks
# Construct the model based on the second largest log-likelihood found in the
# estimation procedure:
fit12_alt <- alt_stvar(fit12, which_largest=2, calc_std_errors=FALSE)
fit12_alt$loglik # Log-likelihood of the alternative solution
# Construct a model based on a specific estimation round, the first round:
fit12_alt2 <- alt_stvar(fit12, which_round=1, calc_std_errors=FALSE)
fit12_alt2$loglik # Log-likelihood of the alternative solution
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.