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
- Resolve every field that
online_fieldsnames withupdate_online_estimator, givingrepl. - Resolve
pe.pewithupdate_online_estimator, which recurses through a wrapping prior. - Rebuild the prior from
repland the resolvedpe.pe, the second taking precedence forpe, and return it.
Arguments
pe: The wrapping prior.
Returns
pe: The prior, with every wrapper under its embedded prior resolved.
Related