Overview
weighted resample
Weighted resampling occurs when you want the resampling algorithm to favor certain datapoints over others. In such a case, you create an array of weights (must sum to 1) and pass that set of weights to the weightedResample method. In the following example, the resampling method chooses the number 4 with a probability of 80% and the numbers 1 and 2, each with a probability of 10%.
The weight array must have the same length as the data array, and its values must sum to one (plus or minus and floating point errors.)