estim_NLS | R Documentation |
estim_NLS
estimates the autoregressive and weight parameters of STVAR models
by the method of least squares (relative_dens
weight function is not supported).
estim_NLS(
data,
p,
M,
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"),
AR_constraints = NULL,
mean_constraints = NULL,
weight_constraints = NULL,
penalized = TRUE,
penalty_params = c(0.05, 0.2),
min_obs_coef = 3,
sparse_grid = FALSE,
use_parallel = TRUE,
ncores = 2
)
data |
a matrix or class |
p |
a positive integer specifying the autoregressive order |
M |
a positive integer specifying the number of regimes |
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 |
|
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, |
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). |
min_obs_coef |
the smallest accepted number of observations (times variables) from each regime
relative to the number of parameters in the regime. For models with AR constraints, the number of
AR matrix parameters in each regimes is simplisticly assumed to be |
sparse_grid |
should the grid of weight function values in LS/NLS estimation be more sparse (speeding up the estimation)? |
use_parallel |
employ parallel computing? If |
ncores |
the number CPU cores to be used in parallel computing. |
Used internally in the multiple phase estimation procedure proposed by Virolainen (2025).
The weight function relative_dens
is not supported. Mean constraints are not supported.
Only weight constraints that specify the weight parameters as fixed values are supported.
Only intercept parametrization is supported.
Returns the estimated parameters in a vector of the form
(\phi_{1},...,\phi_{M},\varphi_1,...,\varphi_M,\alpha
, where
\phi_{m} =
the (d \times 1)
intercept vector of the m
th regime.
\varphi_m = (vec(A_{m,1}),...,vec(A_{m,p}))
(pd^2 \times 1)
.
\alpha
is the vector of the weight parameters:
weight_function="relative_dens"
:\alpha = (\alpha_1,...,\alpha_{M-1})
(M - 1 \times 1)
, where \alpha_m
(1\times 1), m=1,...,M-1
are the transition weight parameters.
weight_function="logistic"
:\alpha = (c,\gamma)
(2 \times 1)
, where c\in\mathbb{R}
is the location parameter and \gamma >0
is the scale parameter.
weight_function="mlogit"
:\alpha = (\gamma_1,...,\gamma_M)
((M-1)k\times 1)
,
where \gamma_m
(k\times 1)
, m=1,...,M-1
contains the multinomial logit-regression coefficients
of the m
th regime. Specifically, for switching variables with indices in I\subset\lbrace 1,...,d\rbrace
, and with
\tilde{p}\in\lbrace 1,...,p\rbrace
lags included, \gamma_m
contains the coefficients for the vector
z_{t-1} = (1,\tilde{z}_{\min\lbrace I\rbrace},...,\tilde{z}_{\max\lbrace I\rbrace})
, where
\tilde{z}_{i} =(y_{it-1},...,y_{it-\tilde{p}})
, i\in I
. So k=1+|I|\tilde{p}
where |I|
denotes the number of elements in I
.
weight_function="exponential"
:\alpha = (c,\gamma)
(2 \times 1)
, where c\in\mathbb{R}
is the location parameter and \gamma >0
is the scale parameter.
weight_function="threshold"
:\alpha = (r_1,...,r_{M-1})
(M-1 \times 1)
, where r_1,...,r_{M-1}
are the thresholds.
weight_function="exogenous"
:Omit \alpha
from the parameter vector.
For models with...
Replace \varphi_1,...,\varphi_M
with \psi
as described in the argument AR_constraints
.
If linear constraints are imposed, replace \alpha
with \xi
as described in the
argument weigh_constraints
. If weight functions parameters are imposed to be fixed values, simply drop \alpha
from the parameter vector.
Hubrich K., Teräsvirta. T. 2013. Thresholds and Smooth Transitions in Vector Autoregressive Models. CREATES Research Paper 2013-18, Aarhus University.
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.