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 (1) 

GeneralizedVariance of real-valued bivariate data:

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

Properties & Relations (2) 

GeneralizedVariance 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]=

GeneralizedVariance 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

Version History

  • 1.0.0 – 20 February 2019

Related Resources

License Information