Learn R Programming

sstvars (version 1.1.0)

ind_skewed_t_densities_Cpp: Calculate log independent multivariate skewed t densities

Description

Calculates logs of independent multivariate skewed t densities with varying mean and impact matrix (including the constant terms of the density). The varying impact matrix is calculated within the function from the impact matrices of the regimes and transition weights.

Usage

ind_skewed_t_densities_Cpp(
  obs,
  means,
  impact_matrices,
  alpha_mt,
  all_nu,
  all_lambda,
  minval,
  posdef_tol
)

Value

A numeric vector of length \(T\), where each element represents the computed density component for the corresponding observation.

Arguments

obs

a \((T \times d)\) matrix such that the \(i\)th row contains the vector \(y_{i}=(y_{1i},...,y_{di})\) \((dx1)\). That is, the initial values are excluded but the last observations is included.

means

a \((T \times d)\) matrix such that the \(i\)th row contains the conditional mean of the process \(\mu_{y,i}\).

impact_matrices

a size \(d\times d \times M\) arma::cube (3D array in R), where each slice contains an invertible (d x d) impact matrix of each regime.

alpha_mt

a \((T \times M)\) matrix such that [t, m] contains the time t transition weights of the \(m\)th regime.

all_nu

a numeric vector of length \(d\), containing the degrees of freedom parameters for each component.

all_lambda

a numeric vector of length \(d\), containing the skewness parameters for each component.

minval

the value that will be returned if the parameter vector does not lie in the parameter space (excluding the identification condition).

posdef_tol

numerical tolerance for positive definiteness of the error term covariance matrices: if the error term covariance matrix of any regime has eigenvalues smaller than this, the parameter is considered to be outside the parameter space. Note that if the tolerance is too small, numerical evaluation of the log-likelihood might fail and cause error.

Details

Returns minval if the impact matrix \(B_t\) is not invertible for some t up to the numerical tolerance posdef_tol.