Weight finalisers: private API

PortfolioOptimisers.finalise_weight_bounds — Function
finalise_weight_bounds(wf::WeightFinaliser, wb::WeightBounds, w::VecNum)

Apply weight finalisation to enforce bounds and determine the optimisation return code.

Runs opt_weight_bounds with the given finaliser and bounds. The return code is an OptimisationSuccess if the weights are finite, lie in the bounds and keep the budget of the input, each to a tolerance (weights_meet_bounds), and an OptimisationFailure otherwise. A failure lets the fallback chain run.

A bound set that cannot hold the budget, Σ lb > sum(w) or Σ ub < sum(w), always fails.

Arguments

  • wf::WeightFinaliser: Weight finaliser algorithm.
  • wb::WeightBounds: Weight bounds configuration.
  • w::VecNum: Portfolio weights to finalise.

Returns

  • (retcode, w): Tuple of return code and adjusted weights.

Related

source