Variance

PortfolioOptimisers.QuadRiskExprType
struct QuadRiskExpr <: VarianceFormulation

Encodes the second moment as an explicit quadratic form, without an auxiliary variable or a cone.

The encoding takes two shapes. A risk measure that holds a co-moment matrix uses the first, and a risk measure that builds a deviation vector uses the second.

Mathematical definition

\[\begin{align} R(\boldsymbol{w}) &= \boldsymbol{w}^\intercal \mathbf{\Sigma} \boldsymbol{w}\,,\\ R(\boldsymbol{w}) &= c \, \boldsymbol{d}^\intercal \boldsymbol{d}\,. \end{align}\]

Where:

  • $R(\boldsymbol{w})$: Portfolio risk.
  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\mathbf{\Sigma}$: N × N co-moment matrix.
  • $\boldsymbol{d}$: Deviation vector $T \times 1$ that the formulation squares. The risk measure supplies it.
  • $c$: Correction factor that the risk measure supplies. It is $1$ when the co-moment matrix already carries it.

Related

source
PortfolioOptimisers.SquaredSOCRiskExprType
struct SquaredSOCRiskExpr <: VarianceFormulation

Encodes the second moment as the square of a second-order cone variable.

The cone bounds the norm of the deviation vector, and the risk expression squares that variable, so the reported units are those of the second moment.

Mathematical definition

\[\begin{align} R(\boldsymbol{w}) &= c \, t^{2}\,,\\ \text{s.t.} \quad & \left\lVert \boldsymbol{d} \right\rVert_{2} \leq t\,. \end{align}\]

Where:

  • $R(\boldsymbol{w})$: Portfolio risk.
  • $\boldsymbol{d}$: Deviation vector $T \times 1$ that the formulation squares. The risk measure supplies it.
  • $c$: Correction factor that the risk measure supplies. It is $1$ when the co-moment matrix already carries it.
  • $t$: Auxiliary model variable that the cone bounds.
  • $\lVert \cdot \rVert_{2}$: L2 norm, which is modelled as a JuMP.SecondOrderCone.

Related

source
PortfolioOptimisers.RSOCRiskExprType
struct RSOCRiskExpr <: SecondMomentFormulation

Encodes the second moment as a variable that a rotated second-order cone bounds.

The cone carries the square, so the risk expression stays linear in the auxiliary variable. The library builds it as [t; 1/2; d] in JuMP.RotatedSecondOrderCone(). That cone reads $2 t u \geq \lVert \boldsymbol{d} \rVert_{2}^{2}$, and the second entry pins $u = 1/2$, so it states $t \geq \lVert \boldsymbol{d} \rVert_{2}^{2}$. The reported units are those of the second moment.

Mathematical definition

\[\begin{align} R(\boldsymbol{w}) &= c \, t\,,\\ \text{s.t.} \quad & \left\lVert \boldsymbol{d} \right\rVert_{2}^{2} \leq t\,. \end{align}\]

Where:

  • $R(\boldsymbol{w})$: Portfolio risk.
  • $\boldsymbol{d}$: Deviation vector $T \times 1$ that the formulation squares. The risk measure supplies it.
  • $c$: Correction factor that the risk measure supplies. It is $1$ when the co-moment matrix already carries it.
  • $t$: Auxiliary model variable that the cone bounds.
  • $\lVert \cdot \rVert_{2}$: L2 norm, whose square is modelled as a JuMP.RotatedSecondOrderCone.

Related

source
PortfolioOptimisers.SOCRiskExprType
struct SOCRiskExpr <: SecondMomentFormulation

Encodes the square root of the second moment as a second-order cone variable.

This is the only one of the four encodings that reports a root. A risk measure that takes it reports a standard deviation where the other three report a variance, both in the model and in the functor, and a bound in settings.ub is read in the same units.

Mathematical definition

\[\begin{align} R(\boldsymbol{w}) &= \sqrt{c} \, t\,,\\ \text{s.t.} \quad & \left\lVert \boldsymbol{d} \right\rVert_{2} \leq t\,. \end{align}\]

Where:

  • $R(\boldsymbol{w})$: Portfolio risk.
  • $\boldsymbol{d}$: Deviation vector $T \times 1$ that the formulation squares. The risk measure supplies it.
  • $c$: Correction factor that the risk measure supplies. It is $1$ when the co-moment matrix already carries it.
  • $t$: Auxiliary model variable that the cone bounds.
  • $\lVert \cdot \rVert_{2}$: L2 norm, which is modelled as a JuMP.SecondOrderCone.

Related

source
PortfolioOptimisers.VarianceType
struct Variance{__T_settings, __T_sigma, __T_chol, __T_rc, __T_alg} <: RiskMeasure

Represents the portfolio variance using a covariance matrix.

Mathematical definition

\[\begin{align} \mathrm{Variance}(\boldsymbol{w},\, \mathbf{\Sigma}) &= \boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\mathbf{\Sigma}$: N × N covariance matrix.

Fields

  • settings: Risk measure settings.
  • sigma: Optional covariance matrix assets × assets. Also admits a Deferred Quantity — a covariance estimator or a prior estimator that computes the matrix against the optimisation's own prior, at factory time (see SigmaSlot and resolve_deferred_quantities). If nothing, the prior supplies it.
  • chol: Optional Cholesky factorisation of the covariance matrix. Derived from sigma, so it never defers: it arrives as one pair with whatever sigma resolves to. Give it with a matrix sigma and with neither otherwise — stating it without sigma, or while sigma holds a Deferred Quantity, is refused at construction (see assert_derived_slot_has_source). If nothing, the prior supplies the pair, or the kernel derives the factorisation from a stated sigma.
  • rc: Risk contribution constraint.
  • alg: Risk measure optimisation formulation algorithm.

Constructors

Variance(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    sigma::Option{<:SigmaSlot} = nothing,    chol::Option{<:MatNum} = nothing,    rc::Option{<:LcE_Lc} = nothing,    alg::VarianceFormulation = SquaredSOCRiskExpr(),) -> Variance

Keywords correspond to the struct's fields.

Validation

  • If sigma is not nothing, !isempty(sigma) and size(sigma, 1) == size(sigma, 2).
Warning

sigma and chol are a pair, and a stated chol factorises the sigma beside it. A caller who wants one consistent pair names sigma alone — a matrix leaves the factorisation to the kernel, a Deferred Quantity fits both from one prior. A caller who states both by hand must make sure that they agree. A stated matrix is also pinned: it crosses a Cross-Validation fold or a subset view as the whole universe's answer, while a Deferred Quantity crosses unresolved and refits on the subset.

View parameters

Variance defines its own port_opt_view method rather than deriving one from field tags.

  • sigma is sliced to the selected assets. A stated matrix is sliced on both axes. A Deferred Quantity passes through unsliced, and then resolves on the subset.
  • chol is sliced on its columns alone. Its rows index the factorisation, which the asset selection does not address.
  • The method refuses an rc that is a LinearConstraint. A group constraint cannot be restricted to a part of its own group, and the restriction would break factor risk contribution.
  • settings, rc and alg are carried through unchanged.

JuMP Formulations

Info

Regardless of the formulation used, an auxiliary variable representing the standard deviation is needed in order to constrain the risk or maximise the risk-adjusted return ratio. This is because quadratic constraints are not strictly convex, and the transformation needed to maximise the risk-adjusted return ratio requires affine variables in the numerator and denominator.

Depending on the alg field, the variance risk measure is formulated using JuMP as follows:

QuadRiskExpr

\[\begin{align} \underset{\boldsymbol{w}}{\mathrm{opt}} \quad & \boldsymbol{w}^\intercal \mathbf{\Sigma} \boldsymbol{w}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.
  • $\mathbf{\Sigma}$: N × N covariance matrix.

SquaredSOCRiskExpr

\[\begin{align} \underset{\boldsymbol{w}}{\mathrm{opt}} \quad & \sigma^2\nonumber\\ \text{s.t.} \quad & \left\lVert \mathbf{G} \boldsymbol{w} \right\rVert_{2} \leq \sigma\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.
  • $\sigma$: Variable representing the optimised portfolio's standard deviation.
  • $\mathbf{G}$: Suitable factorisation of the N × N covariance matrix, such as the square root matrix, or the Cholesky factorisation.
  • $\lVert \cdot \rVert_{2}$: L2 norm, which is modelled as a JuMP.SecondOrderCone.

Functor

(r::Variance)(w::VecNum)

Computes the variance risk of a portfolio with weights w using the covariance matrix r.sigma.

\[\begin{align} \mathrm{Variance}(\boldsymbol{w},\, \mathbf{\Sigma}) &= \boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.
  • $\mathbf{\Sigma}$: N × N covariance matrix.

Arguments

  • w::VecNum: Asset weights.

Examples

julia> w = [0.3803452066954233, 0.5900852659955864, 0.029569527308990307];julia> r = Variance(;                    sigma = [0.97780 -0.06400 0.84818;                             -0.06400 3.28564 1.84588;                             0.84818 1.84588 2.16317])Variance  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true     sigma ┼ 3×3 Matrix{Float64}      chol ┼ nothing        rc ┼ nothing       alg ┴ SquaredSOCRiskExpr()julia> r(w)1.3421705804186579

Related

References

  • [11] H. Markowitz. Modern portfolio theory. Journal of Finance 7, 77–91 (1952).
source
PortfolioOptimisers.StandardDeviationType
struct StandardDeviation{__T_settings, __T_sigma, __T_chol} <: RiskMeasure

Represents the portfolio standard deviation using a covariance matrix. It is the square root of the variance.

Mathematical definition

\[\begin{align} \mathrm{StandardDeviation}(\boldsymbol{w},\, \mathbf{\Sigma}) &= \sqrt{\boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w}}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\mathbf{\Sigma}$: N × N covariance matrix.

Fields

  • settings: Risk measure settings.
  • sigma: Optional covariance matrix assets × assets. Also admits a Deferred Quantity — a covariance estimator or a prior estimator that computes the matrix against the optimisation's own prior, at factory time (see SigmaSlot and resolve_deferred_quantities). If nothing, the prior supplies it.
  • chol: Optional Cholesky factorisation of the covariance matrix. Derived from sigma, so it never defers: it arrives as one pair with whatever sigma resolves to. Give it with a matrix sigma and with neither otherwise — stating it without sigma, or while sigma holds a Deferred Quantity, is refused at construction (see assert_derived_slot_has_source). If nothing, the prior supplies the pair, or the kernel derives the factorisation from a stated sigma.

Constructors

StandardDeviation(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    sigma::Option{<:SigmaSlot} = nothing,    chol::Option{<:MatNum} = nothing,) -> StandardDeviation

Keywords correspond to the struct's fields.

Validation

  • If sigma is not nothing, !isempty(sigma) and size(sigma, 1) == size(sigma, 2).
Warning

sigma and chol are a pair, and a stated chol factorises the sigma beside it. A caller who wants one consistent pair names sigma alone — a matrix leaves the factorisation to the kernel, a Deferred Quantity fits both from one prior. A caller who states both by hand must make sure that they agree. A stated matrix is also pinned: it crosses a Cross-Validation fold or a subset view as the whole universe's answer, while a Deferred Quantity crosses unresolved and refits on the subset.

View parameters

StandardDeviation defines its own port_opt_view method rather than deriving one from field tags.

  • sigma is sliced to the selected assets. A stated matrix is sliced on both axes. A Deferred Quantity passes through unsliced, and then resolves on the subset.
  • chol is sliced on its columns alone. Its rows index the factorisation, which the asset selection does not address.
  • settings is carried through unchanged.

JuMP Formulation

\[\begin{align} \underset{\boldsymbol{w}}{\mathrm{opt}} \quad & \sigma\nonumber\\ \text{s.t.} \quad & \left\lVert \mathbf{G} \boldsymbol{w} \right\rVert_{2} \leq \sigma\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.
  • $\sigma$: Variable representing the optimised portfolio's standard deviation.
  • $\mathbf{G}$: Suitable factorisation of the N × N covariance matrix, such as the square root matrix, or the Cholesky factorisation.
  • $\lVert \cdot \rVert_{2}$: L2 norm, which is modelled as a JuMP.SecondOrderCone.

Functor

(r::StandardDeviation)(w::VecNum)

Computes the standard deviation risk of a portfolio with weights w using the covariance matrix r.sigma.

\[\begin{align} \mathrm{StandardDeviation}(\boldsymbol{w},\, \mathbf{\Sigma}) &= \sqrt{\boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w}}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.
  • $\mathbf{\Sigma}$: N × N covariance matrix.

Arguments

  • w::VecNum: Asset weights.

Examples

julia> w = [0.3803452066954233, 0.5900852659955864, 0.029569527308990307];julia> r = StandardDeviation(;                             sigma = [0.97780 -0.06400 0.84818;                                      -0.06400 3.28564 1.84588;                                      0.84818 1.84588 2.16317])StandardDeviation  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true     sigma ┼ 3×3 Matrix{Float64}      chol ┴ nothingjulia> r(w)1.1585208588621345

Related

References

  • [11] H. Markowitz. Modern portfolio theory. Journal of Finance 7, 77–91 (1952).
source
PortfolioOptimisers.UncertaintySetVarianceType
struct UncertaintySetVariance{__T_settings, __T_ucs, __T_sigma} <: RiskMeasure

Represents the variance risk measure under uncertainty sets. Works the same way as the Variance risk measure but allows specifying uncertainty set estimators or results. These are only used in JuMP-based optimisations because they dictate how the variance is formulated as an optimisation problem. By encapsulating the uncertainty set estimator or result, enables the use of multiple uncertainty set variances in the same optimisation model.

Fields

  • settings: Risk measure settings.
  • ucs: Uncertainty set.
  • sigma: Optional covariance matrix assets × assets. Also admits a Deferred Quantity — a covariance estimator or a prior estimator that computes the matrix against the optimisation's own prior, at factory time (see SigmaSlot and resolve_deferred_quantities). If nothing, the prior supplies it.

Constructors

UncertaintySetVariance(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    ucs::Option{<:UcSE_UcS} = NormalUncertaintySet(),    sigma::Option{<:SigmaSlot} = nothing,) -> UncertaintySetVariance

Keywords correspond to the struct's fields.

Validation

  • If sigma is not nothing, !isempty(sigma).
Warning

A stated sigma is pinned: it crosses a Cross-Validation fold or a subset view as the whole universe's answer, so it does not follow the refit the optimisation runs on, and nothing makes it agree with the uncertainty set beside it. A caller who wants it to follow the fit names a Deferred Quantity in sigma, or leaves the slot nothing and lets the prior supply it.

JuMP Formulations

When using an uncertainty set on the variance, the optimisation problem becomes:

\[\begin{align} \underset{\boldsymbol{w}}{\mathrm{opt}} \quad & \underset{\mathbf{\Sigma} \in U_{\mathbf{\Sigma}}}{\max} \boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.
  • $\mathbf{\Sigma}$: N × N covariance matrix.
  • $U_{\mathbf{\Sigma}}$: Uncertainty set for the covariance matrix.

This problem can be reformulated depending on the type of uncertainty set used.

Box uncertainty set

\[\begin{align} \underset{\boldsymbol{w}}{\mathrm{opt}} & \quad \mathrm{Tr}\left(\mathbf{A}_u \mathbf{\Sigma}_u\right) - \mathrm{Tr}\left(\mathbf{A}_l \mathbf{\Sigma}_l\right)\\ \text{s.t.} & \quad \mathbf{A}_u \geq 0\\ & \quad \mathbf{A}_l \geq 0\\ & \quad \begin{bmatrix} \mathbf{W} & \boldsymbol{w}\\ \boldsymbol{w}^\intercal & k \end{bmatrix} \succeq 0 \\ & \quad \mathbf{A}_u - \mathbf{A}_l = \mathbf{W}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.

  • $\mathbf{A}_u$, $\mathbf{A}_l$, $\mathbf{W}$: N × N auxiliary symmetric matrices.

  • $\mathbf{\Sigma}_l$: N × N lower bound of the covariance matrix.

  • $\mathbf{\Sigma}_u$: N × N upper bound of the covariance matrix.

  • $k$: Scalar variable/constant.

    • If the objective risk-adjusted return, it is a non-negative variable.
    • Else it is equal to 1.
  • $\mathrm{Tr}(\cdot)$: Trace operator.

Ellipsoidal uncertainty set

\[\begin{align} \underset{\boldsymbol{w}}{\mathrm{opt}} & \quad \mathrm{Tr}\left( \mathbf{\Sigma} \left( \mathbf{W} + \mathbf{E} \right) \right) + k_{\mathbf{\Sigma}} \sigma \\ \text{s.t.} & \quad \begin{bmatrix} \mathbf{W} & \boldsymbol{w}\\ \boldsymbol{w}^\intercal & k \end{bmatrix} \succeq 0 \\ & \quad \mathbf{E} \succeq 0 \\ & \quad \lVert \mathbf{G} \mathrm{vec}\left( \mathbf{W} + \mathbf{E} \right) \rVert_{2} \leq \sigma \\ \end{align}\]

Where:

  • $\boldsymbol{w}$: N × 1 asset weights vector.

  • $\mathbf{\Sigma}$: N × N covariance matrix.

  • $\mathbf{W}$, $\mathbf{E}$: N × N auxiliary symmetric matrices.

  • $k_{\mathbf{\Sigma}}$: Scalar constant defining the size of the uncertainty set.

  • $\sigma$: Variable representing the portfolio's variance of the variance.

  • $\mathbf{G}$: Suitable factorisation of the N^2 × N^2 covariance of the covariance matrix of the uncertainty set, such as the square root matrix, or the Cholesky factorisation.

  • $k$: Scalar variable/constant.

    • If the objective risk-adjusted return, it is a non-negative variable.
    • Else it is equal to 1.
  • $\mathrm{Tr}(\cdot)$: Trace operator.

  • $\mathrm{vec}(\cdot)$: Vectorisation operator, which unrolls a matrix as a column vector in column-major order.

  • $\lVert \cdot \rVert_{2}$: L2 norm, which is modelled as a JuMP.SecondOrderCone.

Functor

(r::UncertaintySetVariance)(w::VecNum)

Computes the variance risk of a portfolio with weights w. The value depends on what ucs holds, because the measure is a worst case over a set and an unfitted estimator defines no set.

  • ucs holds an AbstractUncertaintySetResult: the worst-case variance over the fitted set, computed by ucs_variance. This is the scalar twin of the risk expression the JuMP formulations above build.
  • ucs holds an estimator or nothing: the nominal variance $\boldsymbol{w}^\intercal \mathbf{\Sigma} \boldsymbol{w}$.

\[\begin{align} \mathrm{UncertaintySetVariance}(\boldsymbol{w},\, \mathbf{\Sigma}) &= \begin{cases} \underset{\mathbf{\Sigma} \in U_{\mathbf{\Sigma}}}{\max} \boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w} & \text{(fitted uncertainty set)} \\ \boldsymbol{w}^\intercal \, \mathbf{\Sigma}\, \boldsymbol{w} & \text{(estimator or nothing)} \end{cases}\,. \end{align}\]

Where:

  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\mathbf{\Sigma}$: N × N covariance matrix.
  • $U_{\mathbf{\Sigma}}$: Uncertainty set for the covariance matrix.

Arguments

  • w::VecNum: Asset weights.

Examples

julia> w = [0.3803452066954233, 0.5900852659955864, 0.029569527308990307];julia> r = UncertaintySetVariance(;                                  sigma = [0.97780 -0.06400 0.84818;                                           -0.06400 3.28564 1.84588;                                           0.84818 1.84588 2.16317])UncertaintySetVariance  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true       ucs ┼ NormalUncertaintySet           │       pe ┼ EmpiricalPrior           │          │           ce ┼ PortfolioOptimisersCovariance           │          │              │   ce ┼ Covariance           │          │              │      │    me ┼ SimpleExpectedReturns           │          │              │      │       │   w ┴ nothing           │          │              │      │    ce ┼ GeneralCovariance           │          │              │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)           │          │              │      │       │    w ┴ nothing           │          │              │      │   alg ┼ FullMoment()           │          │              │      │     w ┴ nothing           │          │              │   mp ┼ MatrixProcessing           │          │              │      │     pdm ┼ Posdef           │          │              │      │         │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton           │          │              │      │         │   kwargs ┴ @NamedTuple{}: NamedTuple()           │          │              │      │      dn ┼ nothing           │          │              │      │      dt ┼ nothing           │          │              │      │     alg ┼ nothing           │          │              │      │   order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)           │          │           me ┼ SimpleExpectedReturns           │          │              │   w ┴ nothing           │          │      horizon ┼ nothing           │          │   fill_limit ┴ nothing           │      alg ┼ BoxUncertaintySetAlgorithm()           │    n_sim ┼ Int64: 3000           │        q ┼ Float64: 0.05           │      rng ┼ Random.TaskLocalRNG: Random.TaskLocalRNG()           │     seed ┼ nothing           │      ens ┼ nothing           │      pdm ┼ Posdef           │          │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton           │          │   kwargs ┴ @NamedTuple{}: NamedTuple()           │   kwargs ┴ @NamedTuple{}: NamedTuple()     sigma ┴ 3×3 Matrix{Float64}julia> r(w)1.3421705804186579

Related

References

  • [97] R. H. Tütüncü and M. Koenig. Robust asset allocation. Annals of Operations Research 132, 157–187 (2004).
  • [26] Y. Feng and D. P. Palomar. A signal processing perspective of financial engineering. Foundations and Trends in Signal Processing 9, 1–231 (2016).
  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 11.3.
source
PortfolioOptimisers.factoryMethod
factory(
    r::Variance,
    pr::AbstractPriorResult,
    args...;
    kwargs...
) -> Variance{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, _A, _B, _C, <:VarianceFormulation} where {__T_scale, __T_ub, __T_rke, _A, _B, _C}

Create an instance of Variance by resolving a Deferred Quantity in sigma, then falling back to the prior result for the covariance matrix and its factorisation.

The two are selected as a pair (sigma_chol_selector), not field by field: a stated sigma with no factor must not be paired with the prior's, which factorises a different matrix.

Related

source
PortfolioOptimisers.factoryMethod
factory(
    r::StandardDeviation,
    pr::AbstractPriorResult,
    args...;
    kwargs...
) -> Union{StandardDeviation{__T_settings, __T_sigma, Nothing} where {__T_settings, __T_sigma}, StandardDeviation{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, var"#s185", <:AbstractMatrix{var"#s137"}} where {__T_scale, __T_ub, __T_rke, var"#s137"<:(Union{var"#s136", var"#s53"} where {var"#s136"<:Number, var"#s53"<:AbstractJuMPScalar}), var"#s185"<:AbstractMatrix{var"#s137"}, var"#s137"<:(Union{var"#s136", var"#s53"} where {var"#s136"<:Number, var"#s53"<:AbstractJuMPScalar})}}

Create an instance of StandardDeviation by resolving a Deferred Quantity in sigma, then falling back to the prior result for the covariance matrix and its factorisation as a pair. See factory(r::Variance, pr::AbstractPriorResult, args...; kwargs...).

Related

source
PortfolioOptimisers.factoryFunction
factory(r::UncertaintySetVariance, pr::AbstractPriorResult, ::Any,
        ucs::Option{<:UcSE_UcS} = nothing, args...;
        kwargs...)

Create an instance of UncertaintySetVariance by selecting the uncertainty set and covariance matrix from the risk-measure instance or falling back to the prior result.

Arguments

  • r: Prototype risk measure whose settings and sigma fields are reused for the new instance.
  • prior: Prior result providing pr.sigma to use when r.sigma === nothing.
  • ::Any: Placeholder positional argument for API compatibility.
  • ucs: Optional uncertainty set estimator or result to override r.ucs.
  • args...: Extra positional arguments are accepted for API compatibility but are ignored by this constructor.
  • kwargs...: Keyword arguments are accepted for API compatibility but are ignored by this constructor.

Returns

  • r_new::UncertaintySetVariance: A new UncertaintySetVariance instance.

Details

Related

source
PortfolioOptimisers.factoryFunction
source
PortfolioOptimisers.factoryFunction
source

References

[5]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
[11]
H. Markowitz. Modern portfolio theory. Journal of Finance 7, 77–91 (1952).
[26]
Y. Feng and D. P. Palomar. A signal processing perspective of financial engineering. Foundations and Trends in Signal Processing 9, 1–231 (2016).
[97]
R. H. Tütüncü and M. Koenig. Robust asset allocation. Annals of Operations Research 132, 157–187 (2004).