check_params {sstvars} | R Documentation |
Check whether the parameter vector is in the parameter space and throw error if not
Description
check_params
checks whether the parameter vector is in the parameter
space.
Usage
check_params(
data,
p,
M,
d,
params,
weight_function = c("relative_dens", "logistic", "mlogit", "exponential", "threshold",
"exogenous"),
weightfun_pars = NULL,
cond_dist = c("Gaussian", "Student", "ind_Student"),
parametrization = c("intercept", "mean"),
identification = c("reduced_form", "recursive", "heteroskedasticity",
"non-Gaussianity"),
AR_constraints = NULL,
mean_constraints = NULL,
weight_constraints = NULL,
B_constraints = NULL,
transition_weights,
stab_tol = 0.001,
posdef_tol = 1e-08,
distpar_tol = 1e-08,
weightpar_tol = 1e-08
)
Arguments
data |
a matrix or class |
p |
a positive integer specifying the autoregressive order |
M |
a positive integer specifying the number of regimes |
d |
the number of time series in the system, i.e., the dimension |
params |
a real valued vector specifying the parameter values.
Should have the form
For models with...
Above, |
weight_function |
What type of transition weights
See the vignette for more details about the weight functions. |
weightfun_pars |
|
cond_dist |
specifies the conditional distribution of the model as |
parametrization |
|
identification |
is it reduced form model or an identified structural model; if the latter, how is it identified (see the vignette or the references for details)?
|
AR_constraints |
a size |
mean_constraints |
Restrict the mean parameters of some regimes to be identical? 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 list of two elements, |
B_constraints |
a |
transition_weights |
(optional; only for models with |
stab_tol |
numerical tolerance for stability of condition of the regimes: 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 parameter is considered to be outside the parameter space. Note that if the tolerance is too small, numerical evaluation of the log-likelihood might fail and cause error. |
distpar_tol |
the parameter vector is considered to be outside the parameter space if the degrees of
freedom parameters is not larger than |
weightpar_tol |
numerical tolerance for weight parameters being in the parameter space. Values closer to to the border of the parameter space than this are considered to be "outside" the parameter space. |
Value
Throws an informative error if there is something wrong with the parameter vector.
References
Kheifets I.L., Saikkonen P.J. 2020. Stationarity and ergodicity of Vector STAR models. Econometric Reviews, 39:4, 407-414.
Lütkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.
Lanne M., Virolainen S. 2024. A Gaussian smooth transition vector autoregressive model: An application to the macroeconomic effects of severe weather shocks. Unpublished working paper, available as arXiv:2403.14216.
Virolainen S. 2024. Identification by non-Gaussianity in structural threshold and smooth transition vector autoregressive models. Unpublished working paper, available as arXiv:2404.19707.
@keywords internal
Examples
# There examples will cause an informative error
params112_notpd <- c(6.5e-01, 7.0e-01, 2.9e-01, 2.0e-02, -1.4e-01,
9.0e-01, 6.0e-01, -1.0e-02, 1.0e-07)
try(check_params(p=1, M=1, d=2, params=params112_notpd))
params112_notstat <- c(6.5e-01, 7.0e-01, 10.9e-01, 2.0e-02, -1.4e-01,
9.0e-01, 6.0e-01, -1.0e-02, 1.0e-07)
try(check_params(p=1, M=1, d=2, params=params112_notstat))
params112_wronglength <- c(6.5e-01, 7.0e-01, 2.9e-01, 2.0e-02, -1.4e-01,
9.0e-01, 6.0e-01, -1.0e-02)
try(check_params(p=1, M=1, d=2, params=params112_wronglength))