qinmatr: Convert vector into matrix.

Description Usage Arguments Value See Also Examples

Description

Calling qinmatr() on a vector of dimension r(r+1)/2x1 converts the vector into a symmetric matrix of dimension rxr. This function is used to handle the MCMC sampling output from multivariate finite mixture models. To save storage the symmetric variance-covariance matrices of multivariate mixtures are stored vector form. If the covariance matrices are needed for calculations this function helps to restore these matrices from the storage vectors.

Usage

1

Arguments

q

A vector of dimension r(r+1)/2x1.

Value

A symmetric matrix of dimension rxr.

See Also

Examples

1
2
3
4
# Define a vector.
q <- rnorm(n = 6, mean = 0.5, sd = 2)
# Generate the symmetric matrix.
qinmatr(q)

simonsays1980/finmix documentation built on Dec. 23, 2021, 2:25 a.m.