Skip to content

expected_genetic_merit

Josh Fogg edited this page Jul 31, 2024 · 1 revision
expected_genetic_merit(w, mu)

A shortcut function for computing the expected genetic merit ($\mathbf{w}^{T}\boldsymbol\mu$) 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.
  • mu : ndarray
    Vector of expected breeding values $\boldsymbol\mu$ for the cohort.

Returns

  • float
    The expected genetic merit of the selection.

Examples

Given some optimal contribution vector

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

and some relationship matrix

>>> mu
array([1., 1., 2., 2.])

then we can compute the expected genetic merit as

>>> robustocs.expected_genetic_merit(w, mu)
1.2354861108597817

or equivalently using NumPy as

>>> w.transpose() @ mu
1.2354861108597817