Wolfram Research

Function Repository Resource:

GeneralizedVariance

Source Notebook

Find the determinant of the covariance matrix

Contributed by: Wolfram Research

ResourceFunction["GeneralizedVariance"][matrix]

gives the generalized variance for matrix.

Details and Options

ResourceFunction["GeneralizedVariance"][matrix] effectively gives the determinant of the covariance matrix for matrix.
For numeric matrix, ResourceFunction["GeneralizedVariance"][matrix] is equal to Apply[Times,Variance[PrincipalComponents[matrix]]].

Examples

Basic Examples

Generalized variance of real-valued bivariate data:

In[1]:=
ResourceFunction[
  "GeneralizedVariance"][{{a, b}, {c, d}, {e, f}}] // ComplexExpand
Out[1]=

Properties and Relations

Generalized variance is equivalent to the determinant of the covariance matrix:

In[2]:=
ResourceFunction[
  "GeneralizedVariance"][{{1, 0}, {0, 2}, {3, 4}, {4, 2}}] == Det[Covariance[{{1, 0}, {0, 2}, {3, 4}, {4, 2}}]]
Out[2]=

Generalized variance is equal to the product of the principal component variances:

In[3]:=
ResourceFunction[
   "GeneralizedVariance"][{{1, 0}, {0, 2}, {3, 4}, {4, 2}}] == Apply[Times, Variance[
    PrincipalComponents[{{1, 0}, {0, 2}, {3, 4}, {4, 2}}]]] // Simplify
Out[3]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

See Also

License Information