is.covmatrix {stats4teaching}R Documentation

Covariance matrix

Description

Checks if a given matrix is a covariance matrix for non-degenerate distributions.

Usage

is.covmatrix(matrix)

Arguments

matrix

a (non-empty) numeric matrix of data values.

Value

A logical value: True/False.

Examples


m1 <- matrix(c(2,1.5,1.5,1), nrow = 2, byrow = TRUE)
is.covmatrix(m1)

m2 <- matrix(c(1,0.8,0.8,1), nrow = 2, byrow = TRUE)
is.covmatrix(m2)

m3 <- matrix(c(1,0.7,0.8,1), nrow = 2, byrow = TRUE)
is.covmatrix(m3)


[Package stats4teaching version 0.1.0 Index]