Ordered Weights Array (a): private API
PortfolioOptimisers.AbstractOrderedWeightsArrayEstimator — Type
abstract type AbstractOrderedWeightsArrayEstimator <: AbstractEstimatorAbstract 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).
PortfolioOptimisers.AbstractOrderedWeightsArrayAlgorithm — Type
abstract type AbstractOrderedWeightsArrayAlgorithm <: AbstractAlgorithmAbstract 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).
PortfolioOptimisers.SquaredOrderedWeightsArrayAlgorithm — Type
abstract type SquaredOrderedWeightsArrayAlgorithm{T} <: AbstractOrderedWeightsArrayAlgorithmAbstract 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).
PortfolioOptimisers.UnionAllSOCRiskExpr — Type
const UnionAllSOCRiskExpr = Union{<:SquaredSOCRiskExpr, <:RSOCRiskExpr, <:SOCRiskExpr}Union of all second-order cone risk expression formulation types.
Related
PortfolioOptimisers.UnionSOCRiskExpr — Type
const UnionSOCRiskExpr = Union{<:SquaredSOCRiskExpr, <:SOCRiskExpr}Union of squared and plain SOC risk expression formulation types (excludes RSOC).
Related
PortfolioOptimisers.UnionRSOCSOCRiskExpr — Type
const UnionRSOCSOCRiskExpr = Union{<:RSOCRiskExpr, <:SOCRiskExpr}Union of RSOC and plain SOC risk expression formulation types (excludes squared SOC).
Related
PortfolioOptimisers.EntropyFormulation — Type
abstract type EntropyFormulation <: AbstractAlgorithmAbstract supertype for entropy formulations used in the MaximumEntropy OWA algorithm.
Related
References
- [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
PortfolioOptimisers.OWA_Func_VecNum — Type
const OWA_Func_VecNum = Union{<:Func_VecNum, <:AbstractOrderedWeightsArrayFunction}Union type for OWA weight specifications: a function, a numeric vector, or an AbstractOrderedWeightsArrayFunction callable.
Related
PortfolioOptimisers.OrderedWeightsArrayFormulation — Type
abstract type OrderedWeightsArrayFormulation <: AbstractAlgorithmAbstract 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.
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
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
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
method: OWA estimator whosealgis aMinimumSquaredDistanceor aMinimumSumSquares. Itssofield scales the objective.model::JuMP.Model: Model built byowa_model_setup, already carrying thetvariable and its cone constraint.
Returns
- The objective function set on
model. The model is modified in place.
Details
- Under
SOCRiskExprorRSOCRiskExprthe objective isso * t. - Under
SquaredSOCRiskExprthe objective isso * t^2, because the caller's cone boundstbelow 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
MinimumSquaredDistanceMinimumSumSquaresSquaredOrderedWeightsArrayAlgorithmowa_model_setupowa_l_moment_crmowa_l_moment_crm_entropy
References
- [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
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 lengthsize(weights, 1).
Details
The function computes the OWA weights as follows:
For each order statistic, recursively compute the CRRA weight using the formula:
e *= g + i - 1 phis[i] = e / factorial(i + 1)
The vector
phisis normalised to sum to one.The final OWA weights are computed as a weighted sum of the input
weightsandphis, 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.8333333333333333Related
References
- [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
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 bymax_phi.- The sum of
phiis 1. thetais constrained to be equal to the weighted sum of the input weights andphi.- Monotonicity is enforced on
phiandtheta.
Related
References
- [135] D. Cajas. Higher order moment portfolio optimization with L-moments. Available at SSRN 4393155 (2023).
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 lengthsize(weights, 1).
Details
- If the solver succeeds, the solution is the value of the model's
thetavariable. It is the risk aversion coefficientsphithat the model constrains to sum to one, nottheta. - If the solver fails, a warning is issued and the fallback
ncrra_weights(weights, 0.5)is returned. The model is infeasible whenTis too small for the monotonicity constraint ontheta, 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).
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 whosealgis aMaximumEntropy. Itsscandsofields scale the constraints and the objective.model::JuMP.Model: Model built byowa_model_setup, already carrying thexvariable.
Returns
nothing. The model is modified in place.
Details
- Under
RelativeEntropy, oneJuMP.MOI.RelativeEntropyConeof dimension2T + 1bounds a scalartbelow by $\sum_{t} x_{t} \log(x_{t})$, and the objective maximises-t. - Under
ExponentialConeEntropy,TseparateJuMP.MOI.ExponentialConeconstraints bound eacht[i]above by $-x_{i} \log(x_{i})$, and the objective maximisessum(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).
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).