Skip to content
13

Subset resampling

PortfolioOptimisers.BaseSubsetResamplingOptimisationEstimator Type
julia
abstract type BaseSubsetResamplingOptimisationEstimator <: NonFiniteAllocationOptimisationEstimator

Abstract supertype for subset resampling portfolio optimisation estimators.

Related Types

source
PortfolioOptimisers.SubsetResamplingResult Type
julia
struct SubsetResamplingResult{__T_oe, __T_pr, __T_wb, __T_fees, __T_ress, __T_idx, __T_retcode, __T_w, __T_fb} <: NonFiniteAllocationOptimisationResult

Result type for Subset Resampling portfolio optimisation.

Fields

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

  • pr: Prior result used in optimisation.

  • wb: Weight bounds applied.

  • fees: Fee structure applied (or nothing).

  • ress: Vector of sub-optimisation results for each subset.

  • idx: Subset index vector.

  • retcode: Overall return code.

  • w: Aggregated optimal portfolio weights.

  • fb: Fallback result.

Related

source
PortfolioOptimisers.SubsetResampling Type
julia
struct SubsetResampling{__T_pe, __T_wb, __T_fees, __T_sets, __T_scale, __T_opt, __T_wf, __T_ex, __T_subset_size, __T_n_subsets, __T_max_comb, __T_rng, __T_seed, __T_fb, __T_brt, __T_strict} <: BaseSubsetResamplingOptimisationEstimator

Subset Resampling portfolio optimiser.

SubsetResampling applies a resampling strategy by optimising a base optimiser (opt) over randomly drawn subsets of assets, then aggregating the results into a final portfolio weight vector. This improves robustness of portfolio weights to estimation error.

Fields

  • pe: Prior estimator or prior result.

  • wb: Weight bounds estimator or bounds.

  • fees: Fee estimator or fee structure.

  • sets: Asset sets.

  • scale: Optional scaling vector for inner optimiser weights (length must match opti).

  • opt: Base portfolio optimiser applied to each subset.

  • wf: Weight finaliser for enforcing bounds.

  • ex: FLoops executor for parallelism.

  • subset_size: Size of each subset (integer or fraction of total assets).

  • n_subsets: Number of subsets to draw.

  • max_comb: Maximum number of asset combinations to consider.

  • rng: Random number generator.

  • seed: Optional RNG seed for reproducibility.

  • fb: Fallback optimiser.

  • brt: If true, uses bootstrap returns.

  • strict: If true, strictly enforces weight bounds.

Constructors

julia
SubsetResampling(;
    pe::PrE_Pr = EmpiricalPrior(),
    wb::Option{<:WbE_Wb} = nothing,
    fees::Option{<:FeesE_Fees} = nothing,
    sets::Option{<:AssetSets} = nothing,
    scale::Option{<:VecNum} = nothing,
    opt::NonFiniteAllocationOptimisationEstimator,
    wf::WeightFinaliser = IterativeWeightFinaliser(),
    ex::FLoops.Transducers.Executor = FLoops.ThreadedEx(),
    subset_size::SubsetSizeE = 0.5,
    n_subsets::NumberSubsetsE = 100,
    max_comb::Integer = 1000,
    rng::Random.AbstractRNG = Random.default_rng(),
    seed::Option{<:Integer} = nothing,
    fb::Option{<:OptE_Opt} = nothing,
    brt::Bool = false,
    strict::Bool = false
) -> SubsetResampling

Keywords correspond to the struct's fields.

Related

source
PortfolioOptimisers.optimise Function
julia
optimise(sr::SubsetResampling{<:Any, <:Any, <: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...) -> SubsetResamplingResult

Arguments

  • sr: The subset resampling optimiser to use.

  • rd: The returns result to use.

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

  • branchorder: Passed to the internal optimiser. The branch order to use for the clusterisation.

  • str_names: Passed to the internal optimiser. Whether to use string names for the assets in the optimisation.

  • save: Passed to the internal optimiser. Whether to save the JuMP model in the optimisation result.

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

source