Where Var(f(X1))=RVar^(f(X1) with Var^(f(X1))=R−11i=1∑R(f(xi)−μ^R)2 is the Sample Variance
Generating Random Variables
The first step of the Monte Carlo is generating RVs. Once such method is the inversion method:
Lemma (Inversion Method)
Assume that we are able to generate i.i.d. random variables which is uniformly distributed between (0,1). Let U∼Unif(0,1) and F be a one-dimensional cdf. Denote X=F−1(U),where F−1(u)=inf{x∈R:F(x)≥u} Then X has the distribution F.
Consider a discrete distribution with finite support on a1<⋯<aK, and π(ai)=pi,for 1≤i≤K where ∑i=1Kpi=1.
Generate U∼Unif(0,1), and let F−1(U)=X=ai⟺j=1∑i−1pj<U≤j=1∑ipj