Intended to be broadly compatible with stats::sd()
and
stats::var()
.
If given real values, var()
and sd()
return the variance
and standard deviation as per ordinary real analysis. If given complex
values, returns the complex generalization in which Hermitian transposes
are used.
If z
is a complex matrix, var(z)
returns the variance of
the rows.
These functions use \(n-1\) on the denominator purely for consistency
with stats::var()
(for the record, I disagree with the rationale
for \(n-1\)).