Learn R Programming

stats4teaching (version 0.1.0)

is.corrmatrix: Correlation matrix

Description

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

Usage

is.corrmatrix(matrix)

Value

A logical value: True/False.

Arguments

matrix

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

Examples

Run this code

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

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

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

Run the code above in your browser using DataLab