View source: R/loglikelihood.R
loglikelihood | R Documentation |
loglikelihood
log-likelihood function of a smooth transition VAR model
loglikelihood(
data,
p,
M,
params,
weight_function = c("relative_dens", "logistic", "mlogit", "exponential", "threshold",
"exogenous"),
weightfun_pars = NULL,
cond_dist = c("Gaussian", "Student", "ind_Student", "ind_skewed_t"),
parametrization = c("intercept", "mean"),
identification = c("reduced_form", "recursive", "heteroskedasticity",
"non-Gaussianity"),
AR_constraints = NULL,
mean_constraints = NULL,
weight_constraints = NULL,
B_constraints = NULL,
other_constraints = NULL,
to_return = c("loglik", "tw", "loglik_and_tw", "terms", "regime_cmeans",
"total_cmeans", "total_ccovs", "B_t"),
check_params = TRUE,
penalized = FALSE,
penalty_params = c(0.05, 0.2),
allow_unstab = FALSE,
bound_by_weights = FALSE,
indt_R = FALSE,
alt_par = FALSE,
minval = NULL,
stab_tol = 0.001,
posdef_tol = 1e-08,
distpar_tol = 1e-08,
weightpar_tol = 1e-08
)
data |
a matrix or class |
p |
a positive integer specifying the autoregressive order |
M |
a positive integer specifying the number of regimes |
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 |
other_constraints |
A list containing internally used additional type of constraints (see the options below).
|
to_return |
should the returned object be the log-likelihood, which is the default, or something else? See the section "Value" for all the options. |
check_params |
should it be checked that the parameter vector satisfies the model assumptions? Can be skipped to save computation time if it does for sure. |
penalized |
Perform penalized LS estimation that minimizes penalized RSS in which estimates close to breaking or not satisfying the
usual stability condition are penalized? If |
penalty_params |
a numeric vector with two positive elements specifying the penalization parameters: the first element determined how far from the boundary of the stability region the penalization starts (a number between zero and one, smaller number starts penalization closer to the boundary) and the second element is a tuning parameter for the penalization (a positive real number, a higher value penalizes non-stability more). |
allow_unstab |
If |
bound_by_weights |
should |
indt_R |
If |
alt_par |
If |
minval |
the value that will be returned if the parameter vector does not lie in the parameter space (excluding the identification condition). |
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. |
Calculates the log-likelihood of the specified model.
to_return="loglik"
:the log-likelihood of the specified model.
to_return=="tw"
:a size [n_obs-p, M]
matrix containing the transition weights: for m:th component
in m:th column.
to_return=="loglik_and_tw"
:a list of two elements. The first element ($loglik
) contains the
log-likelihood and the second element ($tw
) contains the transition weights.
to_return=="terms"
:a length n_obs-p
numeric vector containing the terms l_{t}
.
to_return=="regime_cmeans"
:an [n_obs-p, d, M]
array containing the regimewise conditional means.
to_return=="total_cmeans"
:a [n_obs-p, d]
matrix containing the conditional means of the process.
to_return=="total_ccovs"
:an [d, d, n_obs-p]
array containing the conditional covariance matrices of
the process.
to_return=="B_t"
:an [d, d, n_obs-p]
array containing the impact matrices B_t
of
the process. Available only for models with cond_dist="ind_Student"
.
Anderson H., Vahid F. 1998. Testing multiple equation systems for common nonlinear components. Journal of Econometrics, 84:1, 1-36.
Hansen B.E. 1994. Autoregressive Conditional Density estimation. Journal of Econometrics, 35:3, 705-730.
Kheifets I.L., Saikkonen P.J. 2020. Stationarity and ergodicity of Vector STAR models. International Economic Review, 35:3, 407-414.
Lanne M., Virolainen S. 2025. 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.
Lütkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.
McElroy T. 2017. Computation of vector ARMA autocovariances. Statistics and Probability Letters, 124, 92-96.
Kilian L., Lütkepohl H. 20017. Structural Vector Autoregressive Analysis. 1st edition. Cambridge University Press, Cambridge.
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 threshold and smooth transition vector autoregressive models. Unpublished working paper, available as arXiv:2404.19707.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.