If you want the maths behind it, section 4 here explains it simply
Note compared to the link above, there is a further normalization factor (basically sum( w * prob)) in the equation that guarantees probabilities sum to 1.
If you want the maths behind it, section 4 here explains it simply
Note compared to the link above, there is a further normalization factor (basically sum( w * prob)) in the equation that guarantees probabilities sum to 1.