Simple Sampling - Generalized
assume:
- function β(π)
- π has a probability distribution π
- it is easy to generate a sampleΒ π₯π from probability distribution π
- computation of β(π₯π) is easy
we want to compute the expected value of β(π) (i.e. ππ[β(π)])
- ππ[β(π)] = β«β(π₯)π(π₯)ππ₯ # continuous case
- ππ[β(π)] = π΄π₯βπΒ β(π₯)π(π₯) # discrete case
is estimated with:
- ππ[β(π)] β (1/π) π΄1β€πβ€πβ(π₯π)
where:
- β(π₯) - is some function
- π - is the probability distribution
- ππ[..] - expected value based on π
- π - is the number of samples generated
- {π₯1, β¦, π₯π, β¦, π₯π} - are samples i.i.d. generated from π
Simple Sampling - Examples
Using Simple Sampling to Estimate the Average of a Distribution
see: sample mean
here we want to estimate the expected value of π having probability distribution π. Therefore:
- β(π₯) = π₯
is estimated with:
- ππ[π] β (1/π) π΄1β€πβ€π [π₯π]
where:
- π - is the number of samples generated
- {π₯1, β¦, π₯π, β¦, π₯π} - are i.i.d. samples generated from π
Using Simple Sampling to Estimate the Proportion of a Distribution
see: sample proportions
We would like to estimate the probability of a random variableΒ π.
More specifically, given:
- variable π has a domain of possible outcomes (i.e. sample space)
- event π΄ is a subset of sample space
we would like to estimate the probability ofΒ π that variable π would result in an outcome that exist in eventΒ π΄. In other words,Β πΒ =Β πΒ {πΒ β π΄}
This probabilityΒ π is estimated by generating a long run of experiments onΒ π, where each run returns an outcomeΒ ππ. Then we compute the proportion of times when our eventΒ π΄ occurred.
- π = ππ[πΒ β π΄]
- πΜ β (1/π) π΄1β€πβ€π πΌ(π₯πβπ΄)
where:
- π - is the number of samples generated
- {π₯1, β¦, π₯π, β¦, π₯π} - are i.i.d. samples generated from π
- π΄ is anΒ eventΒ (i.e. a set of outcomes) in which we are estimating its probability
- πΌ(π₯πβπ΄) - indicator function (equals 1 when π₯πβπ΄, otherwise 0)
- πΜΒ - the estimator
now we have an estimated probabilityΒ πΜ
How Accurate is This Method? DoesΒ πΜ = π?
To answer this question, compute π[πΜ] and πππ(πΜ)
Since the number of outcomes π1, β¦, ππΒ that fall within event π΄Β has Binomial(π,π) distribution with:
- expectation = (ππ)
- variance = ππ(1βπ)
- standard deviation = β[ππ(1βπ)]
therefore, we obtain:
π[πΜ] = (1/π) (number of π1, β¦, ππβ π΄)
π[πΜ] = (1/π) [π(π1) +Β β¦ + π(ππ)]
π[πΜ] = (1/π)Β [πΒ +Β β¦ +Β π]
π[πΜ] = (1/π) ππ
π[πΜ] = π
πππ(πΜ) =Β (1/π) (number of π1, β¦,Β ππβ π΄)
πππ(πΜ) =Β (1/π) β[ππ(1βπ)]
πππ(πΜ) = β[π(1βπ) / π]
thus, we can conclude the following:
- π[πΜ] =Β π, shows that our Monte Carlo Estimator of πΒ is unbiased, so thatΒ over a long run, it will on the average return the desired quantity π
- πππ(πΜ)Β = β[π(1βπ) /Β π], indicates that the standard deviation of our estimator πΜΒ decreases withΒ πΒ at the rate of 1/βπΒ . Larger Monte Carlo experiments produce more accurate results. A 100-fold increase in the number of generated variables reduces the standard deviation (therefore, enhancing accuracy) by a factor of 10