posdef: Find nearest positive definite matrix

View source: R/rhomatrix.R

posdefR Documentation

Find nearest positive definite matrix

Description

If the output matrix from getrhomatrix is not positive definite, this will find an approximate matrix that is using Matrix::nearPD() with corr=TRUE.

Usage

posdef(mat)

Arguments

mat

A symmetrical square matrix with 1's on diagonal.

Value

An approximate version of mat that is positive definite. Row and column names are retained.

See Also

getrhomatrix


tanyalrogers/GPEDM documentation built on June 1, 2025, 8:10 p.m.