Learn R Programming

stremo (version 0.2)

is.hermitian: Check if a matrix is Hermitian.

Description

This function checks if a matrix is Hermitian, that is, if its below and above diagonal elements are equal.

Usage

is.hermitian(covmat)

Arguments

covmat
A square matrix.

Value

TRUE or FALSE.

See Also

is.pd to check if a matrix is positive-definite and is.within.bounds to check whether all covariances in a covariance matrix are within boundaries.

Examples

Run this code
data(stiles)
st.cov <- cov(stiles[-1])
is.hermitian(st.cov) # TRUE
st.cov[5,3] <- 10
is.hermitian(st.cov) # FALSE

Run the code above in your browser using DataLab