Efficient Weighted Sampling // A Random Walk Through Geek-Space
Here’s a really simple and cheap way to do importance sampling that I came across a few months ago (while learning about particle filters, incicentally). It’s simple enough that I have no idea how I went so long without ever knowing about it! In case anyone else is in the same boat - let me walk you through it. Let’s say you have an array of N values, and an associated array of N weights and you want to randomly sample your input values such that the probability of each value being chosen is proportional to its weight. There are many ways of doing that, but I’d like to focus on a particularly efficient approach (it’s O(N) with a relatively small constant factor). Imagine laying out 8 input values in a row like this, where their weights correspond to their width in the diagram. Now, to select 8 weighted samples we could line up another row of evenly spaced “cells” below the first one, corresponding to our chosen samples (modulo my poor mspaint skills). To pick our samples, we could just
Efficient Weighted Sampling // A Random Walk Through Geek-Space A Random Walk Through Geek-Space Brain dumps and other ramblings from Sebastian Sylvan Efficient Weighted Sampling 28 / Jan 2017 Here's a really simple and cheap way to do importance sampling that I came across a few months ago (while learning about particle filters , incicentally). It's simple enough that I have no idea how I went so long without ever knowing about it! In case anyone else is in the same boat - let me walk you through it. Let's say you have an array of N values, and an associated array of N weights and you want to
Explore this link on the map →saved by
related reading
- Importance Sampling Explained | Built Inbuiltin.com
- Importance Samplingpbr-book.org
- Inverse transform sampling - Wikipediaen.wikipedia.org
- Visualizing Algorithmsbost.ocks.org
- Competing with sampling — Alignment Research Centeralignment.org
- ARC progress update: Competing with sampling — LessWronglesswrong.com
- The Power of Noise — LessWronglesswrong.com
- An optimization perspective on log-concave sampling and beyond | Sinho Chewichewisinho.github.io
- Randomized weighted majority algorithm - Wikipediaen.wikipedia.org
- [2411.13462] Sampling and Integration of Logconcave Functions by Algorithmic Diffusionarxiv.org
- Sampling Bias: Types, Examples & How to Avoid Itsimplypsychology.org
- Introduction to Probability by Joseph K. Blitzstein, Jessica Hwang (z-lib.org).pdfuni.dcdev.ro