# Constructing Confidence interval for Estimate for an integral

I am estimating $\theta$, where $\theta=\int_0^1 f(x)dx, \ \text{where}\ f(x)=x*e^{x/2}$

From a unifrm distibution I generate 1000 random numberers from 0 to 1, $x_1,x_2,...x_{1000},$.

$\hat{\theta}= 1/1000 * \sum_{i=1}^{1000}f(x_i)$

Henc, I am taking the average.

How do I construct a Confidence Interval for $\hat{\theta}$? Say 95%.

As far as I can read from Wikipedia, I think my method is called Monte Carlo integration but I am not sure.

• You could be much more sure by searching our site. Regardless, how would you obtain a confidence interval for the mean of any thousand numbers and why don't you use it here? – whuber Jun 13 '17 at 17:45

You have $X_1, X_2, \dots, X_n$ from a Uniform$(0,1$). You have a function $y = g(x) = xe^{x/2}$, so that $Y_1, \dots, Y_n$ are a random sample from a distribution with mean $\theta$ and some unknown variance $\sigma^2$. Once you take the Monte Carlo average, the central limit theorem kicks in and in order to make confidence intervals you just have to obtain an estimate of $\sigma^2$.