<p>The hemispherical intensity function, i.e. the hemispherical function of incident light multiplied by the BRDF, correlates to the number of samples required per solid angle. Take the sample distribution of any method and compare it to that hemispherical function. The more similar they are, the better the method is in that particular case.</p>

<p>Note that since this intensity function is typically <em>unknown</em>, all of those methods use heuristics. If the assumptions of the heuristics are met, the distribution is better (= closer to the desired function) than a random distribution. If not, it's worse.</p>

<p>For example, importance sampling uses the BRDF to distribute samples, which is simple but only uses a part of the intensity function. A very strong light source illuminating a diffuse surface at shallow angle will get few samples, although its influence might still be huge. Metropolis Light Transport generates new samples from previous one's with high intensity, which is good for few strong light sources, but doesn't help if light arrives evenly from all directions.</p>

CC BY-SA 3.0
2015-09-03T14:12:49.450Z
2015-09-03T14:12:49.450Z
David Kuri
<p>There is one important distinction to make. </p>

<p>Markov Chain Monte Carlo (such as Metropolis Light Transport) methods fully acknowledge the fact that they produce lots of highly correlated, it is actually the backbone of the algorithm. </p>

<p>On other hand there are algorithms as Bidirectional Path Tracing, Many Light Method, Photon Mapping where the crucial role plays Multiple Importance Sampling and its balance heuristics. Optimality of balance heuristic is proven only for samples that are independent. Many modern algorithms have correlated samples and for some of them this causes troubles and for some it doesn't.</p>

<p>The problem with correlated samples was acknowledged in the paper <a href="https://scholar.google.com/citations?view_op=view_citation&amp;hl=en&amp;user=Glq3dWkAAAAJ&amp;citation_for_view=Glq3dWkAAAAJ:WF5omc3nYNoC" rel="noreferrer">Probabilistic Connections for Bidirectional Path Tracing</a>. Where they have altered balance heuristics to take into account the correlation. Have a look at figure 17 in the paper to see the result.</p>

<hr>

<p>I would like to point out that correlation is "always" bad. If you can afford to make brand new sample than do it. But most of the time you can't afford it so you hope that the error due to the correlation is small.</p>

<p><strong>Edit to explain the "always"</strong>: I mean this in the context of MC integration
<a href="https://i.sstatic.net/st1XC.gif" rel="noreferrer"><img src="https://i.sstatic.net/st1XC.gif" alt="enter image description here"></a></p>

<p>Where you measure the error with variance of the estimator
<a href="https://i.sstatic.net/wEs1y.gif" rel="noreferrer"><img src="https://i.sstatic.net/wEs1y.gif" alt="enter image description here"></a></p>

<p>If the samples are independent that the covariance term is zero. Correlated samples make always this term nonzero thus increasing variance of the final estimator.</p>

<p>This is at first sight somewhat contradictory what we encounter with stratified sampling because stratification lowers the error. But you can't prove that stratified sampling converges to the desired result just from the probabilistic point of view, because in the core of stratified sampling there is no probability involved.</p>

<hr>

<p>And the deal with stratified sampling is that it is basically not a Monte Carlo method. Stratified sampling comes from standard quadrature rules for numerical integration which works great for integrating smooth function in low dimensions. This is why it is used for handling direct illumination which is low dimensional problem, but its smoothness is disputable.</p>

<p>So stratified sampling is yet different kind of correlation than for example correlation in Many Light methods.</p>

CC BY-SA 3.0
2015-09-10T11:37:55.023Z
"I would like to point out that correlation is "always" bad. If you can afford to make brand new sample than do it." Could you elaborate? To me this sounds like any kind of heuristic for sample distribution is bad, which is probably not what you wanted to say.
David Kuri
CC BY-SA 3.0
2015-09-10T12:28:23.113Z
I edited the answer, I hope that cleared a thing or two.
tom
CC BY-SA 3.0
2015-09-15T02:30:16.700Z
it feels indeed contradictory, but I would not say stratified sampling reduces the error, it reduces the noise only.
v.oddou
CC BY-SA 3.0
2015-09-10T11:11:54.013Z
2015-09-10T12:27:27.860Z
2015-09-10T12:27:27.860Z
tom
<p>Most descriptions of Monte Carlo rendering methods, such as path tracing or bidirectional path tracing, assume that samples are generated independently; that is, a standard random number generator is used that generates a stream of independent, uniformly distributed numbers.</p>

<p>We know that samples that are not chosen independently can be beneficial in terms of noise. For example, stratified sampling and low-discrepancy sequences are two examples of correlated sampling schemes that almost always improve render times.</p>

<p>However, there are many cases where the impact of sample correlation is not as clear-cut. For example, Markov Chain Monte Carlo methods such as <a href="https://graphics.stanford.edu/papers/metro/metro.pdf">Metropolis Light Transport</a> generate a stream of correlated samples using a Markov chain; <a href="http://www.csie.ntu.edu.tw/~cyy/courses/rendering/13fall/lectures/handouts/ManyLight-I.pdf">many-light methods</a> reuse a small set of light paths for many camera paths, creating many correlated shadow connections; even <a href="http://graphics.stanford.edu/~henrik/papers/ewr7/egwr96.pdf">photon mapping</a> gains its efficiency from reusing light paths across many pixels, also increasing sample correlation (although in a biased way).</p>

<p>All of these rendering methods can prove beneficial in certain scenes, but seem to make things worse in others. It's not clear how to quantify the quality of error introduced by these techniques, other than rendering a scene with different rendering algorithms and eyeballing whether one looks better than the other.</p>

<p>So the question is: How does sample correlation influence the variance and the convergence of a Monte Carlo estimator? Can we somehow mathematically quantify which kind of sample correlation is better than others? Are there any other considerations that could influence whether sample correlation is beneficial or detrimental (e.g. perceptual error, animation flicker)?</p>

CC BY-SA 3.0
2015-09-15T02:26:55.233Z
There has been enough psychology of perception studies that told that we cannot tell what image looks more real. using eyeballing would be a terrible measurement method.
v.oddou
<raytracing><rendering><monte-carlo>
How do correlated samples influence the behavior of a Monte Carlo renderer?
Benedikt Bitterli
# How do correlated samples influence the behavior of a Monte Carlo renderer?

(Asked by: username_0 on 2015-08-10)

Most descriptions of Monte Carlo rendering methods, such as path tracing or bidirectional path tracing, assume that samples are generated independently; that is, a standard random number generator is used that generates a stream of independent, uniformly distributed numbers.

We know that samples that are not chosen independently can be beneficial in terms of noise. For example, stratified sampling and low-discrepancy sequences are two examples of correlated sampling schemes that almost always improve render times.

However, there are many cases where the impact of sample correlation is not as clear-cut. For example, Markov Chain Monte Carlo methods such as [Metropolis Light Transport](https://graphics.stanford.edu/papers/metro/metro.pdf) generate a stream of correlated samples using a Markov chain; [many-light methods](http://www.csie.ntu.edu.tw/~cyy/courses/rendering/13fall/lectures/handouts/ManyLight-I.pdf) reuse a small set of light paths for many camera paths, creating many correlated shadow connections; even [photon mapping](http://graphics.stanford.edu/~henrik/papers/ewr7/egwr96.pdf) gains its efficiency from reusing light paths across many pixels, also increasing sample correlation (although in a biased way).

All of these rendering methods can prove beneficial in certain scenes, but seem to make things worse in others. It's not clear how to quantify the quality of error introduced by these techniques, other than rendering a scene with different rendering algorithms and eyeballing whether one looks better than the other.

So the question is: How does sample correlation influence the variance and the convergence of a Monte Carlo estimator? Can we somehow mathematically quantify which kind of sample correlation is better than others? Are there any other considerations that could influence whether sample correlation is beneficial or detrimental (e.g. perceptual error, animation flicker)?

**Tags:** raytracing, rendering, monte-carlo

> **Comments:**
> **username_1**: There has been enough psychology of perception studies that told that we cannot tell what image looks more real. using eyeballing would be a terrible measurement method.  

---

## 2 answers

### Answer by username_3 on 2015-09-10. Score: 8 | Accepted answer

There is one important distinction to make.

Markov Chain Monte Carlo (such as Metropolis Light Transport) methods fully acknowledge the fact that they produce lots of highly correlated, it is actually the backbone of the algorithm.

On other hand there are algorithms as Bidirectional Path Tracing, Many Light Method, Photon Mapping where the crucial role plays Multiple Importance Sampling and its balance heuristics. Optimality of balance heuristic is proven only for samples that are independent. Many modern algorithms have correlated samples and for some of them this causes troubles and for some it doesn't.

The problem with correlated samples was acknowledged in the paper [Probabilistic Connections for Bidirectional Path Tracing](https://scholar.google.com/citations?view_op=view_citation&hl=en&user=Glq3dWkAAAAJ&citation_for_view=Glq3dWkAAAAJ:WF5omc3nYNoC). Where they have altered balance heuristics to take into account the correlation. Have a look at figure 17 in the paper to see the result.

---

I would like to point out that correlation is "always" bad. If you can afford to make brand new sample than do it. But most of the time you can't afford it so you hope that the error due to the correlation is small.

**Edit to explain the "always"**: I mean this in the context of MC integration
[![enter image description here](https://i.sstatic.net/st1XC.gif)](https://i.sstatic.net/st1XC.gif)

Where you measure the error with variance of the estimator
[![enter image description here](https://i.sstatic.net/wEs1y.gif)](https://i.sstatic.net/wEs1y.gif)

If the samples are independent that the covariance term is zero. Correlated samples make always this term nonzero thus increasing variance of the final estimator.

This is at first sight somewhat contradictory what we encounter with stratified sampling because stratification lowers the error. But you can't prove that stratified sampling converges to the desired result just from the probabilistic point of view, because in the core of stratified sampling there is no probability involved.

---

And the deal with stratified sampling is that it is basically not a Monte Carlo method. Stratified sampling comes from standard quadrature rules for numerical integration which works great for integrating smooth function in low dimensions. This is why it is used for handling direct illumination which is low dimensional problem, but its smoothness is disputable.

So stratified sampling is yet different kind of correlation than for example correlation in Many Light methods.

> **Comments:**
> **username_2**: "I would like to point out that correlation is "always" bad. If you can afford to make brand new sample than do it." Could you elaborate? To me this sounds like any kind of heuristic for sample distribution is bad, which is probably not what you wanted to say.  
> **username_3**: I edited the answer, I hope that cleared a thing or two.  
> **username_1**: it feels indeed contradictory, but I would not say stratified sampling reduces the error, it reduces the noise only.  

---

### Answer by username_2 on 2015-09-03. Score: 4

The hemispherical intensity function, i.e. the hemispherical function of incident light multiplied by the BRDF, correlates to the number of samples required per solid angle. Take the sample distribution of any method and compare it to that hemispherical function. The more similar they are, the better the method is in that particular case.

Note that since this intensity function is typically *unknown*, all of those methods use heuristics. If the assumptions of the heuristics are met, the distribution is better (= closer to the desired function) than a random distribution. If not, it's worse.

For example, importance sampling uses the BRDF to distribute samples, which is simple but only uses a part of the intensity function. A very strong light source illuminating a diffuse surface at shallow angle will get few samples, although its influence might still be huge. Metropolis Light Transport generates new samples from previous one's with high intensity, which is good for few strong light sources, but doesn't help if light arrives evenly from all directions.


---

