Variance
PortfolioOptimisers.QuadRiskExpr — Type
struct QuadRiskExpr <: VarianceFormulationEncodes 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 × Nco-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
PortfolioOptimisers.SquaredSOCRiskExpr — Type
struct SquaredSOCRiskExpr <: VarianceFormulationEncodes 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
PortfolioOptimisers.RSOCRiskExpr — Type
struct RSOCRiskExpr <: SecondMomentFormulationEncodes 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
PortfolioOptimisers.SOCRiskExpr — Type
struct SOCRiskExpr <: SecondMomentFormulationEncodes 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
PortfolioOptimisers.Variance — Type
struct Variance{__T_settings, __T_sigma, __T_chol, __T_rc, __T_alg} <: RiskMeasureRepresents 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 × Ncovariance matrix.
Fields
settings: Risk measure settings.
sigma: Optional covariance matrixassets × assets. Also admits a Deferred Quantity — a covariance estimator or a prior estimator that computes the matrix against the optimisation's own prior, atfactorytime (seeSigmaSlotandresolve_deferred_quantities). Ifnothing, the prior supplies it.
chol: Optional Cholesky factorisation of the covariance matrix. Derived fromsigma, so it never defers: it arrives as one pair with whateversigmaresolves to. Give it with a matrixsigmaand with neither otherwise — stating it withoutsigma, or whilesigmaholds a Deferred Quantity, is refused at construction (seeassert_derived_slot_has_source). Ifnothing, the prior supplies the pair, or the kernel derives the factorisation from a statedsigma.
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(),) -> VarianceKeywords correspond to the struct's fields.
Validation
- If
sigmais notnothing,!isempty(sigma)andsize(sigma, 1) == size(sigma, 2).
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.
sigmais 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.cholis sliced on its columns alone. Its rows index the factorisation, which the asset selection does not address.- The method refuses an
rcthat is aLinearConstraint. A group constraint cannot be restricted to a part of its own group, and the restriction would break factor risk contribution. settings,rcandalgare carried through unchanged.
JuMP Formulations
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 × 1asset weights vector. - $\mathbf{\Sigma}$:
N × Ncovariance 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 × 1asset weights vector. - $\sigma$: Variable representing the optimised portfolio's standard deviation.
- $\mathbf{G}$: Suitable factorisation of the
N × Ncovariance 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 × 1asset weights vector. - $\mathbf{\Sigma}$:
N × Ncovariance 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.3421705804186579Related
RiskMeasureRiskMeasureSettingsStandardDeviationUncertaintySetVarianceVarianceFormulationQuadRiskExprSquaredSOCRiskExprSOCRiskExprRSOCRiskExprset_risk_constraints!scalarise_risk_expression!factoryport_opt_viewexpected_risk
References
- [11] H. Markowitz. Modern portfolio theory. Journal of Finance 7, 77–91 (1952).
PortfolioOptimisers.StandardDeviation — Type
struct StandardDeviation{__T_settings, __T_sigma, __T_chol} <: RiskMeasureRepresents 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 × Ncovariance matrix.
Fields
settings: Risk measure settings.
sigma: Optional covariance matrixassets × assets. Also admits a Deferred Quantity — a covariance estimator or a prior estimator that computes the matrix against the optimisation's own prior, atfactorytime (seeSigmaSlotandresolve_deferred_quantities). Ifnothing, the prior supplies it.
chol: Optional Cholesky factorisation of the covariance matrix. Derived fromsigma, so it never defers: it arrives as one pair with whateversigmaresolves to. Give it with a matrixsigmaand with neither otherwise — stating it withoutsigma, or whilesigmaholds a Deferred Quantity, is refused at construction (seeassert_derived_slot_has_source). Ifnothing, the prior supplies the pair, or the kernel derives the factorisation from a statedsigma.
Constructors
StandardDeviation(; settings::RiskMeasureSettings = RiskMeasureSettings(), sigma::Option{<:SigmaSlot} = nothing, chol::Option{<:MatNum} = nothing,) -> StandardDeviationKeywords correspond to the struct's fields.
Validation
- If
sigmais notnothing,!isempty(sigma)andsize(sigma, 1) == size(sigma, 2).
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.
sigmais 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.cholis sliced on its columns alone. Its rows index the factorisation, which the asset selection does not address.settingsis 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 × 1asset weights vector. - $\sigma$: Variable representing the optimised portfolio's standard deviation.
- $\mathbf{G}$: Suitable factorisation of the
N × Ncovariance 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 × 1asset weights vector. - $\mathbf{\Sigma}$:
N × Ncovariance 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.1585208588621345Related
References
- [11] H. Markowitz. Modern portfolio theory. Journal of Finance 7, 77–91 (1952).
PortfolioOptimisers.UncertaintySetVariance — Type
struct UncertaintySetVariance{__T_settings, __T_ucs, __T_sigma} <: RiskMeasureRepresents 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 matrixassets × assets. Also admits a Deferred Quantity — a covariance estimator or a prior estimator that computes the matrix against the optimisation's own prior, atfactorytime (seeSigmaSlotandresolve_deferred_quantities). Ifnothing, the prior supplies it.
Constructors
UncertaintySetVariance(; settings::RiskMeasureSettings = RiskMeasureSettings(), ucs::Option{<:UcSE_UcS} = NormalUncertaintySet(), sigma::Option{<:SigmaSlot} = nothing,) -> UncertaintySetVarianceKeywords correspond to the struct's fields.
Validation
- If
sigmais notnothing,!isempty(sigma).
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 × 1asset weights vector. - $\mathbf{\Sigma}$:
N × Ncovariance 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 × 1asset weights vector.$\mathbf{A}_u$, $\mathbf{A}_l$, $\mathbf{W}$:
N × Nauxiliary symmetric matrices.$\mathbf{\Sigma}_l$:
N × Nlower bound of the covariance matrix.$\mathbf{\Sigma}_u$:
N × Nupper 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 × 1asset weights vector.$\mathbf{\Sigma}$:
N × Ncovariance matrix.$\mathbf{W}$, $\mathbf{E}$:
N × Nauxiliary 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^2covariance 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.
ucsholds anAbstractUncertaintySetResult: the worst-case variance over the fitted set, computed byucs_variance. This is the scalar twin of the risk expression theJuMPformulations above build.ucsholds an estimator ornothing: 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 × Ncovariance 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.3421705804186579Related
RiskMeasureSettingsVarianceAbstractUncertaintySetResultAbstractUncertaintySetEstimatorucs_variancefactory(r::UncertaintySetVariance, pr::AbstractPriorResult, args...; kwargs...)expected_risk
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.
PortfolioOptimisers.factory — Method
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
PortfolioOptimisers.factory — Method
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
PortfolioOptimisers.factory — Function
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 whosesettingsandsigmafields are reused for the new instance.prior: Prior result providingpr.sigmato use whenr.sigma === nothing.::Any: Placeholder positional argument for API compatibility.ucs: Optional uncertainty set estimator or result to overrider.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 newUncertaintySetVarianceinstance.
Details
- Selects
ucsusingucs_selector. - Selects
sigmausingnothing_scalar_array_selector. - Other fields are taken from
r.
Related
PortfolioOptimisers.factory — Function
factory(
r::UncertaintySetVariance,
pr::AbstractPriorResult;
...
) -> UncertaintySetVariance
factory(
r::UncertaintySetVariance,
pr::AbstractPriorResult,
ucs::Union{Nothing, AbstractUncertaintySetEstimator, AbstractUncertaintySetResult};
kwargs...
) -> UncertaintySetVariance
Create an instance of UncertaintySetVariance without a placeholder positional argument (see factory(r::UncertaintySetVariance, pr::AbstractPriorResult, ::Any, ucs, args...; kwargs...)).
Related
PortfolioOptimisers.factory — Function
factory(
r::UncertaintySetVariance,
ucs::Union{AbstractUncertaintySetEstimator, AbstractUncertaintySetResult};
...
) -> UncertaintySetVariance
factory(
r::UncertaintySetVariance,
ucs::Union{AbstractUncertaintySetEstimator, AbstractUncertaintySetResult},
pr::Union{Nothing, AbstractPriorResult};
kwargs...
) -> UncertaintySetVariance
Create an instance of UncertaintySetVariance with the uncertainty set as the first override argument.
Related
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).