Generic cumulative sum
Calculate the empirical cumulative distribution function for a collection of weights
Given a vector of log-likelihoods, normalise them and exp them without overflow
Given a list of ordered doubles, k, find the element at the corresponding position in the empirical cumulative distribution function represented by a treeMap
Multinomial Resampling, sample from a categorical distribution with probabilities equal to the particle weights
Given a vector of doubles, returns a normalised vector with probabilities summing to one
Given a vector of doubles, returns a normalised vector with probabilities summing to one
a vector of unnormalised probabilities
a vector of normalised probabilities
Residual Resampling Select particles in proportion to their weights, ie particle (xi, wi) appears ki = n * wi times Resample m = n - total allocated particles particles according to w = n * wi - ki, using other resampling technique
Sample unifomly without replacement
Sample one thing, uniformly, from a collection F
Stratified resampling implemented using a TreeMap Sample n ORDERED uniform random numbers (one for each particle) using a linear transformation of a U(0,1) RV
An efficient implementation of systematic resampling
Create an empirical cumulative distribution function from a set of particles and associated weights, and represent it as a treeMap