chol2symm: Cholesky Factor to Symmetric Matrix

View source: R/chol2symm.R

chol2symmR Documentation

Cholesky Factor to Symmetric Matrix

Description

Evaluate ⁠t(x) \%*\% x⁠ efficiently, where x is the (upper-triangular) Cholesky factor of a symmetric, positive definite square matrix. I.e. it is the inverse of chol.

Usage

chol2symm(x)

Arguments

x

a square, upper triangular matrix representing the Cholesky factor of a symmetric, positive definite square matrix

Value

A symmetric, positive-definite matrix or greta_array.

Examples

# a symmetric, positive definite square matrix
y <- rWishart(1, 4, diag(3))[, , 1]
y
u <- chol(y)
u
chol2symm(u)
identical(y, chol2symm(u))
identical(chol2symm(u), t(u) %*% u)
## Not run: 
u_greta <- cholesky_variable(3)
y_greta <- chol2symm(u)

## End(Not run)

greta documentation built on July 20, 2026, 5:09 p.m.