Student_densities_Cpp function

Calculate log multivariate Student's t densities

Calculate log multivariate Student's t densities

Calculates logs of multivariate Student t densities with varying mean and varying covariance matrix AND EXCLUDING the constant term of the density (the constant is calculated and added in R code). The varying conditional covariance matrix is calculated within the function from the regime covariance matrices and transition weights.

Student_densities_Cpp(obs, means, covmats, alpha_mt, df)

Arguments

  • obs: a (T×d)(T \times d) matrix such that the iith row contains the vector yi=(y1i,...,ydi)y_{i}=(y_{1i},...,y_{di}) (dx1)(dx1). That is, the initial values are excluded but the last observations is included.

  • means: a (T×d)(T \times d) matrix such that the iith row contains the conditional mean of the process μy,i\mu_{y,i}.

  • covmats: a (d×d×M)(d \times d \times M) array such that the slice [, , m]

    contains the conditional covariance matrix of regime m.

  • alpha_mt: a (T×M)(T \times M) matrix such that [t, m] contains the time t transition weights of the mmth regime.

  • df: the degrees of freedom parameter value (assumed larger than two).

Returns

a numeric vector containing the multivariate Student's t densities, excluding the constant term.

Details

Note that the parametrization is with the covariance matrix and not the scale matrix.

  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-02-27