random_weightpars
generates random transition weight parameter values
random_weightpars(
M,
weight_function = c("relative_dens", "logistic", "mlogit", "exponential", "threshold",
"exogenous"),
weightfun_pars = NULL,
AR_constraints = NULL,
mean_constraints = NULL,
weight_constraints = NULL,
weight_scale
)
Returns a numeric vector ...
weight_function == "relative_dens"
:a length M-1
vector \((\alpha_1,...,\alpha_{M-1})\).
weight_function == "logistic"
:a length two vector \((c,\gamma)\), where \(c\in\mathbb{R}\) is the location parameter and \(\gamma >0\) is the scale parameter.
weight_function == "mlogit"
:a length \(((M-1)k\times 1)\) vector \((\gamma_1,...,\gamma_{M-1})\), where \(\gamma_m\) \((k\times 1)\), \(m=1,...,M-1\) contains the mlogit-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"
:a length two vector \((c,\gamma)\), where \(c\in\mathbb{R}\) is the location parameter and \(\gamma >0\) is the scale parameter.
weight_function == "threshold"
:a length \(M-1\) vector \((r_1,...,r_{M-1})\), where \(r_1,...,r_{M-1}\) are the threshold values in an increasing order.
weight_function == "exogenous"
:of length zero.
a positive integer specifying the number of regimes
What type of transition weights \(\alpha_{m,t}\) should be used?
"relative_dens"
:\(\alpha_{m,t}= \frac{\alpha_mf_{m,dp}(y_{t-1},...,y_{t-p+1})}{\sum_{n=1}^M\alpha_nf_{n,dp}(y_{t-1},...,y_{t-p+1})}\), where \(\alpha_m\in (0,1)\) are weight parameters that satisfy \(\sum_{m=1}^M\alpha_m=1\) and \(f_{m,dp}(\cdot)\) is the \(dp\)-dimensional stationary density of the \(m\)th regime corresponding to \(p\) consecutive observations. Available for Gaussian conditional distribution only.
"logistic"
:\(M=2\), \(\alpha_{1,t}=1-\alpha_{2,t}\), and \(\alpha_{2,t}=[1+\exp\lbrace -\gamma(y_{it-j}-c) \rbrace]^{-1}\), where \(y_{it-j}\) is the lag \(j\) observation of the \(i\)th variable, \(c\) is a location parameter, and \(\gamma > 0\) is a scale parameter.
"mlogit"
:\(\alpha_{m,t}=\frac{\exp\lbrace \gamma_m'z_{t-1} \rbrace} {\sum_{n=1}^M\exp\lbrace \gamma_n'z_{t-1} \rbrace}\), where \(\gamma_m\) are coefficient vectors, \(\gamma_M=0\), and \(z_{t-1}\) \((k\times 1)\) is the vector containing a constant and the (lagged) switching variables.
"exponential"
:\(M=2\), \(\alpha_{1,t}=1-\alpha_{2,t}\), and \(\alpha_{2,t}=1-\exp\lbrace -\gamma(y_{it-j}-c) \rbrace\), where \(y_{it-j}\) is the lag \(j\) observation of the \(i\)th variable, \(c\) is a location parameter, and \(\gamma > 0\) is a scale parameter.
"threshold"
:\(\alpha_{m,t} = 1\) if \(r_{m-1}<y_{it-j}\leq r_{m}\) and \(0\) otherwise, where \(-\infty\equiv r_0<r_1<\cdots <r_{M-1}<r_M\equiv\infty\) are thresholds \(y_{it-j}\) is the lag \(j\) observation of the \(i\)th variable.
"exogenous"
:Exogenous nonrandom transition weights, specify the weight series in weightfun_pars
.
See the vignette for more details about the weight functions.
weight_function == "relative_dens"
:Not used.
weight_function %in% c("logistic", "exponential", "threshold")
:a numeric vector with the switching variable \(i\in\lbrace 1,...,d \rbrace\) in the first and the lag \(j\in\lbrace 1,...,p \rbrace\) in the second element.
weight_function == "mlogit"
:a list of two elements:
$vars
:a numeric vector containing the variables that should used as switching variables in the weight function in an increasing order, i.e., a vector with unique elements in \(\lbrace 1,...,d \rbrace\).
$lags
:an integer in \(\lbrace 1,...,p \rbrace\) specifying the number of lags to be used in the weight function.
weight_function == "exogenous"
:a size (nrow(data) - p
x M
) matrix containing the exogenous
transition weights as [t, m]
for time \(t\) and regime \(m\). Each row needs to sum to one and only weakly positive
values are allowed.
a size \((Mpd^2 \times q)\) constraint matrix \(C\) specifying linear constraints
to the autoregressive parameters. The constraints are of the form
\((\varphi_{1},...,\varphi_{M}) = C\psi\), where \(\varphi_{m} = (vec(A_{m,1}),...,vec(A_{m,p})) \ (pd^2 \times 1),\ m=1,...,M\),
contains the coefficient matrices and \(\psi\) \((q \times 1)\) contains the related parameters.
For example, to restrict the AR-parameters to be the identical across the regimes, set \(C =\)
[I:...:I
]' \((Mpd^2 \times pd^2)\) where I = diag(p*d^2)
.
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
M=3
, the argument list(1, 2:3)
restricts the mean parameters of the second and third regime to be
identical but the first regime has freely estimated (unconditional) mean. Ignore or set to NULL
if mean parameters
should not be restricted to be the same among any regimes. This constraint is available only for mean parametrized models;
that is, when parametrization="mean"
.
a list of two elements, \(R\) in the first element and \(r\) in the second element, specifying linear constraints on the transition weight parameters \(\alpha\). The constraints are of the form \(\alpha = R\xi + r\), where \(R\) is a known \((a\times l)\) constraint matrix of full column rank (\(a\) is the dimension of \(\alpha\)), \(r\) is a known \((a\times 1)\) constant, and \(\xi\) is an unknown \((l\times 1)\) parameter. Alternatively, set \(R=0\) to constrain the weight parameters to the constant \(r\) (in this case, \(\alpha\) is dropped from the constrained parameter vector).
For...
weight_function %in% c("relative_dens", "exogenous")
:not used.
weight_function %in% c("logistic", "exponential")
:length three vector with the mean (in the first element) and standard deviation (in the second element) of the normal distribution the location parameter is drawn from in random mutations. The third element is the standard deviation of the normal distribution from whose absolute value the location parameter is drawn from.
weight_function == "mlogit"
:length two vector with the mean (in the first element) and standard deviation (in the second element) of the normal distribution the coefficients of the logit sub model's constant terms are drawn from in random mutations. The third element is the standard deviation of the normal distribution from which the non-constant regressors' coefficients are drawn from.
weight_function == "threshold"
:a lenght two vector with the lower bound, in the first element and the upper bound, in the second element, of the uniform distribution threshold parameters are drawn from in random mutations.