Data Structures for Weighted Ensemble

Ensembles

WeightedEnsemble.EnsembleType
Ensemble{TP, TF<:AbstractFloat, TI<:Integer, TD}

A particle ensemble structure designed for WE with bins.

Fields

  • ξ̂ - particle positions after selection, before mutation
  • ξ - particle positions after mutation
  • ω̂ - partice weights after selection, before mutation
  • ω - partice weights after mutation
  • - particle bin after selection, before mutation
  • b - particle bin after mutation
  • o - number of offspring of the particle
  • - auxiliary data for each particle after selection, before mutation
  • d - auxiliary data for each particle, after mutation
source

The ensemble data structure holds the information about $\{(\omega_t^{(i)}, \xi_t^{(i)}\}$, along with the post selection step $\{(\hat{\omega}_t^{(i)}, \hat{\xi}_t^{(i)}\}$. Fo convenience, it also carries information about the bin the particle currently resides in. The structures d and are optional for carrying any auxiliary information.

Several convenience constructors have been included.

WeightedEnsemble.EnsembleMethod
Ensemble(X, n_particles)

Construct an ensemble of n_particles with all particles in the state X with uniform weights.

Arguments

  • X - state to be assigned to all particles
  • n_particles - size of ensemble
source
WeightedEnsemble.EnsembleMethod
Ensemble(X)

Construct an ensemble with particles in the states specified in vector X with uniform weights.

Arguments

  • X - array of states at which to initialize the particles
source
WeightedEnsemble.EnsembleMethod
Ensemble(X, ω)

Construct an ensemble with particles in the states specified in vector X with weights specified in vector ω

Arguments

  • X - array of states at which to initialize the particles
  • ω - array of weights at which to initialize the particles
source

As an example, if our problem is posed in $\mathbb{R}$, an initial ensemble could be constructed:

x0 = [-1.0];
n_particles = 100;
E0 = Ensemble(x0, n_particles);

This initializes the bin id field, b, to zeros. It will be neccessary to either manually assign this field, or to call the user defined rebin! function:

rebin!(E0, B0, 0);

Bins

WeightedEnsemble.BinsType
Bins{TS, TW, TBI, TT}

A bin structure designed for WE

Fields

  • Ω - structure containing information for uniquely identifying each bin
  • n - number of particles in each bin
  • target - target number of particles in each bin
  • ν - weight of each bin
  • d - auxiliary bin data
source

In addition to defining the Bins data strucutre, it will also be essential to provide:

  • bin_id(x) - This maps points in the state space to an integer indexing fo the bins.
  • rebin!(E, B, t) - This determines the bin of each particle, records this in the ensemble E.b field, sums the weights of all particles within the bins, and updates this in the bins B.ν field. This may be time dependent.

Several tools have been provided to simplify the construction of the bins.

WeightedEnsemble.Points_to_BinsFunction
Points_to_Bins(points; d = Nothing())

Convenience function for constructing a bin structure identified by a sequence of points.

Arguments

  • points - An array of points that can be used to define Voronoi cells

Optional Arguments

  • d = Nothing()) - optional auxliary data ``
source

This is useful if the bins can be sensibily identified with a set of points in the state space, as in the case of a Voronoi tesselation. Indeed, as Voronoi tesselations are often used, we have

WeightedEnsemble.setup_Voronoi_binsFunction
setup_Voronoi_bins(voronoi_pts; d = Nothing())

Convenience function for constructing bins, a bin id function, and a rebinning function based on a set of Voronoi points

Arguments

  • voronoi_pts - User specified Voronoi cell centers

Optional Arguments

  • d = Nothing()) - optional auxliary data
source

As an example, suppose our Voronoi bins are points in $\mathbb{R}^2$, then the following code will produce all the needed functions:

voronoi_centers = [[-1.0, -2.0], [2.0, 1.0], [1.0, 0.]];
B0, bin_id, rebin! = setup_Voronoi_bins(voronoi_centers);

Samplers

WeightedEnsemble.WEsamplerType
WEsampler(mutation!, selection!, rebin!; analysis! = trivial_analysis!)

Arguments

  • mutation! - mutation step
  • selection! - selection step
  • rebin! - rebinning step

Optional Arguments

  • analysis! = trivial_analysis! - analysis step
source