Variance reduction overview

From CGAFaq

Jump to: navigation, search

Contents

Variance reduction

Photographs are created when small points of light (photons) are recorded on film. When too few photons hit the film to adequately describe the image, the photo appears noisy (see images on the right). A similar phenomenon occurs with ray traced images: if we don't cast enough rays, we see noise.

In rendering, (and specifically, Monte Carlo ray tracing) variance reduction refers to reducing the amount of noise in an image. The most obvious variance reduction technique is to simply record more samples - this is analogous to leaving the shutter open longer on a camera (and thus using lower speed film). However, we would rather reduce variance without taking extra time to render the image.

custom essay writing

Photograph with high variance.
Photograph with high variance.
Similar photograph with lower variance.
Similar photograph with lower variance.

What is variance?

In the context of Monte Carlo integration, variance is related to how different we expect any given sample to be from the correct value for our integral. In general, variance is expressed as

where is a random variable, gives the expected value of a random variable, and is the variance.

A random variable can be thought of as a function which produces random values. However, different random variables may produce these values in different quantities. For instance, a function which gives the color of a random square on a checkerboard will produce black half of the time, white half of the time, and never produce any other color. A function which gives the color of random points on a rainbow, on the other hand, will have some chance of producing any color. (The behavior of a particular random variable is expressed by its probability density function or pdf.)

The expected value then tells us what the value of a random variable will be on average. For the checkerboard example above, the expected value would be the color gray. (Notice that the expected value does not have to be a value that the random variable itself can produce.) The variance would tell us how different the color of a square is from gray on average. Since none of the squares are actually gray, this variance would be relatively large.

In terms of our rendering integral, often refers to measurements made by casting rays out in random directions from a single location. For example, might represent irradiance estimates at a point on a surface made by casting rays in random directions from that point. The expected value would correspond to the actual irradiance at that point, and the variance tells us how varied the lighting is over the surrounding hemisphere.

Variance reduction... Variance of what?

In the above examples, the variance of the random variable we were sampling was always fixed. There would be no way to reduce, e.g., the variance of colors sampled from a checkerboard, since half are always black and half are always white.

The variance in variance reduction refers to reducing the variance of an estimator for an integral's value, and not the variance of the function being integrated. Suppose we have a Monte Carlo estimator of the form

where is the number of samples and is a random variable which tells us where to pick samples from , the function we're integrating. (The function is the probability density function of , and is there just to ensure that values from every region of are equally represented in the estimate.)

The important thing to notice is that itself is a random variable, and thus has a variance. This variance is what we want to minimize. Since is what ultimately gives us our answer, we'd like to be confident that our answer is correct, i.e., we'd like its variance to be small. Also note that, unlike the random variables we were sampling earlier, we have some flexibility in how we define . This flexibility is what allows us to change (and hopefully reduce) the variance of our estimate.

Variance Reduction Techniques

Read more about essay writing help offered by a professional company. As mentioned before, one way to reduce the variance of is to simply take more samples (make bigger). A more efficient way to reduce variance (and one which is common in rendering) is to put many samples in regions where is large and few samples in regions where is small. This technique is known as importance sampling. Some other major techniques which show up in rendering are stratified sampling and the method of control variates.

Personal tools