Allocation Algorithms
The allocation methods determine:
- How many particles we should attempt to have within each bin.
- How many offspring each particle should have.
In the methods included here, one first allocates the number of particles to each bin, and then uses multinomial resampling, within each bin, to determine how many offspring each particle should have.
Bin Allocation Methods
WeightedEnsemble.minimal_bin_allocation!
— Functionminimal_bin_allocation!(B; νmin=νmin)
Allocates a single particle to be spawned within each nonempty bin and the current number of particles in any bin with less than νmin total mass.
Arguments
B
- bin data structure
Optional Arguments
νmin=νmin
- minimal bin weight to avoid underflow
WeightedEnsemble.uniform_bin_allocation!
— Functionuniform_bin_allocation!(B, E, n_allocate; allocation_resampler=systematic, νmin=νmin)
Uniformly allocate particles amongst bins.
Arguments
B
- bin data structureE
- particle ensemblen_allocate
- number of particles to allocate
Optional Arguments
allocation_resampler=systematic
- resampling scheme amongst binsνmin=νmin
- minimal bin weight to avoid underflow
WeightedEnsemble.optimal_bin_allocation!
— Functionoptimal_bin_allocation!(B, E, v², t, n_allocate; allocation_resampler=systematic, νmin=νmin)
Optimally particles according to the bins, using a value function, v²
to approximate mutation variance.
Arguments
B
- bin data structureE
- particle ensemblev²
- v² variance function estimatort
- t-th seletion stepn_allocate
- number of particles to allocate
Optional Arguments
allocation_resampler=systematic
- resampling scheme amongst binsνmin=νmin
- minimal bin weight to avoid underflow
This function is defined in the spirit of the optimal allocation analysis of Aristoff & Zuckerman (2020).
WeightedEnsemble.targeted_bin_allocation!
— Functiontargeted_bin_allocation!(B::TB, E::TE, G::F, t::Int, n_allocate::Int; allocation_resampler=systematic, νmin=νmin) where {TE<:Ensemble,TB<:Bins,F<:Function}
Targeted allocation of particles amongst bins using a specified function, G:(p, E, B, t) → [0,∞)
for bin p
.
Arguments
B
- bin data structureE
- particle ensembleG
- target functiont
- t-th seletion stepn_allocate
- number of particles to allocateOptional Argumentsallocation_resampler=systematic
- resampling scheme amongst binsνmin=νmin
- minimal bin weight to avoid underflow
Particle Allocation Methods
WeightedEnsemble.within_bin_allocation!
— Functionwithin_bin_allocation!(E, B; within_bin_resampler=multinomial)
Once the number of offspring within each bin are set, allocate them amongst the particles within the bin. This assumes that the bin allocations of the bins have completed.
Arguments
E
- particle ensembleB
- bin data structure
Optional Arguments
within_bin_resampler=multinomial
- resampling scheme within bins
Utility Functions
WeightedEnsemble.trivial_allocation!
— Functiontrivial_allocation!(E, B)
Trivially allocate each particle to have one offspring.
Arguments
E
- particle ensembleB
- bin data structure