swap_parametrization {sstvars}R Documentation

Swap the parametrization of a STVAR model

Description

swap_parametrization swaps the parametrization of a STVAR model to "mean" if the current parametrization is "intercept", and vice versa.

Usage

swap_parametrization(stvar, calc_std_errors = FALSE)

Arguments

stvar

object of class "stvar"

calc_std_errors

should approximate standard errors be calculated?

Details

swap_parametrization is a convenient tool if you have estimated the model in "intercept" parametrization but wish to work with "mean" parametrization in the future, or vice versa.

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

Examples

## Create a Gaussian STVAR p=1, M=2 model with the weighted relative stationary densities
# of the regimes as the transition weight function; use the intercept parametrization:
theta_122relg <- c(0.734054, 0.225598, 0.705744, 0.187897, 0.259626, -0.000863,
  -0.3124, 0.505251, 0.298483, 0.030096, -0.176925, 0.838898, 0.310863, 0.007512,
  0.018244, 0.949533, -0.016941, 0.121403, 0.573269)
mod122 <- STVAR(p=1, M=2, d=2, params=theta_122relg, parametrization="intercept")
mod122$params[1:4] # The intercept parameters

# Swap from the intercept parametrization to mean parametrization:
mod122mu <- swap_parametrization(mod122)
mod122mu$params[1:4] # The mean parameters

# Swap back to the intercept parametrization:
mod122int <- swap_parametrization(mod122mu)
mod122int$params[1:4] # The intercept parameters

## Create a linear VAR(p=1) model with the intercept parametrization, include
# the two-variate data gdpdef to the model and calculate approximate standard errors:
theta_112 <- c(0.649526, 0.066507, 0.288526, 0.021767, -0.144024, 0.897103,
  0.601786, -0.002945, 0.067224)
mod112 <- STVAR(data=gdpdef, p=1, M=1, params=theta_112, parametrization="intercept",
  calc_std_errors=TRUE)
print(mod112, standard_error_print=TRUE) # Standard errors are printed for the intercepts

# To obtain standard errors for the unconditional means instead of the intercepts,
# swap to mean parametrization:
mod112mu <- swap_parametrization(mod112, calc_std_errors=TRUE)
print(mod112mu, standard_error_print=TRUE) # Standard errors are printed for the means

[Package sstvars version 1.0.1 Index]