<p>As described in <a href="http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing.html" rel="nofollow noreferrer">PBRT 14.5</a>, the path tracer stops bouncing rays at a probability <code>q</code>, which is determined by the throughput of the path.</p>

<pre><code>&lt;&lt;Possibly terminate the path with Russian roulette&gt;&gt;= 
if (bounces &gt; 3) {
    Float q = std::max((Float).05, 1 - beta.y());
    if (sampler.Get1D() &lt; q)
        break;
    beta /= 1 - q;
}
</code></pre>

<p>In my understanding, the probability <code>q</code> should be a constant for paths of the same length, so that the Russian roulette estimator is unbiased. Would such a dynamic termination probability still produce biased results?</p>

<p>Update:</p>

<p>Given an estimator <code>F</code>, its corresponding Russian roulette estimator is defined to be</p>

<pre><code>R = (F - qc) / (1 - q) , if xi &gt; q
R = c                  , otherwise
</code></pre>

<p>Since <code>E[R] = (1 - q)(E[F] - qc) / (1 - q) + qc = E[F]</code>, as long as <code>F</code> is a unbiased estimator, <code>R</code> is a unbiased estimator as well.</p>

<p>Specific to a path tracer, its path-integral form of LTE with Russian roulette can be written as</p>

<pre><code>1 / (1 - q1)(P(p1) + 1 / (1 - q2)(P(p2) + 1 / (1 - q3)(P(p3) + ...
</code></pre>

<p>if <code>q1, q2, qc, ...</code> is not a constant, then the estimator for each path length is not an unbiased estimator, I think.</p>

CC BY-SA 4.0
2019-07-30T15:44:42.163Z
Where did that come from: `the probability q should be a constant for paths of the same length, so that the Russian roulette estimator is unbiased.`?
lightxbulb
CC BY-SA 4.0
2019-07-31T04:47:18.577Z
@lightxbulb I added extra explanation for my confusion in the question
Zhe Chen
CC BY-SA 4.0
2019-07-31T09:36:25.827Z
What you wrote makes no sense. Even you `E[R]` expression is wrong. Look for better resources regarding it.
lightxbulb
CC BY-SA 4.0
2019-07-31T12:40:06.367Z
@lightxbulb Can you elaborate what's wrong here? It's the same as the [one](http://www.pbr-book.org/3ed-2018/Monte_Carlo_Integration/Russian_Roulette_and_Splitting.html) on PBRT.
Zhe Chen
CC BY-SA 4.0
2019-07-31T13:42:04.877Z
What they wrote is correct only if $E[F] = c$ or $c=0$. Since you mentioned neither of those assumptions - it is incorrect.
lightxbulb
CC BY-SA 4.0
2019-07-31T16:40:38.097Z
You must have misunderstood something
Zhe Chen
CC BY-SA 4.0
2019-07-31T17:17:06.103Z
My bad, I seem to have made a mistake. I still don't get where your assumption that `q` should be the same for paths of the same length comes from.
lightxbulb
CC BY-SA 4.0
2019-08-06T00:02:18.977Z
I don't get that as well. I don't see any connection to the explanation you made with the claim that `q` should be constant for same length paths for RR to remain unbiased.
gallickgunner
CC BY-SA 4.0
2019-08-06T00:45:02.067Z
From what I understand the unbiasedness doesn't depend on what probability you choose for termination. The fact that the Expected value of the RR estimator gives back the original doesnt depend on the probability used. Also it doesn't make sense either. A path of 3 length with a mirror in between should have higher amount of energy rather than a path with 3 diffuse surfaces. Why should the termination probabilty be same for both paths?
gallickgunner
CC BY-SA 4.0
2019-08-06T10:06:09.847Z
Hi, @gallickgunner. As for your example, I guess you mean we should set a higher termination probability for paths with diffuse surfaces. But that would intentionally lower the contribution of those paths and the final pixel color would be biased towards paths with specular surfaces. Actually, if q in the RR estimator is not a constant, E[R] is almost certain to be unequal to E[F].
Zhe Chen
CC BY-SA 4.0
2019-08-06T18:57:13.457Z
Again E[R] equals E[F] because the probabilities get cancelled `E[R] = [ (1 - q)(E[F] - qc) / (1 - q) ] + qc = E[F]` Doesn't matter what probability you use here. Secondly we don't intentionally lower the contribution of the paths. If a random number doesn't fall below the termination probability it survives. If it survives we divide it by `(1- q)` The greater the value of `q` the smaller the value by which we divide. We actually accounted for that fact by increasing the radiance much more than in the specular surfaces scenario.
gallickgunner
<raytracing><pathtracing>
The termination probability of Russian roulette in PBRT
Zhe Chen
# The termination probability of Russian roulette in PBRT

(Asked by: username_0 on 2019-07-30)

As described in [PBRT 14.5](http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing.html), the path tracer stops bouncing rays at a probability `q`, which is determined by the throughput of the path.

```
<<Possibly terminate the path with Russian roulette>>= 
if (bounces > 3) {
    Float q = std::max((Float).05, 1 - beta.y());
    if (sampler.Get1D() < q)
        break;
    beta /= 1 - q;
}

```

In my understanding, the probability `q` should be a constant for paths of the same length, so that the Russian roulette estimator is unbiased. Would such a dynamic termination probability still produce biased results?

Update:

Given an estimator `F`, its corresponding Russian roulette estimator is defined to be

```
R = (F - qc) / (1 - q) , if xi > q
R = c                  , otherwise

```

Since `E[R] = (1 - q)(E[F] - qc) / (1 - q) + qc = E[F]`, as long as `F` is a unbiased estimator, `R` is a unbiased estimator as well.

Specific to a path tracer, its path-integral form of LTE with Russian roulette can be written as

```
1 / (1 - q1)(P(p1) + 1 / (1 - q2)(P(p2) + 1 / (1 - q3)(P(p3) + ...

```

if `q1, q2, qc, ...` is not a constant, then the estimator for each path length is not an unbiased estimator, I think.

**Tags:** raytracing, pathtracing

> **Comments:**
> **username_1**: Where did that come from: `the probability q should be a constant for paths of the same length, so that the Russian roulette estimator is unbiased.`?  
> **username_0**: @username_1 I added extra explanation for my confusion in the question  
> **username_1**: What you wrote makes no sense. Even you `E[R]` expression is wrong. Look for better resources regarding it.  
> **username_0**: @username_1 Can you elaborate what's wrong here? It's the same as the [one](http://www.pbr-book.org/3ed-2018/Monte_Carlo_Integration/Russian_Roulette_and_Splitting.html) on PBRT.  
> **username_1**: What they wrote is correct only if $E[F] = c$ or $c=0$. Since you mentioned neither of those assumptions - it is incorrect.  
> **username_0**: You must have misunderstood something  
> **username_1**: My bad, I seem to have made a mistake. I still don't get where your assumption that `q` should be the same for paths of the same length comes from.  
> **username_2**: I don't get that as well. I don't see any connection to the explanation you made with the claim that `q` should be constant for same length paths for RR to remain unbiased.  
> **username_2**: From what I understand the unbiasedness doesn't depend on what probability you choose for termination. The fact that the Expected value of the RR estimator gives back the original doesnt depend on the probability used. Also it doesn't make sense either. A path of 3 length with a mirror in between should have higher amount of energy rather than a path with 3 diffuse surfaces. Why should the termination probabilty be same for both paths?  
> **username_0**: Hi, @username_2. As for your example, I guess you mean we should set a higher termination probability for paths with diffuse surfaces. But that would intentionally lower the contribution of those paths and the final pixel color would be biased towards paths with specular surfaces. Actually, if q in the RR estimator is not a constant, E[R] is almost certain to be unequal to E[F].  
> **username_2**: Again E[R] equals E[F] because the probabilities get cancelled `E[R] = [ (1 - q)(E[F] - qc) / (1 - q) ] + qc = E[F]` Doesn't matter what probability you use here. Secondly we don't intentionally lower the contribution of the paths. If a random number doesn't fall below the termination probability it survives. If it survives we divide it by `(1- q)` The greater the value of `q` the smaller the value by which we divide. We actually accounted for that fact by increasing the radiance much more than in the specular surfaces scenario.  

---

## 0 answers

