...

/

Better Estimation of the Expected Value

Better Estimation of the Expected Value

In this lesson, we will try to find a better estimate of the expected value in the continuous case.

In the previous lesson, we showed why our naïve implementation of computing the expected value could be fatally flawed: there could be a “black swan” region where the “profit” function f is different enough to make a big difference in the average, but the region is just small enough to be missed sometimes when we’re sampling from our distribution p

widget

It looks so harmless. Photo credits.


Continuous Distribution as Special Kind of Discrete Distribution

The obvious solution is to work harder, not smarter: do more random samples when we’re taking the average! But doesn’t it seem to be a little wasteful to be running ten thousand samples to get 99909990 results that are mostly redundant and 1010 results that are incredibly relevant outliers?

Perhaps we can be smarter.

We know how to compute the expected value in a discrete non-uniform distribution of doubles: multiply each value by its weight, sum those, and divide by the total weight. But we should think for a moment about why that works.

If we have an unfair two-sided die — a coin — stamped with value 1.231.23 on one side, and 5.87 ...