0

I know of 2 Monte Carlo estimators of $\pi$. Rick Wicklin discusses these 2 methods here.

https://blogs.sas.com/content/iml/2016/03/14/monte-carlo-estimates-of-pi.html

1) The area method throws darts at a circle inscribed a square. You estimate $\pi$ by multiplying the proportion of darts in the circle by 4.

2) The average method uses Monte Carlo integration.

How do I find the variance of these 2 estimators? Here is what I have found so far.

1) Area method: This thread seems to show that the variance converges to 0, but I don't actually see what the variance is in the first place.

How can I prove that the error of the Monte Carlo method for finding $\pi$ decreases as $N$, the number of samples, increases?

2) Average method: This thread shows how to do it for a different integral, and I'm struggling to adapt it to the integral for estimating $\pi$.

Expected Value and Variance of Monte Carlo Estimate of $\int_{0}^{1}e^{-x}dx$

1 Answers1

1

For the first one, the point is that each dart produces a Bernoulli($\pi/4$) variable. These have variance $\pi/4(1-\pi/4)$. You then take $n$ of them, average them, and scale it all up by $4$, so the variance of the estimate of $\pi$ is $\frac{16}{n} (\pi/4) (1-\pi/4)$. The fact that the variance of the average of $n$ uncorrelated identically distributed random variables $X_i$ is $\operatorname{Var}(X_i)/n$ is a standard thing in elementary probability, following from the two facts:

  • $\operatorname{Var} \left ( \sum_{i=1}^n X_i \right ) = \sum_{i=1}^n \operatorname{Var}(X_i)$
  • $\operatorname{Var}(c X)=|c|^2 \operatorname{Var}(X)$ for a constant $c$.

For the second one it depends on how exactly you set up the integral. Here the author appears to be using $\pi=4 \cdot \int_0^1 \sqrt{1-x^2} dx = 4 E[\sqrt{1-X^2}]$ where $X$ is uniformly distributed on $[0,1]$. In terms of that expected value, you need to additionally compute $E[(\sqrt{1-X^2})^2]=\int_0^1 1-x^2 dx = 2/3$, so that now the variance of $\sqrt{1-X^2}$ is $E[1-X^2]-E[\sqrt{1-X^2}]^2=2/3-(\pi/4)^2$. Then again when you take an average and multiply by $4$ you pick up a factor of $16/n$, so the variance of this estimate of $\pi$ is $\frac{16}{n} (2/3-(\pi/4)^2)$.

Ian
  • 104,572
  • Could you please explain how $[E(\sqrt{1-X^2})]^2$ is equal to $(\frac{\pi}{4})^2$? – Iterator516 Jan 22 '20 at 21:28
  • @Iterator516 The whole point of using that method was that $E[\sqrt{1-X^2}]=\int_0^1 \sqrt{1-x^2} dx = \pi/4$. Then you're just squaring that. – Ian Jan 22 '20 at 22:00
  • Sorry, but I'm confused. Isn't $E[\sqrt{1-X^2}] = \int_{0}^{1}x\sqrt{1-x^2}dx$? – Iterator516 Jan 22 '20 at 22:50
  • @Iterator516 No, it is $\int_{-\infty}^\infty \sqrt{1-x^2} f_X(x) dx$ and $f_X(x)=\begin{cases} 1 & x \in (0,1) \ 0 & \text{otherwise} \end{cases}$ for a uniform variable on $(0,1)$. It can also be written as $\int_{-\infty}^\infty y f_Y(y) dy$ where $f_Y$ is its own density function; if you worked that out, it would turn out that $f_Y(y)=\begin{cases} \frac{\sqrt{1-y^2}}{y} & y \in (0,1) \ 0 & \text{otherwise} \end{cases}$. The fact that these two agree is sometimes called "the law of the unconscious statistician". – Ian Jan 22 '20 at 23:04
  • Ah, yes. I see my mistake now. Thank you. – Iterator516 Jan 22 '20 at 23:10