Learn R Programming

gmvarkit (version 1.4.1)

random_ind: Create random mean-parametrized parameter vector of a GMVAR model that may not be stationary

Description

random_ind generates random mean-parametrized parameter vector that may not be stationary.

Usage

random_ind(
  p,
  M,
  d,
  constraints = NULL,
  same_means = NULL,
  structural_pars = NULL,
  mu_scale,
  mu_scale2,
  omega_scale,
  W_scale,
  lambda_scale,
  ar_scale2 = 1
)

Arguments

p

a positive integer specifying the autoregressive order of the model.

M

a positive integer specifying the number of mixture components.

d

the number of time series in the system.

constraints

a size \((Mpd^2 x q)\) constraint matrix \(C\) specifying general linear constraints to the autoregressive parameters. We consider constraints of form (\(\phi\)\(_{1}\)\(,...,\)\(\phi\)\(_{M}) = \)\(C \psi\), where \(\phi\)\(_{m}\)\( = (vec(A_{m,1}),...,vec(A_{m,p}) (pd^2 x 1), m=1,...,M\), contains the coefficient matrices and \(\psi\) \((q x 1)\) contains the related parameters. For example, to restrict the AR-parameters to be the same for all regimes, set \(C\)= [I:...:I]' \((Mpd^2 x pd^2)\) where I = diag(p*d^2). Ignore (or set to NULL) if linear constraints should not be employed.

same_means

Restrict the mean parameters of some regimes to be the same? 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 the same 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".

structural_pars

If NULL a reduced form model is considered. For structural model, should be a list containing the following elements:

  • W - a \((dxd)\) matrix with its entries imposing constraints on \(W\): NA indicating that the element is unconstrained, a positive value indicating strict positive sign constraint, a negative value indicating strict negative sign constraint, and zero indicating that the element is constrained to zero.

  • C_lambda - a \((d(M-1) x r)\) constraint matrix that satisfies (\(\lambda\)\(_{2}\)\(,...,\) \(\lambda\)\(_{M}) =\) \(C_{\lambda} \gamma\) where \(\gamma\) is the new \((r x 1)\) parameter subject to which the model is estimated (similarly to AR parameter constraints). The entries of C_lambda must be either positive or zero. Ignore (or set to NULL) if the eigenvalues \(\lambda_{mi}\) should not be constrained.

See Virolainen (2020) for the conditions required to identify the shocks and for the B-matrix as well (it is \(W\) times a time-varying diagonal matrix with positive diagonal entries).

mu_scale

a size \((dx1)\) vector defining means of the normal distributions from which each mean parameter \(\mu_{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 \(\mu_{m}\) is drawn from in random mutations. Default is 2*sd(data[,i]), i=1,..,d.

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 structural model is considered.

W_scale

a size \((dx1)\) strictly positive vector partly specifying the scale and variability of the random covariance matrices in random mutations. The elements of the matrix \(W\) are drawn independently from such normal distributions that the expectation of the main diagonal elements of the first regime's error term covariance matrix \(\Omega_1 = WW'\) is W_scale. The distribution of \(\Omega_1\) will be in some sense like a Wishart distribution but with the columns (elements) of \(W\) obeying the given constraints. The constraints are accounted for by setting the element to be always zero if it is subject to a zero constraint and for sign constraints the absolute value or negative the absolute value are taken, and then the variances of the elements of \(W\) are adjusted accordingly. This argument is ignored if reduced form model is considered.

lambda_scale

a length \(M - 1\) vector specifying the standard deviation of the mean zero normal distribution from which the eigenvalue \(\lambda_{mi}\) parameters are drawn from in random mutations. As the eigenvalues should always be positive, the absolute value is taken. The elements of lambda_scale should be strictly positive real numbers with the \(m-1\)th element giving the degrees of freedom for the \(m\)th regime. The expected value of the main diagonal elements \(ij\) of the \(m\)th \((m>1)\) error term covariance matrix will be W_scale[i]*(d - n_i)^(-1)*sum(lambdas*ind_fun) where the \((d x 1)\) vector lambdas is drawn from the absolute value of the t-distribution, n_i is the number of zero constraints in the \(i\)th row of \(W\) and ind_fun is an indicator function that takes the value one iff the \(ij\)th element of \(W\) is not constrained to zero. Basically, larger lambdas (or smaller degrees of freedom) imply larger variance.

If the lambda parameters are constrained with the \((d(M - 1) x r)\) constraint matrix \(C_lambda\), then provide a length \(r\) vector specifying the standard deviation of the (absolute value of the) mean zero normal distribution each of the \(\gamma\) parameters are drawn from (the \(\gamma\) is a \((r x 1)\) vector). The expected value of the main diagonal elements of the covariance matrices then depend on the constraints.

This argument is ignored if \(M==1\) or a reduced form model is considered. Default is rep(3, times=M-1) if lambdas are not constrained and rep(3, times=r) if lambdas are constrained.

As with omega_scale and W_scale, this argument should be adjusted carefully if specified by hand. NOTE that if lambdas are constrained in some other way than restricting some of them to be identical, this parameter should be adjusted accordingly in order to the estimation succeed!

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 larger coefficients (in absolute value). Values smaller than 1 can be used if the AR coefficients are expected to be very small, but values larger than 1 are generally not recommended as it might lead to failure in creation of stationary parameter candidates.

Value

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.

References

  • Kalliovirta L., Meitz M. and Saikkonen P. 2016. Gaussian mixture vector autoregression. Journal of Econometrics, 192, 485-498.

  • Virolainen S. 2020. Structural Gaussian mixture vector autoregressive model. Unpublished working paper, available as arXiv:2007.04713.