Skip to content
18

Meta optimisation

PortfolioOptimisers.outer_optimisation_finaliser Function
julia
outer_optimisation_finaliser(wb, wf, w_inner, w_outer)

Finalise outer optimisation weights for the NCO algorithm.

Combines inner cluster weights w_inner with outer portfolio weights w_outer, applying weight bounds wb and finalisation algorithm wf.

Arguments

  • wb: Weight bounds (optional).

  • wf: Weight finaliser.

  • w_inner: Inner (within-cluster) weights.

  • w_outer: Outer (across-cluster) weights.

Returns

  • (retcode, w): Final combined portfolio weights and return code. On failure of any sub-problem, retcode is an OptimisationFailure whose res is a named tuple (; msg, opti, opto, wb) carrying the failure summary, the inner optimisation return codes, the outer return code, and the weight-finalisation return code (including their solver trial diagnostics).

Related

source
PortfolioOptimisers.prepare_outer_rd Function
julia
prepare_outer_rd(
    rd::ReturnsResult,
    wi::AbstractMatrix{<:Union{var"#s29", var"#s28"} where {var"#s29"<:Number, var"#s28"<:AbstractJuMPScalar}}
) -> Tuple{Any, Any, Any, Any, Matrix}

Prepares the ReturnsResult for outer optimisation, applying the inner cluster weights wi to the returns matrix rd.B, and adjusting the independent variable matrices rd.iv and rd.ivpa accordingly.

Arguments

  • rd: ReturnsResult containing the returns data.

  • wi: Inner weights matrix.

Returns

  • nb: New names for the benchmark returns columns after applying inner weights (if rd.B is a matrix).

  • B: Adjusted benchmarkreturns matrix after applying inner weights (if rd.B is a matrix).

  • iv: Adjusted independent variable matrix (if present).

  • ivpa: Adjusted independent variable per asset matrix (if present).

  • X: Buffer for the outer returns matrix.

Related

source
PortfolioOptimisers.rebuild_returns_result Function
julia
rebuild_returns_result(rd, predictions)

Reconstruct a returns result from cross-validation predictions.

Combines individual fold predictions from predictions into a new ReturnsResult corresponding to the original data layout.

Arguments

Returns

Related

source