get_residuals | R Documentation |
get_residuals
calculates residuals of a smooth transition VAR
get_residuals(
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,
standardize = TRUE,
structural_shocks = FALSE,
penalized = FALSE,
penalty_params = c(0.05, 0.5),
allow_unstab = FALSE
)
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 |
standardize |
standardize the residuals to identity matrix covariance matrix? |
structural_shocks |
If |
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 |
Returns a (T \times d)
matrix containing...
standardize == TRUE
:the standardized Pearson residuals.
standardize == FALSE
:the nonstandardized residuals.
structural_shocks == TRUE
:the structural shocks.
Note that the starting time is p + 1
counted from the beginning of the starting time of the data,
as the first p
observations are used as initial values.
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.