Ordered Weights Array (a): private API

PortfolioOptimisers.AbstractOrderedWeightsArrayEstimator — Type
abstract type AbstractOrderedWeightsArrayEstimator <: AbstractEstimator

Abstract supertype for all Ordered Weights Array (OWA) estimator types.

All concrete and/or abstract types implementing OWA estimation algorithms should be subtypes of AbstractOrderedWeightsArrayEstimator.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.AbstractOrderedWeightsArrayAlgorithm — Type
abstract type AbstractOrderedWeightsArrayAlgorithm <: AbstractAlgorithm

Abstract supertype for all Ordered Weights Array (OWA) algorithm types.

All concrete and/or abstract types implementing specific OWA algorithms should be subtypes of AbstractOrderedWeightsArrayAlgorithm.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.SquaredOrderedWeightsArrayAlgorithm — Type
abstract type SquaredOrderedWeightsArrayAlgorithm{T} <: AbstractOrderedWeightsArrayAlgorithm

Abstract supertype for squared OWA weight optimisation algorithms.

Subtypes find OWA weights by minimising a squared-distance or squared-sum objective subject to OWA constraints, and are parameterised by the optimisation algorithm type T.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.OrderedWeightsArrayFormulation — Type
abstract type OrderedWeightsArrayFormulation <: AbstractAlgorithm

Abstract supertype for ordered weights array (OWA) formulation types.

Determines whether OWA weights are computed exactly or approximately.

Related

References

  • [136] W. Ogryczak and T. Śliwiński. On solving linear programs with the ordered weighted averaging objective. European Journal of Operational Research 148, 80–91 (2003).
  • [133] D. Cajas. OWA portfolio optimization: A disciplined convex programming framework. Available at SSRN 3988927 (2021).
  • [134] D. Cajas. Efficient Gini Mean Difference and Tail Gini Portfolio Optimization based on P-Norms. Available at SSRN 4711326 (2024).
  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.1.5.
source
PortfolioOptimisers.OWA_RevFunc — Type
const OWA_RevFunc = ComposedFunction{typeof(reverse),
                                     <:AbstractOrderedWeightsArrayFunction}

The reversal of an ordered-weights builder, which is what OrderedWeightsArrayRange stores in w2 under the approximate formulation.

It is a Function and it computes no quantity, so it is the one occupant of a weight slot that a reader of the calibration channel must part from a Calibration Rule. The name is written once here, because the type is long and three sites read it.

Related

source
PortfolioOptimisers.OWA_CalOccupant — Type
const OWA_CalOccupant = Union{<:AbstractOrderedWeightsArrayFunction, <:OWA_RevFunc}

The occupants of an OrderedWeightsArray weight slot that carry a calibration slot of their own: a weight builder, and the reversal of one that the Range container builds.

The slot also takes a weight vector and a caller's own plain function, and neither carries a slot. Neither is therefore named in calibration_slots, and the distinction matters because a plain function standing in a calibration slot is a Calibration Rule everywhere else in the library. The rule is what resolve_calibration_slot calls and what assert_calibrated_slots refuses, so a weight builder written as a plain function must not reach either.

Related

source
PortfolioOptimisers.owa_l_moment_crm_sumsq_obj — Function
owa_l_moment_crm_sumsq_obj(method::OWAJuMP{<:Any, <:Any, <:Any, <:Any,
                                           <:SquaredOrderedWeightsArrayAlgorithm},
                           model::JuMP.Model)

Set the minimisation objective of a SquaredOrderedWeightsArrayAlgorithm OWA problem on model.

The caller adds the cone constraint that relates the scalar variable t to the quantity being minimised. This method only sets the objective, and it dispatches on the SecondMomentFormulation that parameterises method.alg. It does not solve the model.

Arguments

Returns

  • The objective function set on model. The model is modified in place.

Details

  • Under SOCRiskExpr or RSOCRiskExpr the objective is so * t.
  • Under SquaredSOCRiskExpr the objective is so * t^2, because the caller's cone bounds t below by a norm rather than by its square.
  • All three encodings share the same minimiser, so they return the same OWA weights to solver tolerance.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.ncrra_weights — Function
ncrra_weights(weights::MatNum, g::Number = 0.5)

Compute normalised constant relative risk aversion (CRRA) Ordered Weights Array (OWA) weights.

This function generates OWA weights using a normalised CRRA scheme, parameterised by g. The CRRA approach interpolates between risk-neutral and risk-averse weighting profiles, controlled by the risk aversion parameter g.

It is the risk aversion coefficients that are normalised to sum to one, not the returned OWA weights. The returned vector is a combination of the columns of weights, so its sum is the same combination of their column sums.

Arguments

  • weights: Matrix of weights (typically order statistics or moment weights).
  • g: Risk aversion parameter.

Validation

  • 0 < g < 1.

Returns

  • w::VecNum: Vector of OWA weights of length size(weights, 1).

Details

The function computes the OWA weights as follows:

  1. For each order statistic, recursively compute the CRRA weight using the formula:

    e *= g + i - 1 phis[i] = e / factorial(i + 1)

  2. The vector phis is normalised to sum to one.

  3. The final OWA weights are computed as a weighted sum of the input weights and phis, with monotonicity enforced by taking the maximum up to each index.

Examples

julia> w = [1.0 0.5; 0.5 1.0]2×2 Matrix{Float64}: 1.0  0.5 0.5  1.0julia> PortfolioOptimisers.ncrra_weights(w, 0.5)2-element Vector{Float64}: 0.8333333333333333 0.8333333333333333

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.owa_model_setup — Function
owa_model_setup(method::OWAJuMP, weights::MatNum)

Construct a JuMP model for Ordered Weights Array (OWA) weight estimation.

This function sets up a JuMP optimization model for OWA weights, given an OWAJuMP estimator and a matrix of weights (e.g., order statistics or moment weights). The model includes variables for the OWA weights (phi) and auxiliary variables (theta), and enforces constraints for non-negativity, upper bounds, sum-to-one, monotonicity, and consistency with the input weights.

Arguments

  • method: OWA estimator containing solver, scaling, and algorithm configuration.
  • weights: Matrix of weights (typically order statistics or moment weights).

Returns

  • model::JuMP.Model: Configured JuMP model with variables and constraints for OWA weight estimation.

Constraints

  • phi (OWA weights) are non-negative and bounded above by max_phi.
  • The sum of phi is 1.
  • theta is constrained to be equal to the weighted sum of the input weights and phi.
  • Monotonicity is enforced on phi and theta.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.owa_model_solve — Function
owa_model_solve(model::JuMP.Model, method::OWAJuMP, weights::MatNum)

Solve a JuMP model for OWA weight estimation and extract the resulting OWA weights.

This function solves the provided JuMP model using the solver(s) specified in the OWAJuMP estimator. If the optimization is successful, it reads the OWA weights off the model's theta variable, which owa_model_setup has already constrained to equal weights * phi. If the optimization fails, a warning is issued and a fallback to ncrra_weights is used.

Arguments

  • model: JuMP model for OWA weight estimation.
  • method: OWA estimator containing solver configuration.
  • weights: Matrix of weights (typically order statistics or moment weights).

Returns

  • w::VecNum: Vector of OWA weights of length size(weights, 1).

Details

  • If the solver succeeds, the solution is the value of the model's theta variable. It is the risk aversion coefficients phi that the model constrains to sum to one, not theta.
  • If the solver fails, a warning is issued and the fallback ncrra_weights(weights, 0.5) is returned. The model is infeasible when T is too small for the monotonicity constraint on theta, so this fallback is the ordinary path for a short sample.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source
PortfolioOptimisers.owa_l_moment_crm_entropy — Function
owa_l_moment_crm_entropy(method::OWAJuMP{<:Any, <:Any, <:Any, <:Any, <:MaximumEntropy},
                         model::JuMP.Model)

Add the entropy objective of the MaximumEntropy OWA problem to model.

The method dispatches on the EntropyFormulation held in method.alg.alg. It reads the model's x variable, adds the auxiliary variables and cone constraints that encode $-\sum_{t} x_{t} \log(x_{t})$, and sets the maximisation objective. It does not solve the model.

Arguments

  • method: OWA estimator whose alg is a MaximumEntropy. Its sc and so fields scale the constraints and the objective.
  • model::JuMP.Model: Model built by owa_model_setup, already carrying the x variable.

Returns

  • nothing. The model is modified in place.

Details

  • Under RelativeEntropy, one JuMP.MOI.RelativeEntropyCone of dimension 2T + 1 bounds a scalar t below by $\sum_{t} x_{t} \log(x_{t})$, and the objective maximises -t.
  • Under ExponentialConeEntropy, T separate JuMP.MOI.ExponentialCone constraints bound each t[i] above by $-x_{i} \log(x_{i})$, and the objective maximises sum(t).
  • Both formulations attain the same OWA weights to solver tolerance.

Related

References

  • [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
source

References

[5]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
[133]
D. Cajas. OWA portfolio optimization: A disciplined convex programming framework. Available at SSRN 3988927 (2021).
[134]
D. Cajas. Efficient Gini Mean Difference and Tail Gini Portfolio Optimization based on P-Norms. Available at SSRN 4711326 (2024).
[135]
D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
[136]
W. Ogryczak and T. Śliwiński. On solving linear programs with the ordered weighted averaging objective. European Journal of Operational Research 148, 80–91 (2003).