Skip to content

group_coancestry

Josh Fogg edited this page Jul 31, 2024 · 1 revision
group_coancestry(w, sigma)

A shortcut function for computing the group co-ancestry ($\mathbf{w}^{T}\Sigma\mathbf{w}$) of a particular selection of candidates ($\mathbf{w}$). This may be useful in situations where RobustOCS has been imported without NumPy.

Parameters

  • w : ndarray
    Portfolio vector $\mathbf{w}$ representing a particular selection.
  • sigma : ndarray
    Relationship matrixd $\Sigma$ for the cohort.

Returns

  • float
    The group co-ancestry of the selection.

Examples

Given some optimal contribution vector

>>> w
array([0.38225694, 0.38225694, 0.11774306, 0.11774306])

and some relationship matrix sigma, we can compute the group co-ancestry as

>>> robustocs.group_coancestry(w, sigma)
matrix([[0.3199676]])

or equivalently using NumPy as

>>> w.transpose() @ sigma @ w
matrix([[0.3199676]])