Description Usage Arguments Details Value Methods (by generic) About S3 methods References See Also Examples
View source: R/GSMVARconstruction.R
GSMVAR
creates a class 'gsmvar'
object that defines
a reduced form or structural GMVAR, StMVAR, or GStMVAR model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33  GSMVAR(
data,
p,
M,
d,
params,
conditional = TRUE,
model = c("GMVAR", "StMVAR", "GStMVAR"),
parametrization = c("intercept", "mean"),
constraints = NULL,
same_means = NULL,
structural_pars = NULL,
calc_cond_moments,
calc_std_errors = FALSE,
stat_tol = 0.001,
posdef_tol = 1e08,
df_tol = 1e08
)
## 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, φ_{m,0} is the intercept parameter, A_{m,i} denotes the ith coefficient matrix of the mth
mixture component, Ω_{m} denotes the error term covariance matrix of the m:th mixture component, and
α_{m} is the mixing weight parameter. The W and λ_{mi} are structural parameters replacing the
error term covariance matrices (see Virolainen, 2020). If M=1, α_{m} and λ_{mi} are dropped.
If In the GMVAR model, M1=M and ν is dropped from the parameter vector. In the StMVAR model, M1=0.
In the GStMVAR model, the first The notation is similar to the cited literature. 
conditional 
a logical argument specifying whether the conditional or exact loglikelihood function should be used. 
model 
is "GMVAR", "StMVAR", or "GStMVAR" model considered? In the GStMVAR model, the first 
parametrization 

constraints 
a size (Mpd^2 x q) constraint matrix C specifying general linear constraints
to the autoregressive parameters. We consider constraints of form
(φ_{1},...,φ_{M}) = C ψ,
where φ_{m} = (vec(A_{m,1}),...,vec(A_{m,p}) (pd^2 x 1), m=1,...,M,
contains the coefficient matrices and ψ (q x 1) contains the related parameters.
For example, to restrict the ARparameters to be the same for all regimes, set C=
[ 
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

structural_pars 
If
See Virolainen (2020) for the conditions required to identify the shocks and for the Bmatrix as well (it is W times a timevarying diagonal matrix with positive diagonal entries). 
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 loglikelihood 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 GStMVAR 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
: Loglikelihood method
residuals
: residuals method to extract multivariate quantile residuals
summary
: summary method
plot
: plot method for class 'gsmvar'
print
: 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, 485498.
Kalliovirta L. and Saikkonen P. 2010. Reliable Residuals for Multivariate Nonlinear Time Series Models. Unpublished Revision of HECER Discussion Paper No. 247.
Virolainen S. 2020. Structural Gaussian mixture vector autoregressive model. Unpublished working paper, available as arXiv:2007.04713.
Virolainen S. 2021. Gaussian and Student's t mixture vector autoregressive model. Unpublished working paper, available as arXiv:2109.13648.
fitGSMVAR
, add_data
, swap_parametrization
, GIRF
,
gsmvar_to_sgsmvar
, stmvar_to_gstmvar
, reorder_W_columns
,
swap_W_signs
, update_numtols
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37  # 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
# GStMVAR(1, 1, 1), d=2 model:
mod12gs < GSMVAR(gdpdef, p=1, M=c(1, 1), params=c(params12, 20),
model="GStMVAR")
mod12gs
# GMVAR(2, 2), d=2 model with meanparametrization:
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 signconstraints:
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.