OWA risk measures constraints: private API
PortfolioOptimisers.set_owa_constraints! — Function
set_owa_constraints!(
model::Model,
X::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}};
prefix
) -> Any
Set up the OWA portfolio returns variable and equality constraint.
Introduces a vector variable owa of length T and adds the equality constraint sc * (net_X - owa) == 0. Returns the existing owa if already present.
Arguments
model::JuMP.Model: The JuMP optimisation model.X::MatNum: Asset returns matrix (T × N).
Keyword arguments
prefix::Symbol: Model State namespace (default: empty, i.e. the bare key).
Returns
owa: JuMP vector variable of lengthTfor OWA portfolio returns.
Related
PortfolioOptimisers.SortingNetworkParts — Type
struct SortingNetworkParts{__T_z, __T_c_eq, __T_c_a, __T_c_b, __T_risk}The parts of a relaxed sorting network in a JuMP model: the network variable, its three blocks of rows and the OWA risk expression.
This type is an implementation detail and is not intended for direct use. set_sorting_network_owa! makes it, and the two sorting-network methods of set_risk_constraints! register each part in the Model State under the keys of their measure.
Fields
z:z: Vector variable of length2K, the two values that each of theKcomparators writes.
c_eq:c_eq: TheKequality rows, one for each comparator.
c_a:c_a: TheKrows that put the larger value of a comparator at or above its first input.
c_b:c_b: TheKrows that put the larger value of a comparator at or above its second input.
risk:risk: The OWA risk expression of the network.
Related
PortfolioOptimisers.set_sorting_network_owa! — Function
set_sorting_network_owa!(
model::Model,
alg::SortingNetworkOrderedWeightsArray,
X::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
owa_w::AbstractVector{<:Union{Number, AbstractJuMPScalar}};
prefix
) -> SortingNetworkParts{Vector{VariableRef}, __T_c_eq, __T_c_a, __T_c_b} where {__T_c_eq<:(ConstraintRef{Model, C} where C<:MathOptInterface.ConstraintIndex), __T_c_a<:(ConstraintRef{Model, C} where C<:MathOptInterface.ConstraintIndex), __T_c_b<:(ConstraintRef{Model, C} where C<:MathOptInterface.ConstraintIndex)}
Add the relaxed sorting network of a SortingNetworkOrderedWeightsArray to model, and return the OWA risk expression of the weight vector owa_w.
The network reads the owa variable of set_owa_constraints!, so the fees and the costs enter as they do for ExactOrderedWeightsArray. The inputs are divided by the largest absolute asset return and the risk is multiplied by it, which keeps the network values near one. The OWA risk is positively homogeneous, so the scale does not change it.
JuMP formulation
z: Vector variable of length2K, the two values that each of theKcomparators writes, in the columns thatalg.orderinggives.c_eq: TheKrowssc * (z_l + z_h - z_a - z_b) == 0, where comparatorkreadsz_aandz_b, and writes the smaller valuez_land the larger valuez_h.c_a,c_b: TheKrowssc * (z_h - z_a) >= 0and theKrowssc * (z_h - z_b) >= 0.risk: The expressions * dot(owa_w, z_out), wherez_outholds the last value that the network writes to each position, in ascending position, andsis the largest absolute asset return.
Arguments
model::JuMP.Model: The JuMP optimisation model.alg: The sorting-network formulation.pr::AbstractPriorResult: Prior result containing the returns matrixX.owa_w: Nondecreasing OWA weight vector of lengthT.
Validation
issorted(owa_w), throughassert_owa_formulation_weights. Raises aDomainError.
Keyword arguments
prefix::Symbol: Model State namespace (default: empty, i.e. the bare key).
Returns
net::SortingNetworkParts: The network variable, the three blocks of rows and the risk expression, which the caller registers.
Related
SortingNetworkOrderedWeightsArraySortingNetworkPartssorting_networksorting_network_columnsset_owa_constraints!
References
- [212] M. X. Goemans. Smallest compact formulation for the permutahedron. Mathematical Programming 153, 5–11 (2015).
References
- [212]
- M. X. Goemans. Smallest compact formulation for the permutahedron. Mathematical Programming 153, 5–11 (2015).