smart_weightpars: Create random transition weight parameter values

View source: R/generateParams.R

smart_weightparsR Documentation

Create random transition weight parameter values

Description

smart_weightpars generates random transition weight parameter values relatively close to the ones given in weight_pars

Usage

smart_weightpars(
  M,
  weight_pars,
  weight_function = c("relative_dens", "logistic", "mlogit", "exponential", "threshold",
    "exogenous"),
  weight_constraints = NULL,
  accuracy
)

Arguments

M

a positive integer specifying the number of regimes

weight_pars

a vector containing transition weight parameter values.

If weight_function == "relative_dens":

a length M-1 vector (\alpha_1,...,\alpha_{M-1}).

If 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.

If 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 mth 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.

If 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.

If 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.

If weight_function == "exogenous":

of length zero.

weight_function

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 mth 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 ith 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 ith 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 ith variable.

"exogenous":

Exogenous nonrandom transition weights, specify the weight series in weightfun_pars.

See the vignette for more details about the weight functions.

weight_constraints

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).

accuracy

a positive real number adjusting how close to the given parameter vector the returned individual should be. Larger number means larger accuracy. Read the source code for details.

Value

Returns a numeric vector ...

If weight_function == "relative_dens":

a length M-1 vector (\alpha_1,...,\alpha_{M-1}).

If 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.

If 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 mth 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.

If 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.

If 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.

If weight_function == "exogenous":

of length zero.


sstvars documentation built on April 11, 2025, 5:47 p.m.