Prior partial fit (b): private API

PortfolioOptimisers.update_online_estimator — Method
update_online_estimator(pe::Union{HighOrderPriorEstimator, BlackLittermanPrior})

Resolves the Online declarations under the prior that a wrapping prior embeds, at warm-up.

The generic method scans the fields of the wrapping prior alone, and a wrapping prior holds its embedded prior in its own pe field, so the wrapping prior defines the recursion itself. HighOrderPriorEstimator(; pe = BlackLittermanPrior(; pe = Online(EmpiricalPrior()), ...)) resolves through this method. The generic scan of the own fields of the wrapping prior finds no wrapper there, because pe holds a plain prior, so the generic method would leave the wrapper two levels down unseeded. A wrapper in the own pe of the wrapping prior, as in HighOrderPriorEstimator(; pe = Online(EmpiricalPrior())), is seeded the same way, because the recursion meets it at the first level. The generic method still scans the co-moments of a HighOrderPriorEstimator.

Algorithm

  1. Resolve every field that online_fields names with update_online_estimator, giving repl.
  2. Resolve pe.pe with update_online_estimator, which recurses through a wrapping prior.
  3. Rebuild the prior from repl and the resolved pe.pe, the second taking precedence for pe, and return it.

Arguments

  • pe: The wrapping prior.

Returns

  • pe: The prior, with every wrapper under its embedded prior resolved.

Related

source