5,337
edits
Line 30: | Line 30: | ||
This is because <math>E\left[\frac{b-a}{N}\sum f(X_i)\right] = \frac{b-a}{N}\sum E[f(X_i)] = \frac{1}{N}\sum \int_{a}^{b}(b-a)f(x)(1/(b-a))dx = \int_{a}^{b}f(x)dx</math><br> | This is because <math>E\left[\frac{b-a}{N}\sum f(X_i)\right] = \frac{b-a}{N}\sum E[f(X_i)] = \frac{1}{N}\sum \int_{a}^{b}(b-a)f(x)(1/(b-a))dx = \int_{a}^{b}f(x)dx</math><br> | ||
Note that in general, if we can sample from some distribution with pdf <math>p(x)</math> then we use the estimator: | Note that in general, if we can sample from some distribution with pdf <math>p(x)</math> then we use the estimator: | ||
* <math> | * <math>\hat{I} = \frac{1}{N} \sum \frac{f(X_i)}{p(X_i)}</math> | ||
===Importance Sampling=== | ===Importance Sampling=== |