p: a positive integer specifying the autoregressive order
M: a positive integer specifying the number of regimes
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.
weightfun_pars: - If weight_function == "relative_dens":: Not used.
If weight_function %in% c("logistic", "exponential", "threshold"):: a numeric vector with the switching variable i∈{1,...,d} in the first and the lag j∈{1,...,p} in the second element.
If weight_function == "mlogit":: a list of two elements:
- **The first element `$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$.
- **The second element `$lags`:**: an integer in $\lbrace 1,...,p \rbrace$ specifying the number of lags to be used in the weight function.
If 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.
cond_dist: specifies the conditional distribution of the model as "Gaussian", "Student", "ind_Student", or "ind_skewed_t", where "ind_Student" the Student's t distribution with independent components, and "ind_skewed_t" is the skewed t distribution with independent components (see Hansen, 1994).
AR_constraints: a size (Mpd2×q) constraint matrix C specifying linear constraints to the autoregressive parameters. The constraints are of the form (φ1,...,φM)=Cψ, where φm=(vec(Am,1),...,vec(Am,p))(pd2×1),m=1,...,M, contains the coefficient matrices and ψ(q×1) contains the related parameters. For example, to restrict the AR-parameters to be the identical across the regimes, set C=
[I:...:I]' (Mpd2×pd2) where I = diag(p*d^2).
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 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".
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).
force_stability: Should the algorithm proposed by Ansley and Kohn (1986) be used to generate AR matrices that always satisfy the stability condition? Not supported if AR constraints are employed.
mu_scale: a size (dx1) vector defining means of the normal distributions from which each mean parameter μm is drawn from in random mutations. Default is colMeans(data). Note that mean-parametrization is always used for optimization in GAfit - even when parametrization=="intercept". However, input (in initpop) and output (return value) parameter vectors can be intercept-parametrized.
mu_scale2: a size (dx1) strictly positive vector defining standard deviations of the normal distributions from which each mean parameter μm is drawn from in random mutations. Default is vapply(1:d, function(i1) sd(data[,i1]), numeric(1)).
omega_scale: a size (dx1) strictly positive vector specifying the scale and variability of the random covariance matrices in random mutations. The covariance matrices are drawn from (scaled) Wishart distribution. Expected values of the random covariance matrices are diag(omega_scale). Standard deviations of the diagonal elements are sqrt(2/d)*omega_scale[i]
and for non-diagonal elements they are sqrt(1/d*omega_scale[i]*omega_scale[j]). Note that for d>4 this scale may need to be chosen carefully. Default in GAfit is var(stats::ar(data[,i], order.max=10)$resid, na.rm=TRUE), i=1,...,d. This argument is ignored if cond_dist == "ind_Student".
B_scale: a size (d×1) strictly positive vector specifying the mean and variability of the random impact matrices in random mutations. In Regime 1, the mean of the error term covariance matrix implied by the random impact matrix will be 0.95*diag(B_scale) and in the rest of the regimes diag(B_scale), whereas the variability increases with B_scale. Default in GAfit is var(stats::ar(data[,i], order.max=10)$resid, na.rm=TRUE), i=1,...,d. This argument is ignored if cond_dist != "ind_Student".
weight_scale: 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.
ar_scale: a positive real number between zero and one adjusting how large AR parameter values are typically proposed in construction of the initial population: larger value implies larger coefficients (in absolute value). After construction of the initial population, a new scale is drawn from (0, upper_ar_scale) uniform distribution in each iteration.
ar_scale2: a positive real number adjusting how large AR parameter values are typically proposed in some random mutations (if AR constraints are employed, in all random mutations): larger value implies smaller
coefficients (in absolute value). Values larger than 1 can be used if the AR coefficients are expected tobe very small. If set smaller than 1, be careful as it might lead tofailure in the creation of parameter candidates that satisfy thestability condition.
fixed_params: a vector containing fixed parameter values for intercept, autoregressive, and weight parameters that should be fixed in the initial population . Should have the form: (ϕ1,0,...,ϕM,0,φ1,...,φM,α, where
(ϕm,0= the (d×1) intercept vector of the mth regime.
φm=(vec(Am,1),...,vec(Am,p))(pd2×1).
α vector of the weight parameters.
For models with...
AR_constraints:: Replace φ1,...,φM with ψ as described in the argument AR_constraints.
weight_constraints:: If linear constraints are imposed, replace α with ξ as described in the argument weigh_constraints. If weight functions parameters are imposed to be fixed values, simply drop α
from the parameter vector.
Note that fixed_params should always be in the intercept parametrization (and parametrization="intercept" should always be used).
Passing this argument from fitSTVAR in does not do anything, as it isdesigned to be used with the three-phase estimation procedure only.Also, this argument does not do anything if the initial population isspecified in the argument initpop.
Returns
Returns random mean parametrized parameter vector that has the same form as the argument params
in the other functions, for instance, in the function loglikelihood.
Details
Structural models are not supported!
References
Ansley C.F., Kohn R. 1986. A note on reparameterizing a vector autoregressive moving average model to enforce stationarity. Journal of statistical computation and simulation, 24 :2, 99-106.