Skip to content
13

Nested Clustered

PortfolioOptimisers.NestedClusteredResult Type
julia
struct NestedClusteredResult{__T_oe, __T_pr, __T_clr, __T_wb, __T_fees, __T_resi, __T_reso, __T_cv, __T_retcode, __T_w, __T_fb} <: NonFiniteAllocationOptimisationResult

Result type for Nested Clustered Optimisation.

Fields

  • oe: Type of the optimisation estimator that produced this result.

  • pr: Prior result used in optimisation.

  • clr: Clustering result.

  • wb: Weight bounds applied.

  • fees: Fee structure applied (or nothing).

  • resi: Inner (intra-cluster) optimisation results.

  • reso: Outer (inter-cluster) optimisation result.

  • cv: Cross-validation result (or nothing).

  • retcode: Overall optimisation return code.

  • w: Final aggregated portfolio weights.

  • fb: Fallback result.

Related

source
PortfolioOptimisers.NestedClustered Type
julia
struct NestedClustered{__T_pe, __T_cle, __T_wb, __T_fees, __T_sets, __T_opti, __T_opto, __T_cv, __T_wf, __T_ex, __T_fb, __T_brt, __T_cle_pr, __T_strict} <: ClusteringOptimisationEstimator

Nested Clustered Optimisation (NCO) portfolio optimiser.

NestedClustered implements the Nested Clustered Optimisation algorithm. It first clusters assets, then solves a within-cluster (inner) optimisation for each cluster independently, and finally solves an across-cluster (outer) optimisation to combine the cluster portfolios into a final portfolio.

Fields

  • pe: Prior estimator or prior result.

  • cle: Clustering estimator or clustering result.

  • wb: Weight bounds estimator or bounds.

  • fees: Fee estimator or fee structure.

  • sets: Asset sets.

  • opti: Inner (intra-cluster) portfolio optimiser.

  • opto: Outer (inter-cluster) portfolio optimiser.

  • cv: Cross-validation configuration for model selection.

  • wf: Weight finaliser for enforcing bounds.

  • ex: FLoops executor for parallelism.

  • fb: Fallback optimiser.

  • brt: If true, uses bootstrap returns.

  • cle_pr: If true, passes the prior result to the clustering estimator.

  • strict: If true, strictly enforces weight bounds.

Constructors

julia
NestedClustered(;
    pe::PrE_Pr = EmpiricalPrior(),
    cle::ClE_Cl = ClustersEstimator(),
    wb::Option{<:WbE_Wb} = WeightBounds(),
    fees::Option{<:FeesE_Fees} = nothing,
    sets::Option{<:AssetSets} = nothing,
    opti::NonFiniteAllocationOptimisationEstimator,
    opto::NonFiniteAllocationOptimisationEstimator = opti,
    cv::Option{<:OptimisationCrossValidation} = nothing,
    wf::WeightFinaliser = IterativeWeightFinaliser(),
    ex::FLoops.Transducers.Executor = FLoops.ThreadedEx(),
    fb::Option{<:OptE_Opt} = nothing,
    brt::Bool = false,
    cle_pr::Bool = true,
    strict::Bool = false
) -> NestedClustered

Keywords correspond to the struct's fields.

Related

source
PortfolioOptimisers.predict_outer_nco_estimator_returns Function

Overload this using nco.cv for custom cross-validation prediction

source
PortfolioOptimisers.optimise Method
julia
optimise(nco::NestedClustered{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any,
                  <:Any, <:Any, <:Any, Nothing
              }, rd::ReturnsResult;
         dims::Int = 1, branchorder::Symbol = :optimal, str_names::Bool = false,
         save::Bool = true, kwargs...) -> NestedClusteredResult

Arguments

  • nco: The nested clustered optimiser to use.

  • rd: The returns result to use.

  • dims: The dimension along which observations advance in time.

  • branchorder: Passed to the inner and outer optimisers. If this optimiser uses hierarchical clustering, this applies to the clusterisation. The branch order to use for the clusterisation.

  • str_names: Passed to the inner and outer optimisers. Whether to use string names for the assets in the optimisation.

  • save: Passed to the inner and outer optimisers. Whether to save the JuMP model in the optimisation result.

  • kwargs: Additional keyword arguments passed to the optimisation function.

source