ℓ1 Uncertainty Sets
PortfolioOptimisers.L1UncertaintySet Type
struct L1UncertaintySet{__T_eps, __T_sd} <: AbstractUncertaintySetResultThe set is CharacteristicUncertaintySet and consumed by ArithmeticReturn.
Fields
eps: Radius of theuncertainty set on the characteristic vector. Larger values admit more estimation error, and therefore activate more assets. sd: Per-asset scaling vector for theuncertainty set (the estimated standard deviations). nothingleaves the set unscaled, so every element of the characteristic vector is assumed to suffer the same estimation error.
Constructors
L1UncertaintySet(;
eps::Number,
sd::Option{<:VecNum} = nothing
) -> L1UncertaintySetKeywords correspond to the struct's fields.
Validation
isfinite(eps)andeps >= 0.If
sdis provided:!isempty(sd)andall(sd .> 0).
Mathematical definition
The worst case of a linear characteristic over the set collapses to a scaled infinity norm (Lemmas 1 and 8 of [2]):
Where:
: Estimated characteristic vector. : Radius of the set. : Per-asset scaling ( sd);when sdisnothing., : Element-wise product and division.
Because the right-hand side is concave and positively homogeneous, this is an LP once the infinity norm is epigraphed — no conic solver is needed.
Notes
This set bounds a mean/characteristic vector. It has no covariance analogue, so sigma_ucs is not defined for the estimator that produces it.
Related
PortfolioOptimisers.SignedL1UncertaintySet Type
struct SignedL1UncertaintySet{__T_ep, __T_en, __T_sd} <: AbstractUncertaintySetResultSigned
The set is
Fields
ep: Radius of the positive-error side of the signeduncertainty set. en: Radius of the negative-error side of the signeduncertainty set. sd: Per-asset scaling vector for theuncertainty set (the estimated standard deviations). nothingleaves the set unscaled, so every element of the characteristic vector is assumed to suffer the same estimation error.
Constructors
SignedL1UncertaintySet(;
ep::Number,
en::Number,
sd::Option{<:VecNum} = nothing
) -> SignedL1UncertaintySetKeywords correspond to the struct's fields.
Validation
isfinite(ep)andep >= 0.isfinite(en)anden >= 0.If
sdis provided:!isempty(sd)andall(sd .> 0).
Mathematical definition
Where:
, : Radii of the positive- and negative-error sides ( ep,en)., : Element-wise positive and negative parts.
Still concave and LP-representable, with one epigraph variable per sign.
Notes
This is not L1UncertaintySet with ep == en: the joint set shares one budget across both signs, giving
[2] introduces this set in order to decouple the long-short problem into two independent problems (its equations 27 and 28), which its Remark 12 then recombines only when the two legs happen to have complementary support. Modelling the worst case above directly keeps the problem coupled, so that caveat does not arise.
Related
sourcePortfolioOptimisers.L1UncertaintySetAlgorithm Type
struct L1UncertaintySetAlgorithm{__T_method, __T_scaled, __T_paired} <: AbstractUncertaintySetAlgorithmShape algorithm selecting a joint
Fields
method: Radius of theuncertainty set. A number is the radius itself; an AbstractUncertaintyEpsAlgorithmcomputes it from the data.scaled: Whether to scale the uncertainty set by the estimated standard deviations.falseassumes every characteristic suffers the same estimation error;trueassumes assets with larger variance suffer larger estimation error, which yields inverse-volatility weights.paired:paired: Whether to calibrate the radius against the paired (dollar-neutral) ladder rather than the long-only one. Inert whenmethodis a number.
Constructors
L1UncertaintySetAlgorithm(;
method::Num_UcSEps = ActiveAssetsUncertaintyAlgorithm(),
scaled::Bool = false,
paired::Bool = false
) -> L1UncertaintySetAlgorithmKeywords correspond to the struct's fields.
Validation
- If
methodis aNumber:isfinite(method)andmethod >= 0.
Details
scaled selects between the two uncertainty sets of [2]: false gives true gives
paired selects which closed form calibrates the radius when method is an AbstractUncertaintyEpsAlgorithm, and is inert when method is a number. The number of assets a radius activates depends on the sign structure of the problem it is used in, which an uncertainty set cannot observe, so the caller must say:
false: the long-only ladder, for a problem withw >= 0andbgt = 1(Corollaries 4 and 11 of [2]).true: the paired ladder, for a dollar-neutral problem withbgt = 0andsbgt = 1/2, where assets activate in long/short pairs (Corollary 7).
Using the wrong one mis-calibrates the radius; it does not make the optimisation incorrect.
Related
PortfolioOptimisers.SignedL1UncertaintySetAlgorithm Type
struct SignedL1UncertaintySetAlgorithm{__T_mp, __T_mm, __T_scaled} <: AbstractUncertaintySetAlgorithmShape algorithm selecting a signed
Fields
mp: Radius of the positive-error side. A number is the radius itself; anAbstractUncertaintyEpsAlgorithmcomputes it from the data.mm: Radius of the negative-error side. A number is the radius itself; anAbstractUncertaintyEpsAlgorithmcomputes it from the data.scaled: Whether to scale the uncertainty set by the estimated standard deviations.falseassumes every characteristic suffers the same estimation error;trueassumes assets with larger variance suffer larger estimation error, which yields inverse-volatility weights.
Constructors
SignedL1UncertaintySetAlgorithm(;
mp::Num_UcSEps = ActiveAssetsUncertaintyAlgorithm(),
mm::Num_UcSEps = ActiveAssetsUncertaintyAlgorithm(),
scaled::Bool = true
) -> SignedL1UncertaintySetAlgorithmKeywords correspond to the struct's fields.
Validation
- If
mp/mmis aNumber:isfiniteand>= 0.
Details
mp yields mm yields AbstractUncertaintyEpsAlgorithm the ladders are fixed by the paper's construction and need no paired flag:
Related
sourcePortfolioOptimisers.CharacteristicUncertaintySet Type
struct CharacteristicUncertaintySet{__T_pe, __T_alg} <: AbstractUncertaintySetEstimatorEstimator for
Fits the robust best-characteristic uncertainty sets of [2]. Maximising the worst-case characteristic over one of these sets recovers the heuristic MeanRisk instead:
MeanRisk(; r = NoRisk(), obj = MaximumReturn(),
opt = JuMPOptimiser(; slv = slv, bgt = 1.0,
ret = ArithmeticReturn(; ucs = CharacteristicUncertaintySet())))Fields
pe: Prior estimator.alg:alg: Shape algorithm —L1UncertaintySetAlgorithmorSignedL1UncertaintySetAlgorithm.
Constructors
CharacteristicUncertaintySet(;
pe::AbstractLowOrderPriorEstimator = EmpiricalPrior(),
alg::AbstractUncertaintySetAlgorithm = L1UncertaintySetAlgorithm()
) -> CharacteristicUncertaintySetKeywords correspond to the struct's fields.
Validation
algmust be anL1UncertaintySetAlgorithmor aSignedL1UncertaintySetAlgorithm.
Details
pe supplies both the characteristic vector scaled, the per-asset scaling
The characteristic need not be an expected return. [2] notes that any characteristic works, and the library already carries the machinery: a prior built on StandardDeviationExpectedReturns ranks on volatility (the Low Volatility factor), reproducing Table III of the paper.
Notes
This estimator is mean-only. ucs and sigma_ucs are defined solely to throw an informative error: the
Related
PortfolioOptimisers.ActiveAssetsUncertaintyAlgorithm Type
struct ActiveAssetsUncertaintyAlgorithm{__T_active} <: AbstractUncertaintyEpsAlgorithmRadius algorithm that calibrates the
Fields
active: Target number of active assets on the unconstrained problem, as a count (integer>= 1) or a fraction of the universe (float in(0, 1)). This is a radius calibration, not a cardinality constraint: it selects the radius that would activate this many assets subject only to the budget and sign constraints. Any further constraint may change the realised count. Usecardfor a hard cardinality constraint.
Constructors
ActiveAssetsUncertaintyAlgorithm(;
active::Union{<:Integer, <:AbstractFloat} = 0.2
) -> ActiveAssetsUncertaintyAlgorithmKeywords correspond to the struct's fields.
Validation
If
activeis anInteger:active >= 1.If
activeis anAbstractFloat:0 < active < 1.
Details
The radius
The map is exact, but only for the bare problem the closed forms assume: the budget and sign constraints, and nothing else. It is a radius calibration, not a cardinality constraint. Adding weight bounds, cardinality, or linear constraints may change the realised number of active assets, and this algorithm neither knows nor checks. For a hard bound on the number of holdings use the card field of JuMPOptimiser.
Related
sourcePortfolioOptimisers.l1_activation_ladder Function
l1_activation_ladder(mu::VecNum, sd::Option{<:VecNum})Return the vector g whose k-th entry is the radius at which the k-th asset becomes active in the long-only problem.
mu must be sorted in non-increasing order, with sd (when given) under the same permutation. Entry k is sd === nothing) or Lemma 9 (scaled) of [2]. The sequence is non-decreasing, so a radius eps activates the largest k with g[k] < eps.
Related
sourcePortfolioOptimisers.l1_active_count Function
l1_active_count(active::Union{<:Integer, <:AbstractFloat}, N::Int)Convert an active target — a count or a fraction of the universe — into an asset count in 1:N.
Related
sourcePortfolioOptimisers.l1_eps_from_ladder Function
l1_eps_from_ladder(method, ladder::VecNum, N::Int)Resolve a radius from a Num_UcSEps against an activation ladder.
A number passes through unchanged. An ActiveAssetsUncertaintyAlgorithm returns the midpoint of the open interval (ladder[q], ladder[q+1]) that the closed forms of [2] require for exactly q active entries; at the top of the ladder it continues the final increment by a half step, since any radius above ladder[end] activates everything.
Throws when the target interval is empty, which happens when the characteristic has ties across the cut — the paper excludes this case by assumption, and it cannot be satisfied.
Related
sourcePortfolioOptimisers.l1_resolve_eps Function
l1_resolve_eps(method, mus::VecNum, sds::Option{<:VecNum}, paired::Bool)Resolve a radius from a Num_UcSEps against the characteristic vector.
mus must be sorted in non-increasing order, with sds under the same permutation. A number passes through unchanged. An ActiveAssetsUncertaintyAlgorithm is calibrated against the long-only ladder when paired is false, and against the paired ladder — where the i-th best pairs with the i-th worst, so entries activate two assets at a time — when it is true.
Related
sourcePortfolioOptimisers.mu_ucs Function
mu_ucs(ue::CharacteristicUncertaintySet, X::MatNum,
F::Option{<:MatNum} = nothing; dims::Int = 1, kwargs...)Construct an
Computes the prior, takes scaled), then resolves the radius from the shape algorithm.
Arguments
ue: Characteristic uncertainty set estimator.X: Data matrix (e.g. returns).F: Optional factor matrix. Used by the prior estimator.dims: Dimension along which to perform the computation.kwargs...: Additional keyword arguments passed to the prior estimator.
Returns
mu_ucs::Union{<:L1UncertaintySet, <:SignedL1UncertaintySet}: The uncertainty set.
Related
sourcePortfolioOptimisers.ucs Function
ucs(ue::CharacteristicUncertaintySet, X::MatNum, F::Option{<:MatNum} = nothing; kwargs...)
sigma_ucs(ue::CharacteristicUncertaintySet, X::MatNum, F::Option{<:MatNum} = nothing; kwargs...)Always throw. CharacteristicUncertaintySet is mean-only.
The NormalUncertaintySet, DeltaUncertaintySet, or ARCHUncertaintySet for a covariance uncertainty set.
These take the same (X, F) signature as the rest of the family rather than a catch-all, so that the ReturnsResult forwarders in the base reach them without ambiguity.
Related
source