Subset resampling: private API

PortfolioOptimisers.BaseSubsetResamplingOptimisationEstimatorType
abstract type BaseSubsetResamplingOptimisationEstimator <: NonFiniteAllocationOptimisationEstimator

Abstract supertype for subset resampling portfolio optimisation estimators.

A subset resampling estimator draws random asset subsets, solves one base optimiser on each, and averages the answers back into the full universe. The averaging is what damps the estimation error a single full-universe solve would carry through.

Related

References

  • [144] W. Shen and J. Wang. Portfolio selection via subset resampling. In: Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence (2017); pp. 1517–1523.
source
PortfolioOptimisers.reset_time_dependent_estimatorMethod
reset_time_dependent_estimator(
    opt::SubsetResampling
) -> SubsetResampling

Replace this meta-optimiser's own time-dependent fields with their static defaults.

Deliberately does not recurse into the wrapped optimisers: a standalone meta solve consumes inner per-fold schedules through its inner cross-validation leg, and its fold-less full-window inner solves reset themselves at their own _optimise seam. Only the meta's own fields (applied to the combined weights, resolved by an outer fold loop when one exists) are inert here. A bind = :nearest schedule in a field the meta hands across its own inner fold loop (see inner_fold_fields) is likewise left in place — resetting it here would replace it with its default before the inner cross-validation ever saw it.

source
PortfolioOptimisers.subset_resampling_finaliserFunction
subset_resampling_finaliser(N::Integer, n_subsets::Integer, asset_idx::MatNum,
                            wb::Option{<:WeightBounds}, wf::WeightFinaliser,
                            ress::VecOpt, w::VecNum_VecVecNum)

Average the subset weights back into the full universe and finalise them against the bounds.

Implements the averaging step of SubsetResampling: each subset's weights are added into the full $N$-asset vector at that subset's indices, the sum is divided by n_subsets, and the average passes through finalise_weight_bounds.

Arguments

  • N::Integer: Total number of assets in the universe.
  • n_subsets::Integer: Number of asset subsets.
  • asset_idx::MatNum: Asset indices, one column per subset.
  • wb::Option{<:WeightBounds}: Weight bounds to finalise against, or nothing.
  • wf::WeightFinaliser: Weight finaliser to repair a bounds violation with.
  • ress::VecOpt: Subset optimisation results, in the column order of asset_idx.
  • w::VecNum_VecVecNum: The first subset's weights. Its shape alone selects the method: a vector of vectors dispatches to the efficient-frontier route, which finalises each frontier point on its own.

Returns

  • retcode: The aggregate return code from subset_resampling_retcode, or a vector of them on the frontier route.
  • w: The averaged and finalised weights, or a vector of them on the frontier route.

Related

source
PortfolioOptimisers.subset_resampling_retcodeFunction
subset_resampling_retcode(ress::VecOpt, retcode::OptimisationReturnCode)

Aggregate the subset optimisation return codes with the weight-finalisation return code.

Returns retcode unchanged when every subset optimisation succeeded; otherwise returns an OptimisationFailure whose res is a named tuple (; msg, opti, wb) carrying the failure summary, the subset optimisation return codes, and the weight-finalisation return code (including their solver trial diagnostics).

Related

source
PortfolioOptimisers.subset_resampling_td_defaultsFunction
subset_resampling_td_defaults(

) -> @NamedTuple{pe::EmpiricalPrior{PortfolioOptimisersCovariance{Covariance{SimpleExpectedReturns{Nothing, Nothing, Nothing}, GeneralCovariance{SimpleCovariance, Nothing, Nothing}, FullMoment, Nothing, Nothing, Nothing}, MatrixProcessing{Posdef{UnionAll, @NamedTuple{}}, Nothing, Nothing, Nothing, NTuple{4, Symbol}}, Nothing}, SimpleExpectedReturns{Nothing, Nothing, Nothing}, Nothing, Nothing, Nothing, Nothing}, opt::NoDefault, wf::IterativeWeightFinaliser{Int64}, subset_size::Float64, n_subsets::Int64}

Return the static defaults of the SubsetResampling fields that may hold a TimeDependent.

Shared by the constructor's test-substitution pass and time_dependent_field_defaults. The optimiser-valued field opt is required and has no static default, so it is marked NoDefault: a schedule there must carry its own default to be usable outside a fold loop. pe, wf, subset_size and n_subsets reset to their keyword defaults; fields whose static default is nothing (wb, fees, sets, fb) are omitted.

Related

source

References

[144]
W. Shen and J. Wang. Portfolio selection via subset resampling. In: Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence (2017); pp. 1517–1523.