Threshold constraint generation: private API

PortfolioOptimisers.BtE_Bt — Type
const BtE_Bt = Union{Threshold, ThresholdEstimator}

Alias for a threshold constraint result or estimator.

Matches a Threshold or a ThresholdEstimator.

A caller can write a threshold in either form, so an optimiser field must accept both. A Threshold needs no universe, and a ThresholdEstimator resolves against a universe. threshold_constraints resolves the estimator to a Threshold, and returns a Threshold unchanged. One call gives a Threshold for either form. This alias does not match nothing or a vector. VecOptBtE_Bt and BtE_Bt_VecOptBtE_Bt add those two cases.

Related

source
PortfolioOptimisers.VecOptBtE_Bt — Type
const VecOptBtE_Bt = AbstractVector{<:Option{<:BtE_Bt}}

Alias for a vector of optional threshold estimators or results.

Each entry is a Threshold, a ThresholdEstimator or nothing.

The routing targets of a threshold are positional lists. :slt, :sst, :sglt and :sgst are in the set of targets that accumulate. Entry i of such a list belongs to scenario or group block i, and pairs with scard or sgcarde. A block with no threshold is nothing in the list. If the list dropped it, every later block moves by one. Thus the element type includes nothing, and threshold_constraints has a method for this alias, but RkbE_Rkb needs neither.

Related

source
PortfolioOptimisers.BtE_Bt_VecOptBtE_Bt — Type
const BtE_Bt_VecOptBtE_Bt = Union{BtE_Bt, VecOptBtE_Bt}

Alias for a single or vector of optional threshold estimators or results.

Matches one BtE_Bt or a vector of optional BtE_Bt entries.

One optimiser field accepts both shapes. The plain targets :lt and :st hold one threshold over the whole universe. The scenario targets :slt, :sst, :sglt and :sgst hold one threshold for each block. A field of this type accepts either shape, so the optimiser needs no second field. threshold_constraints has a method for each of the two types of the union.

Related

source
PortfolioOptimisers.VecOptBt — Type
const VecOptBt = AbstractVector{<:Option{<:Threshold}}

Alias for a vector of optional threshold results.

Each entry is a Threshold or nothing.

This alias is the resolved form of VecOptBtE_Bt. The broadcast method of threshold_constraints returns it, and the mixed-integer builders read it. A builder indexes the list by block, and needs a Threshold or nothing at each entry. A builder types its argument on Bt_VecOptBt, which contains this alias, so it refuses a list that holds an estimator.

Related

source
PortfolioOptimisers.Bt_VecOptBt — Type
const Bt_VecOptBt = Union{Threshold, VecOptBt}

Alias for a single threshold result or a vector of optional threshold results.

Matches one Threshold or a vector of optional Threshold entries.

This alias is the resolved form of BtE_Bt_VecOptBtE_Bt. A mixed-integer builder takes one threshold over the whole universe, or one threshold for each scenario block. This alias matches those two shapes after the resolution. It does not match an estimator, so a builder that types an argument on it accepts only resolved thresholds.

Related

source