Skip to contents

This function checks if the input is a proper covariance matrix, i.e. a symmetric, numeric matrix with non-negative eigenvalues.

Usage

is_covariance_matrix(x)

Arguments

x

A matrix.

Value

A boolean, TRUE if x is a proper covariance matrix.

Examples

x <- diag(2)
RprobitB:::is_covariance_matrix(x)
#> [1] TRUE