Mean Risk

PortfolioOptimisers.MeanRiskResult — Type
struct MeanRiskResult{__T_jr, __T_fb} <: RiskJuMPOptimisationResult

Holds the solution, the resolved risk measures and the fallback chain of a Mean-Risk optimisation.

optimise returns it for a MeanRisk. A frontier sweep gives one result that holds one weight vector and one return code for each point of the sweep. The property w and every name that is not a field resolve through jr, the JuMPOptimisationResult that the result holds.

Fields

  • jr: The JuMPOptimisationResult that holds the resolved bundle of the optimiser, the return code, the solution and the model.
  • r: The risk measure the optimisation ran under, or a vector of them, stored resolved. Every Deferred Quantity in it is fitted, and every unstated slot holds the prior's field. A resolved measure is fitted state, not configuration, so it belongs on the Result. Pass it back as expected_risk(res.r, res.w, res.pr; sca = res.sca). The type of r is not a type parameter of the Result, so the Results of two risk measures have one type, and a verb that reads them compiles one time.
  • fb: The fallback chain that answered this result: the (estimator, result) pair of every attempt optimise made before this one, in the order they ran, or nothing when the estimator it was asked of answered (see FbChain).

Constructors

MeanRiskResult(;    jr::JuMPOptimisationResult, r::BaseRM_VecBaseRM, fb::Option{<:OptE_Opt_FbChain}) -> MeanRiskResult

Keywords correspond to the struct's fields.

Related

source
PortfolioOptimisers.MeanRisk — Type
struct MeanRisk{__T_opt, __T_r, __T_obj, __T_wi, __T_fb} <: RiskJuMPOptimisationEstimator

Optimises one objective of risk and return over the portfolios that the constraints of a JuMP model admit.

obj selects the objective: MinimumRisk, MaximumReturn, MaximumUtility or MaximumRatio. r gives the risk measures, and opt gives the prior, the return terms, the solver and every other constraint. A risk measure whose settings.ub is a Frontier, or a return term whose settings.lb is one, makes the optimisation sweep the efficient frontier. The result then holds one portfolio for each point of the sweep.

Mathematical definition

obj selects one of four programmes over the same feasible set:

\[\begin{align} \text{MinimumRisk:} &\quad \underset{\boldsymbol{w}}{\min}\; R(\boldsymbol{w}) \quad \text{s.t.} \quad \boldsymbol{w} \in \mathcal{W}\,, \\ \text{MaximumReturn:} &\quad \underset{\boldsymbol{w}}{\max}\; \mathrm{ret} \quad \text{s.t.} \quad \boldsymbol{w} \in \mathcal{W}\,, \\ \text{MaximumUtility:} &\quad \underset{\boldsymbol{w}}{\max}\; \mathrm{ret} - l\, R(\boldsymbol{w}) \quad \text{s.t.} \quad \boldsymbol{w} \in \mathcal{W}\,, \\ \text{MaximumRatio:} &\quad \underset{\boldsymbol{w}}{\max}\; \frac{\mathrm{ret} - r_f}{R(\boldsymbol{w})} \quad \text{s.t.} \quad \boldsymbol{w} \in \mathcal{W}\,. \end{align}\]

$\mathcal{W}$ holds the ceilings $R_j(\boldsymbol{w}) \leq u_j$ of the risk measures and the floors $\mathrm{ret}_i \geq b_i$ of the return terms. The model solves the ratio in homogenised weights, and MaximumRatio states that programme and the degree of the risk that it reads.

A Frontier of $M$ points in the place of a ceiling $u_j$ or of a floor $b_i$ gives $M$ evenly spaced levels between two corner portfolios:

\[\begin{align} u_{j,m} &= c_j \left( g_j(R_j(\boldsymbol{w}^{-})) + \frac{m - 1}{M - 1} \left( g_j(R_j(\boldsymbol{w}^{+})) - g_j(R_j(\boldsymbol{w}^{-})) \right) \right)\,, \\ b_{i,m} &= \mathrm{ret}_i(\boldsymbol{w}^{-}) + \frac{m - 1}{M - 1} \left( \mathrm{ret}_i(\boldsymbol{w}^{+}_{i}) - \mathrm{ret}_i(\boldsymbol{w}^{-}) \right)\,, \\ \boldsymbol{w}^{-} &= \underset{\boldsymbol{w} \in \mathcal{W}_0}{\arg\min}\; R(\boldsymbol{w})\,, \\ \boldsymbol{w}^{+} &= \underset{\boldsymbol{w} \in \mathcal{W}_0}{\arg\max}\; \mathrm{ret}\,, \\ \boldsymbol{w}^{+}_{i} &= \underset{\boldsymbol{w} \in \mathcal{W}_0}{\arg\max}\; \mathrm{ret}_i\,. \end{align}\]

The two ends of a ceiling change places when the first end is the larger, so the levels always ascend. The model solves the programme of obj once at each combination of levels, so two frontiers of $M$ points each give $M^2$ portfolios.

Under MinimumRisk with a frontier on a return floor, each point has the minimum risk for its return or more. Under MaximumReturn with a frontier on a risk ceiling, each point has the maximum return for its risk or less. With the variance as the risk, these are the two equal definitions of the efficient set on page 82 of [32]. Page 87 of the same work states that the efficient set runs from the portfolio of minimum variance to the portfolio of maximum expected return. These two portfolios are the corners $\boldsymbol{w}^{-}$ and $\boldsymbol{w}^{+}$. Section 8.2 of [12] states the four programmes for a general convex risk measure.

Where:

  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\mathcal{W}$: Feasible weight set, the portfolios that the constraints of the optimiser admit.
  • $R(\boldsymbol{w})$: Portfolio risk. With many measures it is the scalarised risk of the model.
  • $\mathrm{ret}$: Return expression of the model, the model's :ret. It is the sum of the scaled expressions of the return terms whose rte is true.
  • $\mathrm{ret}_i$: Expression of return term $i$, the model's :ret_i, net of the charges that the term flags.
  • $l$: Risk aversion of the utility objective, the l field of MaximumUtility. It is non-negative.
  • $r_f$: Risk-free rate of the ratio objective, the rf field of MaximumRatio.
  • $R_j(\boldsymbol{w})$, $u_j$: Risk of measure $j$, and its ceiling settings.ub.
  • $b_i$: Floor of return term $i$, its settings.lb.
  • $M$: The N field of the Frontier.
  • $g_j$, $c_j$: The transform and the multiplier that the formulation of measure $j$ writes into the bound and the factor fields of the Frontier. The transform is the identity, the square root or the square, see FrontierBoundEstimator.
  • $\mathcal{W}_0$: The feasible set $\mathcal{W}$ without the ceilings and the floors that hold a Frontier.
  • $\boldsymbol{w}^{-}$, $\boldsymbol{w}^{+}$, $\boldsymbol{w}^{+}_{i}$: The corner portfolios of minimum risk, of maximum return, and of maximum return of term $i$.

Fields

  • opt: JuMP optimiser configuration.
  • r: Risk measure or vector of risk measures.
  • obj: Portfolio objective function.
  • wi: Initial portfolio weights for warm-starting the solver.
  • fb: Fallback result or estimator.

Constructors

MeanRisk(;    opt::JuMPOptimiser,    r::TD{<:RM_VecRM} = Variance(),    obj::TD{<:ObjectiveFunction} = MinimumRisk(),    wi::TD_Option{<:VecNum} = nothing,    fb::TDO_Option{<:OptE_Opt} = nothing) -> MeanRisk

Keywords correspond to the struct's fields. A field of the type TD, TD_Option or TDO_Option can hold a TimeDependent schedule in place of a static value. The risk measures, the objective, the initial weights and the fallback define the problem, so a cross-validation fold loop resolves them for each fold. An optimise outside a fold loop uses the static default of each field. The default of wi and of fb is nothing. So a scheduled fallback has no effect outside a fold loop, unless the schedule holds a default.

Validation

  • If r is a vector: !isempty(r).
  • If wi is provided: !isempty(wi).
  • A schedule in fb: bind !== :nearest.
  • The constructor refuses a risk expression that is identically zero under MinimumRisk and under MaximumRatio. Every feasible portfolio is optimal under the first, and the second is unbounded. A NoRisk measure gives such an expression, and so does settings.rke = false on every measure.
  • If r holds a DataBenchmarkTracking: opt.pe must not state x_src = ExcessSource(), see assert_data_benchmark_prior.
  • A part that states no source and reads the raw returns, beside a part that states x_src = ExcessSource(), logs one warning that names its path, see warn_raw_readers. The constructor then builds the estimator as configured.

Propagated parameters

factory passes its arguments on to these @fprop fields:

  • opt: Recursively updated through factory.
  • r: Recursively updated through factory.
  • fb: Recursively updated through factory.

View parameters

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

  • The method reads the returns matrix X as its third argument. When opt.pe holds a prior result, the method uses opt.pe.X in place of X. So the views of the children read the observations of the prior, and not the matrix of the caller.
  • opt and r recurse through port_opt_view with that matrix.
  • fb recurses through view_child with that matrix.
  • wi is sliced to the selected assets.
  • obj passes through unchanged.

Examples

julia> MeanRisk(; opt = JuMPOptimiser(; slv = Solver(; solver = nothing)))MeanRisk  opt ┼ JuMPOptimiser      │       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      │          │        x_src ┴ nothing      │      slv ┼ Solver      │          │          name ┼ String: ""      │          │        solver ┼ nothing      │          │      settings ┼ nothing      │          │     check_sol ┼ @NamedTuple{}: NamedTuple()      │          │   add_bridges ┴ Bool: true      │      cbe ┼ ConstraintBlock      │          │        wb ┼ WeightBounds      │          │           │   lb ┼ Float64: 0.0      │          │           │   ub ┴ Float64: 1.0      │          │      sbgt ┼ nothing      │          │      gbgt ┼ nothing      │          │        lt ┼ nothing      │          │        st ┼ nothing      │          │      lcse ┼ nothing      │          │       cte ┼ nothing      │          │    gcarde ┼ nothing      │          │   sgcarde ┼ nothing      │          │      smtx ┼ nothing      │          │     sgmtx ┼ nothing      │          │       slt ┼ nothing      │          │       sst ┼ nothing      │          │      sglt ┼ nothing      │          │      sgst ┼ nothing      │          │        tn ┼ nothing      │          │      sets ┼ nothing      │          │        tr ┼ nothing      │          │       ple ┼ nothing      │          │      ccnt ┼ nothing      │          │      cobj ┼ nothing      │          │        ss ┼ nothing      │          │      card ┼ nothing      │          │     scard ┼ nothing      │          │       l2c ┼ nothing      │          │       lpc ┼ nothing      │          │     linfc ┼ nothing      │          │        l1 ┼ nothing      │          │        l2 ┼ nothing      │          │        lp ┼ nothing      │          │      linf ┼ nothing      │          │      xbgt ┴ Bool: false      │      bgt ┼ Float64: 1.0      │     fees ┼ nothing      │      ret ┼ ArithmeticReturn      │          │   settings ┼ JuMPReturnsSettings      │          │            │   scale ┼ Float64: 1.0      │          │            │      lb ┼ nothing      │          │            │     rte ┼ Bool: true      │          │            │     fee ┼ Bool: true      │          │            │     mic ┴ Bool: true      │          │        ucs ┼ nothing      │          │         mu ┼ nothing      │          │   mtx_sqrt ┴ EigenFallbackSquareRoot()      │      sca ┼ nothing      │       sc ┼ Int64: 1      │       so ┼ Int64: 1      │   strict ┴ Bool: false    r ┼ Variance      │    settings ┼ RiskMeasureSettings      │             │   scale ┼ Float64: 1.0      │             │      ub ┼ nothing      │             │     rke ┴ Bool: true      │       sigma ┼ nothing      │        chol ┼ nothing      │          rc ┼ nothing      │         alg ┼ SquaredSOCRiskExpr()      │    mtx_sqrt ┼ EigenFallbackSquareRoot()      │   ratio_alg ┼ SquareRootRatio()      │      corner ┴ nothing  obj ┼ MinimumRisk()   wi ┼ nothing   fb ┴ nothing

Related

References

  • [32] H. Markowitz. Portfolio selection. The Journal of Finance 7, 77–91 (1952). Pages 82 and 87.
  • [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 8.2, Equations 8.7 and 8.10. Equations 8.12 and 8.13 for a general risk measure. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source
PortfolioOptimisers.factory — Method
factory(a, args...; kwargs...) -> a
factory(a::AbstractArray{<:Union{Nothing, AbstractEstimator, AbstractAlgorithm,
                                 AbstractResult, StatsBase.CovarianceEstimator}},
        args...; kwargs...) -> AbstractArray

Rebuild an estimator, an algorithm or a result with runtime values. These two methods are the leaf and the array step of the traversal.

factory and port_opt_view are the two propagation mechanisms of this library. factory passes runtime values, such as prior moments, observation weights and previous portfolio weights, down a tree of composed structs. port_opt_view passes an index selection, a subset of the assets, down the same tree.

factory is a traversal, so it owns the identity on every leaf, as fmap in Functors.jl and adapt_structure in Adapt.jl do. A value that has no method of its own comes back with no change: a data field, a scalar, nothing, a set of observation weights and a covariance estimator of StatsBase. So a @propagatable struct sends each @fprop field to factory directly, whatever the field holds.

The array method is the one forwarding contract for every propagation field that holds an array of estimators, algorithms, results or covariance estimators. It applies factory to each element, and it forwards args... and kwargs... with no change. A family that accepts an array of them needs no method of its own. A family that needs more than the forward defines its own, more specific method. A concrete element type, through concrete_typed_array_if_abstract, is an example. An array of data, such as a vector of numbers, is a leaf, and it comes back with no change and with no copy.

Algorithm

The leaf method:

  1. Return a with no change, and drop args... and kwargs.... This method is the leaf of the recursion. Because of it, a call of the verb on a type with no tags returns the value and raises no error.

The array method:

  1. For each element ai of a, call factory on ai, and forward args... and kwargs... with no change.
  2. Collect the results into a new array of the shape of a, in the order of a, and return it.

A @propagatable struct always has a generated method that is more specific than the leaf method. If the struct has at least one @fprop or @wprop field, that method builds the struct again with its keyword constructor. It sends each @fprop field through factory and each @wprop field through _wprop. If the struct has no such field, that method returns x.

The leaf method does not fill a nothing field. A weights field that must take the incoming weights when it holds nothing carries @wprop, and it goes to _wprop.

Arguments

  • a: Any value, which the leaf method returns with no change. For the array method, an array of estimators, algorithms, results, covariance estimators or nothing, which it rebuilds one element at a time.
  • args...: Positional arguments. The leaf method ignores them, and the array method forwards them.
  • kwargs...: Keyword arguments. The leaf method ignores them, and the array method forwards them.

Returns

  • a: The input with no change, for the leaf method.
  • v::AbstractArray: The rebuilt elements, in an array of the shape of a, for the array method.

Examples

julia> factory(nothing, 1, 2; x = 3)julia> factory([1.0, 2.0], 1, 2; x = 3)2-element Vector{Float64}: 1.0 2.0julia> factory(MeanValue())MeanValue  w ┴ nothing

Related

source
factory(res::NonFiniteAllocationOptimisationResult, fb::Option{<:OptE_Opt_FbChain})

Rebuilds a continuous optimisation result with a new fallback record fb.

A concrete result can add its own method when a rebuild needs more than a new fb. optimise is the one caller, and it gives the FbChain of the attempts that failed.

Algorithm

  1. Read every field of res, in the order of the struct.
  2. Call the constructor of the type of res with every field except the last, and with fb as the last field.

Validation

  • fb is the last field of the type of res. Every concrete optimisation result obeys this rule, so the method checks nothing.

Related

source
factory(
    opt::Union{NonFiniteAllocationOptimisationEstimator, NonFiniteAllocationOptimisationResult},
    _
) -> RelaxedRiskBudgeting{JuMPOptimiser{__T_pe, __T_slv, __T_cbe, __T_bgt, __T_fees, __T_ret, __T_sca, __T_sc, __T_so, __T_strict, __T_cache}, _A, _B, <:RelaxedRiskBudgetingAlgorithm} where {__T_pe, __T_slv, __T_cbe, __T_bgt, __T_fees, __T_ret, __T_sca, __T_sc, __T_so, __T_strict, __T_cache, _A, _B}

Returns opt unchanged.

This is the fallback factory of an optimisation estimator or result. An estimator whose parameters change at each step of an optimisation adds its own method. A precomputed result in a field of an estimator, for example in fb, reaches this method when factory gives the estimator the weights of the previous fold. A precomputed result does not change.

Related

source
PortfolioOptimisers.factory — Method
factory(a, args...; kwargs...) -> a
factory(a::AbstractArray{<:Union{Nothing, AbstractEstimator, AbstractAlgorithm,
                                 AbstractResult, StatsBase.CovarianceEstimator}},
        args...; kwargs...) -> AbstractArray

Rebuild an estimator, an algorithm or a result with runtime values. These two methods are the leaf and the array step of the traversal.

factory and port_opt_view are the two propagation mechanisms of this library. factory passes runtime values, such as prior moments, observation weights and previous portfolio weights, down a tree of composed structs. port_opt_view passes an index selection, a subset of the assets, down the same tree.

factory is a traversal, so it owns the identity on every leaf, as fmap in Functors.jl and adapt_structure in Adapt.jl do. A value that has no method of its own comes back with no change: a data field, a scalar, nothing, a set of observation weights and a covariance estimator of StatsBase. So a @propagatable struct sends each @fprop field to factory directly, whatever the field holds.

The array method is the one forwarding contract for every propagation field that holds an array of estimators, algorithms, results or covariance estimators. It applies factory to each element, and it forwards args... and kwargs... with no change. A family that accepts an array of them needs no method of its own. A family that needs more than the forward defines its own, more specific method. A concrete element type, through concrete_typed_array_if_abstract, is an example. An array of data, such as a vector of numbers, is a leaf, and it comes back with no change and with no copy.

Algorithm

The leaf method:

  1. Return a with no change, and drop args... and kwargs.... This method is the leaf of the recursion. Because of it, a call of the verb on a type with no tags returns the value and raises no error.

The array method:

  1. For each element ai of a, call factory on ai, and forward args... and kwargs... with no change.
  2. Collect the results into a new array of the shape of a, in the order of a, and return it.

A @propagatable struct always has a generated method that is more specific than the leaf method. If the struct has at least one @fprop or @wprop field, that method builds the struct again with its keyword constructor. It sends each @fprop field through factory and each @wprop field through _wprop. If the struct has no such field, that method returns x.

The leaf method does not fill a nothing field. A weights field that must take the incoming weights when it holds nothing carries @wprop, and it goes to _wprop.

Arguments

  • a: Any value, which the leaf method returns with no change. For the array method, an array of estimators, algorithms, results, covariance estimators or nothing, which it rebuilds one element at a time.
  • args...: Positional arguments. The leaf method ignores them, and the array method forwards them.
  • kwargs...: Keyword arguments. The leaf method ignores them, and the array method forwards them.

Returns

  • a: The input with no change, for the leaf method.
  • v::AbstractArray: The rebuilt elements, in an array of the shape of a, for the array method.

Examples

julia> factory(nothing, 1, 2; x = 3)julia> factory([1.0, 2.0], 1, 2; x = 3)2-element Vector{Float64}: 1.0 2.0julia> factory(MeanValue())MeanValue  w ┴ nothing

Related

source
factory(
    opt::Union{NonFiniteAllocationOptimisationEstimator, NonFiniteAllocationOptimisationResult},
    _
) -> RelaxedRiskBudgeting{JuMPOptimiser{__T_pe, __T_slv, __T_cbe, __T_bgt, __T_fees, __T_ret, __T_sca, __T_sc, __T_so, __T_strict, __T_cache}, _A, _B, <:RelaxedRiskBudgetingAlgorithm} where {__T_pe, __T_slv, __T_cbe, __T_bgt, __T_fees, __T_ret, __T_sca, __T_sc, __T_so, __T_strict, __T_cache, _A, _B}

Returns opt unchanged.

This is the fallback factory of an optimisation estimator or result. An estimator whose parameters change at each step of an optimisation adds its own method. A precomputed result in a field of an estimator, for example in fb, reaches this method when factory gives the estimator the weights of the previous fold. A precomputed result does not change.

Related

source
PortfolioOptimisers.port_opt_view — Method
port_opt_view(
    mr::MeanRisk,
    i,
    X::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
    args...
) -> MeanRisk{JuMPOptimiser{__T_pe, __T_slv, __T_cbe, __T_bgt, __T_fees, __T_ret, __T_sca, __T_sc, __T_so, __T_strict, __T_cache}} where {__T_pe, __T_slv, __T_cbe, __T_bgt, __T_fees, __T_ret, __T_sca, __T_sc, __T_so, __T_strict, __T_cache}

Return the view of a MeanRisk at the assets i.

The ## View parameters subsection of MeanRisk states how the method takes the view of each field.

Arguments

  • mr: The optimiser.
  • i: Indices of the assets that the view keeps.
  • X::MatNum: Returns matrix of the caller. The method uses the matrix of the prior in its place when mr.opt.pe holds a prior result.
  • args...: Not read.

Returns

  • MeanRisk: A new optimiser, built through the keyword constructor.

Related

source
PortfolioOptimisers._optimise — Function
_optimise(mr::MeanRisk, rd::ReturnsResult = ReturnsResult(); str_names::Bool = false,
          save::Bool = true, blocks::Tuple = (), kwargs...) -> MeanRiskResult

Build the model of a MeanRisk, solve it, and return its result.

optimise reaches this method through shared_series_solve, which drops the observations of a Shared Series gap before the solve.

Algorithm

  1. Replace each schedule of mr with its static default through reset_time_dependent_estimator.
  2. Resolve mr.opt against rd with resolve_jump_optimiser, with the blocks of blocks, giving attrs. It holds the prior, the block Results, the fees, the return terms and the Investable Mask.
  3. Take the view of mr and of rd at the investable assets with investable_view. Both are unchanged when every asset is investable.
  4. Bind the benchmark of each DataBenchmarkTracking measure to rd with bind_data_benchmark.
  5. Build the model with build_mean_risk_model, which adds every block.
  6. Under MaximumRatio, resolve each Frontier of the model on a model that is not homogenised, with resolve_ratio_frontier!, which adds every block too. Under every other objective this step does nothing.
  7. Solve with solve_mean_risk!, which sweeps a frontier when the model holds one, giving retcode and sol.
  8. Build the result. It holds attrs, retcode, sol, the model when save is true, and the risk measures resolved against the prior.

Arguments

  • mr::MeanRisk: The optimiser.
  • rd: The returns result to use. When mr.opt.pe is a prior result, the solve does not read rd. A fallback or a clustering step can still read it.
  • str_names::Bool: true gives each variable and each row of the model its string name.
  • save::Bool: true keeps the model in the result.
  • blocks::Tuple = (): The blocks after the block of the optimiser of the head, the keyword blocks of resolve_jump_optimiser. The head adds the rows of every block to its model with assemble_jump_model!. The fallback chain of optimise passes the keyword to each member, so a fallback solves on the same blocks.
  • kwargs...: Passed on to resolve_jump_optimiser.

Returns

  • MeanRiskResult: The result of the solve, or of the frontier sweep, with fb = nothing. optimise runs the fallback chain when the solve fails.

Related

source

References

[12]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
[32]
H. Markowitz. Portfolio Selection. The Journal of Finance 7, 77–91 (1952).