smart_weightpars generates random transition weight parameter values relatively close to the ones given in weight_pars
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 (α1,...,αM−1).
If weight_function == "logistic":: a length two vector (c,γ), where c∈R is the location parameter and γ>0 is the scale parameter.
If weight_function == "mlogit":: a length ((M−1)k×1) vector (γ1,...,γM−1), where γm(k×1), m=1,...,M−1 contains the mlogit-regression coefficients of the mth regime. Specifically, for switching variables with indices in I⊂{1,...,d}, and with p~∈{1,...,p} lags included, γm contains the coefficients for the vector zt−1=(1,z~min{I},...,z~max{I}), where z~i=(yit−1,...,yit−p~), i∈I. So k=1+∣I∣p~
where $|I|$ denotes the number of elements in $I$.
If weight_function == "exponential":: a length two vector (c,γ), where c∈R is the location parameter and γ>0 is the scale parameter.
If weight_function == "threshold":: a length M−1 vector (r1,...,rM−1), where r1,...,rM−1 are the threshold values in an increasing order.
If weight_function == "exogenous":: of length zero.
weight_function: What type of transition weights αm,t should be used?
"relative_dens":: c("alpham,t=\n", "fracalphamfm,dp(yt−1,...,yt−p+1)sumn=1Malphanfn,dp(yt−1,...,yt−p+1)"), where αm∈(0,1) are weight parameters that satisfy ∑m=1Mαm=1 and fm,dp(⋅) is the dp-dimensional stationary density of the mth regime corresponding to p
consecutive observations. Available for Gaussian conditional distribution only.
"logistic":: M=2, α1,t=1−α2,t, and α2,t=[1+exp{−γ(yit−j−c)}]−1, where yit−j is the lag j
observation of the $i$th variable, $c$ is a location parameter, and $\gamma > 0$ is a scale parameter.
"mlogit":: c("alpham,t=fracexplbracegammam′zt−1rbrace\n", "sumn=1Mexplbracegamman′zt−1rbrace"), where γm are coefficient vectors, γM=0, and zt−1(k×1) is the vector containing a constant and the (lagged) switching variables.
"exponential":: M=2, α1,t=1−α2,t, and α2,t=1−exp{−γ(yit−j−c)}, where yit−j is the lag j
observation of the $i$th variable, $c$ is a location parameter, and $\gamma > 0$ is a scale parameter.
"threshold":: αm,t=1 if rm−1<yit−j≤rm and 0 otherwise, where −∞≡r0<r1<⋯<rM−1<rM≡∞ are thresholds yit−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_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 α. The constraints are of the form α=Rξ+r, where R is a known (a×l)
constraint matrix of full column rank (a is the dimension of α), r is a known (a×1) constant, and ξ is an unknown (l×1) parameter. Alternatively , set R=0 to constrain the weight parameters to the constant r (in this case, α 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.
Returns
Returns a numeric vector ...
If weight_function == "relative_dens":: a length M-1 vector (α1,...,αM−1).
If weight_function == "logistic":: a length two vector (c,γ), where c∈R is the location parameter and γ>0 is the scale parameter.
If weight_function == "mlogit":: a length ((M−1)k×1) vector (γ1,...,γM−1), where γm(k×1), m=1,...,M−1 contains the mlogit-regression coefficients of the mth regime. Specifically, for switching variables with indices in I⊂{1,...,d}, and with p~∈{1,...,p} lags included, γm contains the coefficients for the vector zt−1=(1,z~min{I},...,z~max{I}), where z~i=(yit−1,...,yit−p~), i∈I. So k=1+∣I∣p~
where $|I|$ denotes the number of elements in $I$.
If weight_function == "exponential":: a length two vector (c,γ), where c∈R is the location parameter and γ>0 is the scale parameter.
If weight_function == "threshold":: a length M−1 vector (r1,...,rM−1), where r1,...,rM−1 are the threshold values in an increasing order.
If weight_function == "exogenous":: of length zero.