Skip to contents

Returns the diagonal of the upper-triangular matrix R stored in an amChol object.

Usage

chol_diag(factor)

Arguments

factor

An amChol object from chol_factor.

Value

Numeric vector of length equal to the matrix dimension.

Examples

m <- crossprod(matrix(rnorm(16), 4, 4)) + diag(4)
A <- adgeMatrix(m)
fac <- chol_factor(A)
chol_diag(fac)
#> [1] 1.506345 2.063637 1.717509 1.056255