Skip to contents

Convert parameter vector par (upper triangular part of Gamma/Theta matrix) to full Gamma/Theta, or vice versa.

Usage

par2Matrix(par, allowMatrix = FALSE, allowNull = FALSE, zeroRowSums = FALSE)

par2Gamma(par, allowMatrix = FALSE, allowNull = FALSE)

par2Theta(par, allowMatrix = FALSE, allowNull = FALSE)

matrix2par(M, allowVector = FALSE, allowNull = FALSE)

Arguments

par

Numeric vector with d elements. Upper triangular part of a Gamma/Theta matrix.

allowMatrix

If TRUE and par is already a matrix, return it as is.

allowNull

If TRUE and par is NULL, return NULL.

zeroRowSums

If TRUE the diagonal is set to (-1) times the rowSums.

M

Matrix

allowVector

If TRUE and M is already a vector, return it as is.

Value

Numeric matrix \(d \times d\). Full Gamma/Theta matrix corresponding to par.

Upper triangular part of M (or M itself/NULL if allowed)

See also

Other parameter matrix transformations: Gamma2Sigma(), Gamma2graph(), chi2Gamma()