Learn R Programming

phylopairs (version 0.1.0)

covmat.check: covmat.check

Description

Tets for validity of a covariance matrix based on four conditions: symmetry, diagonal dominance, positive definiteness, and positive variance.

Usage

covmat.check(mat)

Value

A data.frame containing logical "TRUE" or "FALSE" for each condition.

Arguments

mat

A putative covariance matrix.

Details

A valid covariance matrix must be symmetric, diagonally dominant (largest values in each row are on the diagonal), positive definite, and have positive variance. covmat.check takes a matrix as input and tests for these four conditions.

Examples

Run this code
# Load sample covariance matrix
data(sim.cov.pairs)
# Test for validity
covmat.check(sim.cov.pairs)

Run the code above in your browser using DataLab