I was wondering about the variance for Monte Carlo. The book (Advanced Global Illumination 2ed, p.60) writes the equation as follows:

$\sigma^2 = \frac{1}{N} \int(\frac{f(x)}{p(x)} - I)^2p(x)dx$

$\space\space\space\space=\color{red}{\frac{1}{N} \int(\frac{f(x)}{p(x)})^2p(x)dx -I^2}$

$\space\space\space\space=\frac{1}{N} \int\frac{f(x)^2}{p(x)}dx -I^2$

However, the equation appears incorrect. I think the red area is wrong and the equation should be changed as follows:

$\sigma^2 = \frac{1}{N} \int(\frac{f(x)}{p(x)} - I)^2p(x)dx$

$\space\space\space\space=\color{red}{\frac{1}{N} \int((\frac{f(x)}{p(x)})^2 -2\frac{f(x)}{p(x)}I + I^2)p(x)dx}$

$\space\space\space\space=\frac{1}{N} \int\frac{f(x)^2}{p(x)} - 2f(x)I + I^2p(x)dx$

$\space\space\space\space=\frac{1}{N} \int\frac{f(x)^2}{p(x)} - 2f(x)I dx \space + \frac{1}{N}I^2$

$\space\space\space\space=\frac{1}{N} \int\frac{f(x)^2}{p(x)} dx - \frac{2}{N}I^2 \space + \frac{1}{N}I^2$

$\space\space\space\space=\frac{1}{N} \int\frac{f(x)^2}{p(x)} dx - \frac{1}{N}I^2$

Is it right?


1 Answer 1


I don't have that book to check the context of this, but from the equations you posted, yes, it looks like you're right. The $1/N$ factor should be applied to both terms. That agrees with the formula for variance from statistics, which is $E[X^2] - E[X]^2$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.