Orthogonal Uncertainty Sets

PortfolioOptimisers.AbstractOrthogonalScaling — Type
abstract type AbstractOrthogonalScaling <: AbstractAlgorithm

Abstract supertype of the scalings that size each direction inside the Orthogonal Subspace.

A member states the $r \times r$ matrix $\mathbf{\Lambda}$ of the mean set, and the square root of that matrix maps the coordinates of the ball onto the basis of the subspace. Every member confines the set to the same subspace, so a scaling changes the shape of the set alone, and the radius reads the same $r$ degrees of freedom under each member. nothing in the place of a member scales no direction, so $\mathbf{\Lambda} = \mathbf{I}_{r}$.

Interfaces

orthogonal_scaling

  • orthogonal_scaling(scaling::AbstractOrthogonalScaling, G::MatNum, rr::AbstractLoadingsRegressionResult) -> MatNum: Returns $\mathbf{\Lambda}$, $r \times r$, symmetric and positive semi-definite.

Related

source
PortfolioOptimisers.AbstractOrthogonalityMetric — Type
abstract type AbstractOrthogonalityMetric <: AbstractAlgorithm

Abstract supertype of the cross-sectional weightings that name a weight source on a fitted loadings block.

A member of this family selects a weight vector that a fitted loadings block already carries. It computes no weights. The library uses such a family of marker types for a fixed choice among stored quantities, as the class field of NormBallUncertaintySet does. The sibling family AbstractCrossSectionalWeightsAlgorithm computes the cross-sectional weights in the fit of the prior. This family names the output of that fit that a reader reads.

Two readers resolve a member to two different shapes, both from the same field of the block. orthogonality_weights reads the weights of the latest observation, one entry per asset. An uncertainty set reads them, because it applies to the next decision. cs_diagnostic_weights reads the whole observation history, one row per observation, for a diagnostic that scores every observation and not only the latest.

nothing in the place of a member names no weight source, so every asset carries the same weight. It reads nothing from the loadings block, so it serves a block that carries neither a weight history nor an idiosyncratic variance. Both readers return nothing for it, and their caller takes nothing as a vector of ones.

Interfaces

orthogonality_weights

  • orthogonality_weights(metric::AbstractOrthogonalityMetric, rr::AbstractLoadingsRegressionResult) -> VecNum: Returns the weights of the latest observation.

cs_diagnostic_weights

  • cs_diagnostic_weights(metric::AbstractOrthogonalityMetric, csfm::CrossSectionalFactorModel) -> MatNum: Returns the whole observation history the member names.

Related

source
PortfolioOptimisers.BenchmarkWeightMetric — Type
struct BenchmarkWeightMetric <: AbstractOrthogonalityMetric

Names the benchmark weights as the cross-sectional weight source.

The bw field of a block carries the benchmark weight of every asset at every observation. A reader takes the latest row for an uncertainty set, or the whole history for a diagnostic. A block fitted per asset over the observations has no such field, and the reader refuses it.

The metric needs every investable asset in the latest fit. An asset can be in the Investable Mask and outside the estimation universe of the latest cross-section. Its return is finite, so the prior states a moment for it. But the fit drops the asset, so its benchmark weight is zero there.

A zero weight has no inverse, so an uncertainty set on this metric refuses the block. On a point-in-time Asset Panel whose latest cross-section does not cover the whole Investable Mask, use InverseIdiosyncraticVarianceMetric or nothing, which read no weight history.

Examples

julia> BenchmarkWeightMetric()BenchmarkWeightMetric()

Related

source
PortfolioOptimisers.RegressionWeightMetric — Type
struct RegressionWeightMetric <: AbstractOrthogonalityMetric

Names the regression weights as the cross-sectional weight source.

The rw field of a block carries the weight that the Cross-Sectional Regression gave every asset at every observation. A reader takes the latest row for an uncertainty set, or the whole history for a diagnostic. A block fitted per asset over the observations has no such field, and the reader refuses it.

The metric needs every investable asset in the latest fit. An asset can be in the Investable Mask and outside the estimation universe of the latest cross-section. Its return is finite, so the prior states a moment for it. But the fit drops the asset, so its regression weight is zero there.

A zero weight has no inverse, so an uncertainty set on this metric refuses the block. On a point-in-time Asset Panel whose latest cross-section does not cover the whole Investable Mask, use InverseIdiosyncraticVarianceMetric or nothing, which read no weight history.

Examples

julia> RegressionWeightMetric()RegressionWeightMetric()

Related

source
PortfolioOptimisers.InverseIdiosyncraticVarianceMetric — Type
struct InverseIdiosyncraticVarianceMetric <: AbstractOrthogonalityMetric

Names the inverse of the idiosyncratic variances as the cross-sectional weight source.

It is the default metric of OrthogonalUncertaintySet. An asset whose returns the factors explain well has a small idiosyncratic variance, and so a large weight. idiosyncratic_variances reads the variances from the esigma field of the loadings block. orthogonality_weights refuses a variance that is not finite or not positive.

Examples

julia> InverseIdiosyncraticVarianceMetric()InverseIdiosyncraticVarianceMetric()

Related

source
PortfolioOptimisers.IdiosyncraticVarianceScaling — Type
struct IdiosyncraticVarianceScaling <: AbstractOrthogonalScaling

Sizes each direction of the Orthogonal Subspace by the idiosyncratic covariance projected onto it.

A direction that the factors leave noisy gets more uncertainty than a quiet one, where the default scaling = nothing gives both the same. The loadings block must carry an idiosyncratic covariance, and a block whose esigma is unset refuses.

Mathematical definition

\[\begin{align} \mathbf{\Lambda} &= \mathbf{G}^{\intercal}\mathbf{D}\mathbf{G}\,. \end{align}\]

Where:

  • $\mathbf{\Lambda}$: Scaling of the mean set inside the Orthogonal Subspace, $r \times r$, symmetric and positive semi-definite.
  • $\mathbf{G}$: Basis of the Orthogonal Subspace, $N \times r$, with orthonormal columns.
  • $\mathbf{D}$: Covariance of the idiosyncratic returns that the loadings block carries, $N \times N$. It is diagonal when the block stores a variance vector.

Algorithm

The branch of orthogonal_scaling that this tag selects runs these steps.

  1. Read D, the idiosyncratic covariance of rr. A stored matrix is read whole, with its off-diagonal entries. A stored variance vector is read as a LinearAlgebra.Diagonal, so the $N \times N$ matrix is never materialised. An unset esigma refuses through idiosyncratic_variances.
  2. Form lambda by the definition above.
  3. Return the symmetric part of lambda. The product carries a round-off asymmetry, and the caller's square root reads a symmetric matrix.

Examples

julia> IdiosyncraticVarianceScaling()IdiosyncraticVarianceScaling()

Related

source
PortfolioOptimisers.OrthogonalUncertaintySet — Type
struct OrthogonalUncertaintySet{__T_q, __T_method, __T_scaling, __T_kappa, __T_metric, __T_mtx_sqrt} <: AbstractPriorUncertaintySetEstimator

Fits both uncertainty sets from the factor model of the optimisation's own prior, confined to the directions the factors do not span.

The estimator reads the loadings block rr of the Prior Result it receives, and never fits a prior of its own. It is the one member of AbstractPriorUncertaintySetEstimator. The two JuMP builders pass the reduced prior beside the returns, so the sets and the moments they correct come from one object.

One fit serves both axes. ucs takes the weighted factor span once and returns a NormBallUncertaintySet on the mean axis, whose geometry map spans the Orthogonal Subspace, and a CompactCovarianceUncertaintySet on the covariance axis, whose basis is the weighted factor span. The two sets spare the same portfolios, and # Mathematical definition states which.

The point estimates stay as the prior states them. The mean set is centred on pr.mu and the covariance set carries pr.sigma, so the prior is not shrunk. The correction is a worst case that grows with the exposure of the portfolio to the Orthogonal Subspace, and it counters an optimiser that over-allocates to the directions the factors do not span.

The pair of sets is this library's construction. Section 3 of [184] shows that an optimiser over-weights the component of the characteristic that the factors do not span. Section 5 of that work adds one factor along that component to the risk model, the Alpha Alignment Factor of [185]. The covariance set extends that penalty to every direction the factors do not span. The mean set is a flat ellipsoid in the sense of Equation 14 of [173], confined to the same subspace.

Inside a cluster of a hierarchical optimiser, the two routes give different sets on purpose. The estimator refits on the viewed prior, so it takes the factor span of the cluster's own loadings and sizes its radius on that span. A pair of sets fitted before is viewed instead, and each view is the projection of its set: the worst case of a cluster portfolio as a portfolio of the full universe, with the radius of the full set. The two views still spare the same portfolios.

Mathematical definition

\[\begin{align} \mathbf{Q}\mathbf{Q}^{\intercal} &= \mathbf{W}^{1/2}\mathbf{B}\left(\mathbf{W}^{1/2}\mathbf{B}\right)^{+}\,, \\ \operatorname{col}(\mathbf{G}) &= \left\{ \boldsymbol{v} \in \mathbb{R}^{N} \,\vert\, \mathbf{B}^{\intercal}\mathbf{W}\boldsymbol{v} = \mathbf{0} \right\}\,, \\ r &= N - r_{\mathbf{B}}\,, \\ \mathbf{L}\mathbf{L}^{\intercal} &= \mathbf{G}\mathbf{\Lambda}\mathbf{G}^{\intercal}\,, \\ \kappa_{\boldsymbol{\mu}} &= \sqrt{F^{-1}_{\chi^{2}_{r}}(1 - q)}\,, \\ \mathbf{C} &= \mathbf{W}^{-1/2}\,, \\ \underset{\boldsymbol{\mu} \in U_{\boldsymbol{\mu}}}{\min} \boldsymbol{w}^{\intercal}\boldsymbol{\mu} &= \boldsymbol{w}^{\intercal}\hat{\boldsymbol{\mu}} - \kappa_{\boldsymbol{\mu}} \lVert \mathbf{L}^{\intercal}\boldsymbol{w} \rVert_{2}\,, \\ \underset{\mathbf{\Sigma} \in U_{\mathbf{\Sigma}}}{\max} \boldsymbol{w}^{\intercal}\mathbf{\Sigma}\boldsymbol{w} &= \boldsymbol{w}^{\intercal}\hat{\mathbf{\Sigma}}\boldsymbol{w} + \kappa \lVert (\mathbf{I} - \mathbf{Q}\mathbf{Q}^{\intercal})\mathbf{C}\boldsymbol{w} \rVert_{2}^{2}\,. \end{align}\]

Where:

  • $\mathbf{B}$: Effective loadings, $N \times K$, reduced to a full-rank basis when a Factor Family was re-based.
  • $\mathbf{W}$: Diagonal cross-sectional metric that the AbstractOrthogonalityMetric names, the identity under metric = nothing.
  • $(\cdot)^{+}$: Moore-Penrose pseudo-inverse.
  • $\mathbf{Q}$: Orthonormal basis of the weighted factor span.
  • $r_{\mathbf{B}}$: Numerical rank of $\mathbf{W}^{1/2}\mathbf{B}$, the column count of $\mathbf{Q}$.
  • $\mathbf{G}$: Basis of the Orthogonal Subspace, $N \times r$, with orthonormal columns.
  • $r$: Dimension of the Orthogonal Subspace.
  • $N$: Number of assets.
  • $\mathbf{\Lambda}$: Scaling of the mean set inside the Orthogonal Subspace, $r \times r$, symmetric and positive semi-definite.
  • $\mathbf{L}$: Geometry map of the mean set, $N \times r$, the product of $\mathbf{G}$ and the square root of $\mathbf{\Lambda}$ under mtx_sqrt.
  • $\kappa_{\boldsymbol{\mu}}$: Radius of the mean set. The line above is the radius of ChiSqKUncertaintyAlgorithm, the default. GeneralKUncertaintyAlgorithm gives $\sqrt{(1 - q)/q}$, and a number is the radius itself.
  • $F^{-1}_{\chi^{2}_{r}}$: Quantile function of the chi-squared distribution with $r$ degrees of freedom.
  • $q$: Significance level of the mean set.
  • $\mathbf{C}$: Diagonal metric square root of the covariance set.
  • $U_{\boldsymbol{\mu}}$, $U_{\mathbf{\Sigma}}$: Mean set and covariance set.
  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\hat{\boldsymbol{\mu}}$: Mean vector of the prior result, the centre of the mean set.
  • $\hat{\mathbf{\Sigma}}$: Estimated covariance matrix.
  • $\kappa \geq 0$: Radius of the compact covariance set, the multiplier of its penalty.

Both penalties are zero on a portfolio in the column space of $\mathbf{W}\mathbf{B}$, because $\mathbf{G}^{\intercal}\mathbf{W}\mathbf{B} = \mathbf{0}$ and $\mathbf{C}\mathbf{W}\mathbf{B} = \mathbf{W}^{1/2}\mathbf{B}$. Every other portfolio pays on both axes when both radii are positive and $\mathbf{\Lambda}$ is positive definite. Under metric = nothing that column space is the span of the loadings. Under any other metric it is a different space, and a portfolio along a column of $\mathbf{B}$ pays on both axes.

The rank of the mean set is $r$, not $N$, because a flat set is a confidence region of its own subspace. Loadings that span the whole cross-section leave $r = 0$, a mean set of radius zero and a covariance basis of $N$ columns, so neither axis carries a penalty.

Fields

  • q: Significance level that sets the size of the uncertainty set, with 0 < q < 1. A smaller q gives a larger set, with wider box intervals or a larger radius. A larger q gives a smaller set, nearer to the point estimate.
  • method: Radius algorithm of the set, or the radius as a Number.
  • scaling: Scaling of the mean set inside the Orthogonal Subspace, or nothing for a Euclidean ball. It changes the shape of the set and not the subspace the set lives in.
  • kappa: Radius $\kappa \geq 0$ of the covariance set, the multiplier of its quadratic penalty. A radius of 0 leaves the nominal variance. The field holds a number that the caller states, or a rule of AbstractCompactRadiusAlgorithm that computes one from the sample and the span. It is a plain field, so "ucs.kappa" is a lens path that a GridSearchCrossValidation or a RandomisedSearchCrossValidation grid ranges over, and a grid may hold rules beside numbers.
  • metric: Cross-sectional weighting under which the factor span is taken, or nothing for equal weights. It fixes the geometry of both sets, because both read one span.
  • mtx_sqrt: Square-root algorithm of the scaling $\mathbf{\Lambda}$ of the mean set, whose square root gives the geometry map $\mathbf{L}$, or nothing for the plain Cholesky factor, which raises a LinearAlgebra.PosDefException on a matrix that is not positive definite. The default takes the square root of the eigendecomposition of a singular positive semidefinite matrix, and every algorithm refuses an indefinite one. The set of order 2 reads only $\mathbf{L} \mathbf{L}^\intercal$, so the algorithm does not change the set where two of them succeed. matrix_square_root states each algorithm.

Constructors

OrthogonalUncertaintySet(;    q::Number = 0.05,    method::Num_UcSK = ChiSqKUncertaintyAlgorithm(),    scaling::Option{<:AbstractOrthogonalScaling} = nothing,    kappa::Num_CptRad = 1.0,    metric::Option{<:AbstractOrthogonalityMetric} = InverseIdiosyncraticVarianceMetric(),    mtx_sqrt::Option{<:AbstractMatrixSquareRootAlgorithm} = EigenFallbackSquareRoot()) -> OrthogonalUncertaintySet

Keywords correspond to the struct's fields.

Validation

  • 0 < q < 1.
  • If kappa is a number: !(kappa isa Bool), else an ArgumentError, and isfinite(kappa) and kappa >= 0. A Bool is an Integer in Julia, so true would pass as the radius 1, and a Bool in the radius slot is a flag in the wrong place. A rule is checked where its number lands, by the constructor of CompactCovarianceUncertaintySet.

Examples

julia> OrthogonalUncertaintySet()OrthogonalUncertaintySet         q ┼ Float64: 0.05    method ┼ ChiSqKUncertaintyAlgorithm           │   ambient ┴ Bool: false   scaling ┼ nothing     kappa ┼ Float64: 1.0    metric ┼ InverseIdiosyncraticVarianceMetric()  mtx_sqrt ┴ EigenFallbackSquareRoot()

Related

References

  • [184] A. Saxena and R. A. Stubbs. Finance, Statistics, Accounting, Optimization and some Alignment Problems. Axioma Research Paper No. 28, Axioma, Inc. (2010). Sections 3 and 5. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
  • [185] A. Saxena and R. A. Stubbs. Alpha alignment factor: A solution to the underestimation of risk for optimized active portfolios. Journal of Risk 15 (2013).
  • [173] A. Ben-Tal and A. Nemirovski. Robust Convex Optimization. Mathematics of Operations Research 23, 769–805 (1998). Section 3, Equation 14.
  • [170] D. Goldfarb and G. Iyengar. Robust Portfolio Selection Problems. Mathematics of Operations Research 28, 1–38 (2003). Section 5, Equation 50.
source
PortfolioOptimisers.orthogonal_scaling — Function
orthogonal_scaling(::Nothing, G::MatNum, ::AbstractLoadingsRegressionResult)
orthogonal_scaling(::IdiosyncraticVarianceScaling, G::MatNum, rr::AbstractLoadingsRegressionResult)

Scaling $\mathbf{\Lambda}$ of the mean set inside the Orthogonal Subspace.

nothing gives every direction of the subspace the same uncertainty, the default. The geometry map of the mean set is then the basis of the subspace, and the set is a Euclidean ball inside the subspace.

\[\begin{align} \mathbf{\Lambda} &= \mathbf{I}_{r}\,. \end{align}\]

Where:

  • $\mathbf{\Lambda}$: Scaling of the mean set inside the Orthogonal Subspace, $r \times r$, symmetric and positive semi-definite.
  • $r$: Dimension of the Orthogonal Subspace.

Algorithm

  1. On nothing, return the identity of side size(G, 2), the dimension of the subspace, as a dense matrix of the element type of G. The caller then takes one kind of square root on both branches.
  2. On IdiosyncraticVarianceScaling, run the steps that its docstring lists.

Arguments

  • scaling: Orthogonal scaling, or nothing.
  • G: Orthonormal basis of the Orthogonal Subspace, $N \times r$.
  • rr: Fitted loadings block.

Validation

Returns

  • lambda::MatNum: $r \times r$ scaling, symmetric, and positive semi-definite when the idiosyncratic covariance is.

Related

source
PortfolioOptimisers.orthogonality_weights — Function
orthogonality_weights(::Nothing, ::AbstractLoadingsRegressionResult)
orthogonality_weights(::InverseIdiosyncraticVarianceMetric, rr::AbstractLoadingsRegressionResult)
orthogonality_weights(::BenchmarkWeightMetric, rr::AbstractLoadingsRegressionResult)
orthogonality_weights(::RegressionWeightMetric, rr::AbstractLoadingsRegressionResult)
orthogonality_weights(::BenchmarkWeightMetric, rr::CrossSectionalFactorModel)
orthogonality_weights(::RegressionWeightMetric, rr::CrossSectionalFactorModel)

Cross-sectional weight vector the AbstractOrthogonalityMetric names, read off a fitted loadings block. nothing in the place of a metric weighs every asset equally.

Algorithm

  1. On nothing, return nothing. The caller reads a nothing as a vector of ones, and skips the scaling of the loadings and the division of the projector.
  2. On InverseIdiosyncraticVarianceMetric, read d, the idiosyncratic variances, with idiosyncratic_variances, refuse an entry that is not finite or not > 0, and return the element-wise inverse of d.
  3. On BenchmarkWeightMetric and RegressionWeightMetric over a CrossSectionalFactorModel, read the history w, the field bw or rw. Refuse a nothing history, because the block declares the field and this fit left it unset. Refuse an empty history.
  4. Take wl, the last row of w, as a view. These are the weights of the latest observation. The uncertainty set serves the next decision, so it reads the newest cross-section and not an average of the sample. Refuse wl when an entry is not finite or not > 0, and return it otherwise. The two methods hold one copy each of steps 3 and 4, and the copies differ only in the name of the field.
  5. On the same two metrics over any other loadings block, throw. A block fitted per asset over the observations carries no cross-sectional weight history, so the metric has nothing to read.

Arguments

  • metric: Orthogonality metric, or nothing for equal weights.
  • rr: Fitted loadings block.

Validation

  • On InverseIdiosyncraticVarianceMetric: every idiosyncratic variance is finite and > 0, else a DomainError. idiosyncratic_variances itself throws when the block carries none.
  • On a weight history: the history is not nothing, else an IsNothingError that names the field. The history is non-empty, else an IsEmptyError.
  • Every weight of the last row of the history is finite and > 0, else a DomainError. A weight of zero excluded its asset from the fit, and an excluded asset gives the metric a singular direction. The Investable Mask does not remove this case. An asset can be investable, with a finite return and a stated moment, and still sit outside the estimation universe of the latest cross-section, so its weight is zero while its loadings and variance are finite. InverseIdiosyncraticVarianceMetric and the nothing metric read no weight history, so they accept such an asset.
  • On a weight metric over a block that carries no history: an IsNothingError naming the field.

Returns

  • w::Option{<:VecNum}: Weight vector of length $N$, or nothing on a nothing metric.

Related

source
PortfolioOptimisers.cs_diagnostic_weights — Function
cs_diagnostic_weights(weighting::Nothing, csfm::CrossSectionalFactorModel)
cs_diagnostic_weights(weighting::BenchmarkWeightMetric, csfm::CrossSectionalFactorModel)
cs_diagnostic_weights(weighting::RegressionWeightMetric, csfm::CrossSectionalFactorModel)
cs_diagnostic_weights(weighting::InverseIdiosyncraticVarianceMetric, csfm::CrossSectionalFactorModel)

Return the cross-sectional weight history an AbstractOrthogonalityMetric names, over the whole observation axis of a factor model block.

orthogonality_weights reads the same metrics off the same block and returns the weights of the latest observation, which an uncertainty set needs. A diagnostic scores every observation, so it reads the whole history through this function instead.

Algorithm

  1. On nothing, return nothing.
  2. On BenchmarkWeightMetric, refuse a nothing history csfm.bw, and return it otherwise.
  3. On RegressionWeightMetric, refuse a nothing history csfm.rw, and return it otherwise.
  4. On InverseIdiosyncraticVarianceMetric, read vs, the idiosyncratic variance history csfm.vs. Refuse a nothing history, and return its element-wise inverse otherwise.

Each of the three methods holds its own copy of the refusal, and the copies differ only in the name of the field and in what it holds.

Arguments

  • weighting: The metric that names the history, or nothing for equal weights.
  • csfm: A cross-sectional factor model block.

Validation

  • The field that the metric names is not nothing, else an IsNothingError that names the field.

Returns

  • u::Option{<:MatNum}: observations × assets, and nothing under a nothing metric, which the diagnostics read as equal weights.

Related

source
PortfolioOptimisers.ucs — Method
ucs(
    ue::OrthogonalUncertaintySet,
    pr::AbstractPriorResult;
    rd,
    kwargs...
) -> Tuple{Union{NormBallUncertaintySet{var"#s185", var"#s1851", var"#s1852", C, Nothing} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractMatrix{var"#s166"}, var"#s1852"<:Number, C<:AbstractUncertaintySetClass}, NormBallUncertaintySet{var"#s185", var"#s1851", var"#s1852", C, <:AbstractArray{var"#s166", N}} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractMatrix{var"#s166"}, var"#s1852"<:Number, C<:AbstractUncertaintySetClass, var"#s166"<:Union{Number, AbstractJuMPScalar}, N}}, Union{CompactCovarianceUncertaintySet{var"#s185", var"#s1851", var"#s1852", <:AbstractMatrix{var"#s166"}, Nothing} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractVector{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1852"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}, CompactCovarianceUncertaintySet{var"#s185", var"#s1851", var"#s1852", var"#s1853", <:AbstractMatrix{var"#s166"}} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractVector{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1852"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1853"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}}}

Fits both uncertainty sets of an OrthogonalUncertaintySet from the prior result in one pass.

Algorithm

  1. Reduce the prior result, and the returns data beside it, to the Investable Mask with investable_ucs_reduction. Inside an optimiser the result arrives reduced and the step passes it through. Standalone, on a prior fitted on a point-in-time Asset Panel, the step takes the view that the optimiser takes.
  2. Take the weighted factor span once with orthogonal_factor_span.
  3. Build the mean set from that span with orthogonal_mu_set.
  4. Build the covariance set from the same span with orthogonal_sigma_set.
  5. Write each set back onto the full universe with expand_investable_ucs. A set fitted standalone then covers the assets of the prior, with a zero row on every asset outside the mask, and a view of it at the mask recovers the reduced fit.

A caller that needs one axis alone calls mu_ucs or sigma_ucs, which take the same span and build one set.

Arguments

  • ue: Orthogonal uncertainty set estimator.
  • pr: Prior result the optimisation is solving on.
  • rd: Returns data the set is being fitted beside, or nothing. Only a VarianceFraction holding an optimiser reads it, and the three-argument forms of ucs fill it in.
  • kwargs...: Additional keyword arguments (ignored).

Returns

  • mu_ucs::NormBallUncertaintySet: Mean set on the Orthogonal Subspace.
  • sigma_ucs::CompactCovarianceUncertaintySet: Covariance set that spares the factor span.

Related

source
PortfolioOptimisers.mu_ucs — Method
mu_ucs(
    ue::OrthogonalUncertaintySet,
    pr::AbstractPriorResult;
    kwargs...
) -> Union{NormBallUncertaintySet{var"#s185", var"#s1851", var"#s1852", C, Nothing} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractMatrix{var"#s166"}, var"#s1852"<:Number, C<:AbstractUncertaintySetClass}, NormBallUncertaintySet{var"#s185", var"#s1851", var"#s1852", C, <:AbstractArray{var"#s166", N}} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractMatrix{var"#s166"}, var"#s1852"<:Number, C<:AbstractUncertaintySetClass, var"#s166"<:Union{Number, AbstractJuMPScalar}, N}}

Fits the mean uncertainty set of an OrthogonalUncertaintySet from the prior result.

Algorithm

  1. Reduce the prior result to the Investable Mask with investable_ucs_reduction, a passthrough on a result that arrived reduced.
  2. Take the weighted factor span with orthogonal_factor_span.
  3. Build the mean set with orthogonal_mu_set.
  4. Write it back onto the full universe with expand_investable_ucs.

Arguments

  • ue: Orthogonal uncertainty set estimator.
  • pr: Prior result the optimisation is solving on.
  • kwargs...: Additional keyword arguments (ignored).

Returns

  • ucs::NormBallUncertaintySet: Mean set on the Orthogonal Subspace.

Related

source
PortfolioOptimisers.sigma_ucs — Method
sigma_ucs(
    ue::OrthogonalUncertaintySet,
    pr::AbstractPriorResult;
    rd,
    kwargs...
) -> Union{CompactCovarianceUncertaintySet{var"#s185", var"#s1851", var"#s1852", <:AbstractMatrix{var"#s166"}, Nothing} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractVector{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1852"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}, CompactCovarianceUncertaintySet{var"#s185", var"#s1851", var"#s1852", var"#s1853", <:AbstractMatrix{var"#s166"}} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractVector{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1852"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1853"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}}

Fits the covariance uncertainty set of an OrthogonalUncertaintySet from the prior result.

Algorithm

  1. Reduce the prior result, and the returns data beside it, to the Investable Mask with investable_ucs_reduction, a passthrough on a result that arrived reduced.
  2. Take the weighted factor span with orthogonal_factor_span.
  3. Build the covariance set with orthogonal_sigma_set.
  4. Write it back onto the full universe with expand_investable_ucs.

Arguments

  • ue: Orthogonal uncertainty set estimator.
  • pr: Prior result the optimisation is solving on.
  • rd: Returns data the set is being fitted beside, or nothing. Only a VarianceFraction holding an optimiser reads it, and the three-argument forms of sigma_ucs fill it in.
  • kwargs...: Additional keyword arguments (ignored).

Returns

  • ucs::CompactCovarianceUncertaintySet: Covariance set that spares the factor span.

Related

source

References

[170]
D. Goldfarb and G. Iyengar. Robust Portfolio Selection Problems. Mathematics of Operations Research 28, 1–38 (2003).
[173]
A. Ben-Tal and A. Nemirovski. Robust Convex Optimization. Mathematics of Operations Research 23, 769–805 (1998).
[184]
A. Saxena and R. A. Stubbs. Finance, Statistics, Accounting, Optimization and some Alignment Problems. Axioma Research Paper 28 (Axioma, Inc., 2010).
[185]
A. Saxena and R. A. Stubbs. Alpha alignment factor: A solution to the underestimation of risk for optimized active portfolios. Journal of Risk 15 (2013).