Multiple Randomised Cross Validation
PortfolioOptimisers.SubsetSizeEstimator Type
abstract type SubsetSizeEstimator <: AbstractEstimatorAbstract supertype for estimators that determine the size of each asset subset.
Related
sourcePortfolioOptimisers.NumberSubsetsEstimator Type
abstract type NumberSubsetsEstimator <: AbstractEstimatorAbstract supertype for estimators that determine the number of random subsets to draw.
Related
sourcePortfolioOptimisers.WindowSizeEstimator Type
abstract type WindowSizeEstimator <: AbstractEstimatorAbstract supertype for estimators that determine the rolling window size.
Related
sourcePortfolioOptimisers.SubsetSizeEC Type
const SubsetSizeECUnion of SubsetSizeEstimator subtypes and plain functions that compute a subset size from a returns dataset.
PortfolioOptimisers.NumberSubsetsEC Type
const NumberSubsetsECUnion of NumberSubsetsEstimator subtypes and plain functions that compute the number of subsets from a returns dataset.
PortfolioOptimisers.WindowSizeEC Type
const WindowSizeECUnion of WindowSizeEstimator subtypes and plain functions that compute a window size from a returns dataset.
PortfolioOptimisers.SubsetSizeE Type
const SubsetSizeEUnion of a concrete subset-size value or an estimator/function for it.
sourcePortfolioOptimisers.NumberSubsetsE Type
const NumberSubsetsEUnion of a concrete number-of-subsets value or an estimator/function for it.
sourcePortfolioOptimisers.WindowSizeE Type
const WindowSizeEUnion of a concrete window-size value or an estimator/function for it.
sourcePortfolioOptimisers.MultipleRandomised Type
struct MultipleRandomised{__T_cv, __T_subset_size, __T_n_subsets, __T_max_comb, __T_window_size, __T_rng, __T_seed} <: NonOptimisationSequentialCrossValidationEstimatorCross-validation scheme that draws multiple random asset subsets and applies a walk-forward estimator to each. Each combination of a random asset subset and a set of walk-forward folds forms one path.
Fields
cv::WalkForwardEstimator: Walk-forward estimator applied within each asset subset.subset_size::SubsetSizeE: Size of each asset subset (integer count, fraction of total, or callable).n_subsets::NumberSubsetsE: Number of random subsets to draw.max_comb::Integer: Maximum number of combinations to enumerate exactly. When the total number of combinations exceeds this limit an approximate sampling approach is used.window_size::Option{<:WindowSizeE}: Optional rolling observation window. When set, each subset uses a randomly chosen contiguous window of this length.rng::Random.AbstractRNG: Random number generator.seed::Option{<:Integer}: Optional random seed.
Constructors
MultipleRandomised(
cv::WalkForwardEstimator;
subset_size::SubsetSizeE = 1,
n_subsets::NumberSubsetsE = 2,
max_comb::Integer = 1_000_000_000,
window_size::Option{<:WindowSizeE} = nothing,
rng::Random.AbstractRNG = Random.default_rng(),
seed::Option{<:Integer} = nothing
) -> MultipleRandomisedRelated
sourcePortfolioOptimisers.MultipleRandomisedResult Type
struct MultipleRandomisedResult{__T_train_idx, __T_test_idx, __T_asset_idx, __T_path_ids} <: NonOptimisationSequentialCrossValidationResultStores the split result produced by MultipleRandomised. Contains the training, test, and asset index sets for every fold across all random paths, along with a path identifier for each fold.
Fields
train_idx::VecVecInt: Training observation indices per fold.test_idx::VecVecInt: Test observation indices per fold.asset_idx::VecVecInt: Asset column indices per fold.path_ids::VecInt: Path identifier for each fold.
Related
sourceBase.split Method
Base.split(mrcv::MultipleRandomised, rd::ReturnsResult) -> MultipleRandomisedResultSplit the returns data rd by drawing multiple random asset subsets and applying the internal walk-forward estimator to each subset. Each combination of a random asset subset and a set of walk-forward folds forms one path.
Arguments
mrcv::MultipleRandomised: Multiple randomised cross-validation estimator.rd::ReturnsResult: Returns data to split.
Returns
MultipleRandomisedResult: Result containing training, test, and asset indices for every fold across all random paths, together with a path identifier for each fold.
Related
sourcePortfolioOptimisers.path_fit_and_predict Function
path_fit_and_predict(opt, rd, train_idx, test_idx, cols; ex, id)Fit and predict along a sequence of (train, test, asset) triples, respecting sequential constraints.
Handles sequential and parallel execution. If the optimiser requires previous weights or is time-dependent, runs sequentially and passes weights/state between periods. Otherwise, runs in parallel using the provided executor.
Arguments
opt::NonFiniteAllocationOptimisationEstimator: Portfolio optimisation estimator.rd::ReturnsResult: Full returns data.train_idx: Sequence of training index vectors.test_idx: Sequence of test index vectors.cols: Sequence of asset column indices for each fold.ex::FLoops.Transducers.Executor: Executor for parallel processing.id: Optional path identifier.
Returns
MultiPeriodPredictionResultwith predictions sorted by test index.
Related
source