Shape · Statistics

Covariance Matrix

Works out the covariance of every pair of number columns, as a grid.

Also known as: Covariance

How it works

Columns limits the matrix; empty means every numeric column, and a chosen column that is missing or not numeric is skipped. Estimator is Sample by default (divides by n - 1) or Population (divides by n). The output has one row per column, labelled in a column column, and one column per column; the diagonal is each column's variance.

Inputs and outputs

Inputs

  • data — Table

Outputs

  • data — Table

Settings

The Attributes panel of Covariance Matrix, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
{
  columns: string[]
  sample: boolean
}

Example

Daily returns of three funds for a risk calculation: columns fund_a, fund_b, fund_c, estimator Sample. Feed the result to the next step or read the diagonal for each fund's variance.