MultipleImportanceSampler.cpp File Reference
"Optimally" combines samples taken from multiple sampling distributions with respect to a function, 'f', whose value we are trying to integate over a given domain,'D'. D is assumed to be the union of the domains of the individual underlying distributions. The goal of importance sampling is to reduce variance while approximating the integral of f over D by drawing random samples across D according to some probability density function p which is proportional to f. By drawing more samples from the regions where f is large (concentrating our sampling effort on the "important" regions of the domain), and similarly drawing less samples from the regions where f is small (focusing less effort in the "unimportant" regions of the domain), the variance of our estimate overall is reduced, as long as we compensate for our uneven sampling rate by weighting each sample by the inverse probability with which it was sampled. Think of importance sampling this way: if we have only one shot at sampling f (only one sample because of very limited 'resources'), we would like to concentrate that one sample in the region of the domain that will contribute the most to the value of the integral we are ultimately trying to approximate. By biasing our sampling technique to weigh "important", "large" regions of the domain with respect to f, we get more bang for our buck and correspondingly end up with a much lower variance estimator. If we were to instead naively sample uniformly across the domain, D, there's a good chance that our one, precious sample would be wasted by sampling a location, x, that is unimportant, where f(x) is relatively small. A perfect estimator would take samples from a distribution p, across D, whose probabilities were distributed directly proportional to f. This is, however, unreasonable, since if we knew the exact values of f across D, we wouldn't have to approximate the integral of f over D in the first place. We can, however, still greatly reduce variance by using knowledge about f to guide our sampling process and instead, sample according to either an approximation of f, or possibly according to some factorization of f into separate functions f1, f2, etc, some of which may be easier to draw samples from. As long as our sampling process attempts to draw samples from areas in D where f is "known" to be large and avoids regions in D where f is "known" to be small, our sampler will be more efficient and our overall variance will be reduced. More...
#include "MultipleImportanceSampler.h"
#include "Sampler.h"
Go to the source code of this file.
Detailed Description
"Optimally" combines samples taken from multiple sampling distributions with respect to a function, 'f', whose value we are trying to integate over a given domain,'D'. D is assumed to be the union of the domains of the individual underlying distributions. The goal of importance sampling is to reduce variance while approximating the integral of f over D by drawing random samples across D according to some probability density function p which is proportional to f. By drawing more samples from the regions where f is large (concentrating our sampling effort on the "important" regions of the domain), and similarly drawing less samples from the regions where f is small (focusing less effort in the "unimportant" regions of the domain), the variance of our estimate overall is reduced, as long as we compensate for our uneven sampling rate by weighting each sample by the inverse probability with which it was sampled. Think of importance sampling this way: if we have only one shot at sampling f (only one sample because of very limited 'resources'), we would like to concentrate that one sample in the region of the domain that will contribute the most to the value of the integral we are ultimately trying to approximate. By biasing our sampling technique to weigh "important", "large" regions of the domain with respect to f, we get more bang for our buck and correspondingly end up with a much lower variance estimator. If we were to instead naively sample uniformly across the domain, D, there's a good chance that our one, precious sample would be wasted by sampling a location, x, that is unimportant, where f(x) is relatively small. A perfect estimator would take samples from a distribution p, across D, whose probabilities were distributed directly proportional to f. This is, however, unreasonable, since if we knew the exact values of f across D, we wouldn't have to approximate the integral of f over D in the first place. We can, however, still greatly reduce variance by using knowledge about f to guide our sampling process and instead, sample according to either an approximation of f, or possibly according to some factorization of f into separate functions f1, f2, etc, some of which may be easier to draw samples from. As long as our sampling process attempts to draw samples from areas in D where f is "known" to be large and avoids regions in D where f is "known" to be small, our sampler will be more efficient and our overall variance will be reduced.
- Date:
- Fall 2008
- Note:
- for more information and theoretical details, see Veach and Guibas. Optimally Combining Sampling Techniques for Monte Carlo Rendering. In Proceedings of the 22nd Annual Conference on Computer Graphics and interactive Techniques S.G. Mair and R. Cook, Eds. SIGGRAPH '95. ACM, New York, NY, 419-428.
Definition in file MultipleImportanceSampler.cpp.
Generated on 28 Feb 2009 for Milton by
1.5.6