Monte carlo variation of $E[1_{\{X>0\}}]$

53 Views Asked by At

Let's assume that $X \sim N(0, 1)$. I want to calculate variation of crude monte carlo estimator of parameter $\delta = E[1_{\{X>0\}}]$

My work so far

Let's generate $x_1, x_2, x_3,..., x_n \sim N(0, 1)$ and define $Y(x) = 1_{(0, +\infty)}(x)$

Then monte carlo estimator of parameter $\delta$ is $\sum_{i = 1}^n \frac{Y(x_i)}{n}$. When calculating variation:

$$Var[\delta] = E[\delta^2] - [E[\delta]]^2 = \sum_{i = 1}^n \frac{Y^2(x_i)}{n} - [\sum_{i = 1}^n \frac{Y(x_i)}{n}]^2 = \sum_{i = 1}^n \frac{Y^2(x_i)n - Y^2(x_i)}{n^2} = \sum_{i=1}^n \frac{Y^2(x_i)[n - 1]}{n^2} $$

And my question is - is it correct? Problem I have with this variance is that it depends on sample $x_1, x_2, ..., x_n$ and I'm not sure if it should take place. Could you please tell me if this result is the one I should get?

2

There are 2 best solutions below

0
On BEST ANSWER

What you're doing is basically computing the sample variance of a particular sample, which is probably not what you want to do. I'm pretty sure that what you want to do is

$$\operatorname{Var}(\delta)=\operatorname{Var} \left ( \frac{1}{n} \sum_{i=1}^n Y_i \right ) = \frac{1}{n^2} \sum_{i=1}^n \operatorname{Var}(Y_i)=\frac{1}{n} \operatorname{Var}(Y_1)$$

since all the individual variances are the same. Then you just need this variance to finish. This is the calculation that you would use to estimate the number of samples required to get a good estimate of $P(X>0)$ with large probability. (Of course in doing this calculation you already have noticed that $P(X>0)=1/2$, so this exercise is a bit artificial.)

0
On

The random variables $Y_j=\mathbb{I}_{\{X_j>0\}}$ are identically distributed Bernoulli trials with probability $p=0.5$, which coincides with $E[\mathbb{I}_{\{X>0\}}]$. Assuming that the simulations are independent, we get the estimator $$\hat{\delta}_n=\frac{1}{n}\sum_{j=\{0,1,...,n-1\}}Y_j$$ with variance (being independent we can take the sum of variances) $$\textrm{Var}[\hat{\delta}_n]=\frac{1}{n^2}\sum_{j=\{0,1,...,n-1\}}\textrm{Var}[Y_j]=\frac{1}{n}\textrm{Var}[\mathbb{I}_{\{X>0\}}] \ \ \ \ \ \ X \sim N(0,1)$$ and $$\textrm{Var}[\mathbb{I}_{\{X>0\}}]=(p\cdot 1^2+(1-p)\cdot 0^2)-p^2=p(1-p)=0.5^2$$