View source: R/GSMVARconstruction.R
GSMVAR | R Documentation |
GSMVAR
creates a class 'gsmvar'
object that defines
a reduced form or structural GMVAR, StMVAR, or G-StMVAR model
GSMVAR(
data,
p,
M,
d,
params,
conditional = TRUE,
model = c("GMVAR", "StMVAR", "G-StMVAR"),
parametrization = c("intercept", "mean"),
constraints = NULL,
same_means = NULL,
weight_constraints = NULL,
structural_pars = NULL,
calc_cond_moments,
calc_std_errors = FALSE,
stat_tol = 0.001,
posdef_tol = 1e-08,
df_tol = 1e-08
)
## S3 method for class 'gsmvar'
logLik(object, ...)
## S3 method for class 'gsmvar'
residuals(object, ...)
## S3 method for class 'gsmvar'
summary(object, ..., digits = 2)
## S3 method for class 'gsmvar'
plot(x, ..., type = c("both", "series", "density"))
## S3 method for class 'gsmvar'
print(x, ..., digits = 2, summary_print = FALSE)
data |
a matrix or class |
p |
a positive integer specifying the autoregressive order of the model. |
M |
|
d |
number of times series in the system, i.e. |
params |
a real valued vector specifying the parameter values.
Above, In the GMVAR model, The notation is similar to the cited literature. |
conditional |
a logical argument specifying whether the conditional or exact log-likelihood function should be used. |
model |
is "GMVAR", "StMVAR", or "G-StMVAR" model considered? In the G-StMVAR model, the first |
parametrization |
|
constraints |
a size |
same_means |
Restrict the mean parameters of some regimes to be the same? Provide a list of numeric vectors
such that each numeric vector contains the regimes that should share the common mean parameters. For instance, if
|
weight_constraints |
a numeric vector of length |
structural_pars |
If
See Virolainen (forthcoming) for the conditions required to identify the shocks and for the B-matrix as well (it is |
calc_cond_moments |
should conditional means and covariance matrices should be calculated?
Default is |
calc_std_errors |
should approximate standard errors be calculated? |
stat_tol |
numerical tolerance for stationarity of the AR parameters: if the "bold A" matrix of any regime
has eigenvalues larger that |
posdef_tol |
numerical tolerance for positive definiteness of the error term covariance matrices: if the error term covariance matrix of any regime has eigenvalues smaller than this, the model is classified as not satisfying positive definiteness assumption. Note that if the tolerance is too small, numerical evaluation of the log-likelihood might fail and cause error. |
df_tol |
the parameter vector is considered to be outside the parameter space if all degrees of
freedom parameters are not larger than |
object |
object of class |
... |
currently not used. |
digits |
number of digits to be printed. |
x |
object of class |
type |
which type figure should be produced? Or both? |
summary_print |
if set to |
If data is provided, then also multivariate quantile residuals (Kalliovirta and Saikkonen 2010) are computed and included in the returned object.
If the function fails to calculate approximative standard errors and the parameter values are near the border of the parameter space, it might help to use smaller numerical tolerance for the stationarity and positive definiteness conditions.
The first plot displays the time series together with estimated mixing weights. The second plot displays a (Gaussian) kernel density estimates of the individual series together with the marginal stationary density implied by the model. The colored regimewise stationary densities are multiplied with the mixing weight parameter estimates.
Returns an object of class 'gsmvar'
defining the specified reduced form or structural GMVAR,
StMVAR, or G-StMVAR model. Can be used to work with other functions provided in gmvarkit
.
Note that the first autocovariance/correlation matrix in $uncond_moments
is for the lag zero,
the second one for the lag one, etc.
logLik(gsmvar)
: Log-likelihood method
residuals(gsmvar)
: residuals method to extract multivariate quantile residuals
summary(gsmvar)
: summary method
plot(gsmvar)
: plot method for class 'gsmvar'
print(gsmvar)
: print method
If data is not provided, only the print
and simulate
methods are available.
If data is provided, then in addition to the ones listed above, predict
method is also available.
See ?simulate.gsmvar
and ?predict.gsmvar
for details about the usage.
Kalliovirta L., Meitz M. and Saikkonen P. 2016. Gaussian mixture vector autoregression. Journal of Econometrics, 192, 485-498.
Kalliovirta L. and Saikkonen P. 2010. Reliable Residuals for Multivariate Nonlinear Time Series Models. Unpublished Revision of HECER Discussion Paper No. 247.
Virolainen S. 2022. Gaussian and Student's t mixture vector autoregressive model with application to the asymmetric effects of monetary policy shocks in the Euro area. Unpublished working paper, available as arXiv:2109.13648.
Virolainen S. 2025. A statistically identified structural vector autoregression with endogenously switching volatility regime. Journal of Business & Economic Statistics, 43, 1, 44-54.
fitGSMVAR
, add_data
, swap_parametrization
, GIRF
,
gsmvar_to_sgsmvar
, stmvar_to_gstmvar
, reorder_W_columns
,
swap_W_signs
, update_numtols
# GMVAR(1, 2), d=2 model:
params12 <- c(0.55, 0.112, 0.344, 0.055, -0.009, 0.718, 0.319, 0.005,
0.03, 0.619, 0.173, 0.255, 0.017, -0.136, 0.858, 1.185, -0.012,
0.136, 0.674)
mod12 <- GSMVAR(gdpdef, p=1, M=2, params=params12)
mod12
# GMVAR(1, 2), d=2 model without data
mod12_2 <- GSMVAR(p=1, M=2, d=2, params=params12)
mod12_2
# StMVAR(1, 2), d=2 model:
mod12t <- GSMVAR(gdpdef, p=1, M=2, params=c(params12, 10, 20),
model="StMVAR")
mod12t
# G-StMVAR(1, 1, 1), d=2 model:
mod12gs <- GSMVAR(gdpdef, p=1, M=c(1, 1), params=c(params12, 20),
model="G-StMVAR")
mod12gs
# GMVAR(2, 2), d=2 model with mean-parametrization:
params22 <- c(0.869, 0.549, 0.223, 0.059, -0.151, 0.395, 0.406,
-0.005, 0.083, 0.299, 0.215, 0.002, 0.03, 0.576, 1.168, 0.218,
0.02, -0.119, 0.722, 0.093, 0.032, 0.044, 0.191, 1.101, -0.004,
0.105, 0.58)
mod22 <- GSMVAR(gdpdef, p=2, M=2, params=params22, parametrization="mean")
mod22
# Structural GMVAR(2, 2), d=2 model identified with sign-constraints:
params22s <- c(0.36, 0.121, 0.484, 0.072, 0.223, 0.059, -0.151, 0.395,
0.406, -0.005, 0.083, 0.299, 0.218, 0.02, -0.119, 0.722, 0.093, 0.032,
0.044, 0.191, 0.057, 0.172, -0.46, 0.016, 3.518, 5.154, 0.58)
W_22 <- matrix(c(1, 1, -1, 1), nrow=2, byrow=FALSE)
mod22s <- GSMVAR(gdpdef, p=2, M=2, params=params22s,
structural_pars=list(W=W_22))
mod22s
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.