Random Sampling from a Histogram: Using S%P 500 Data

3 years ago
15

In the last video, we generated a histogram of SPX daily returns. I briefly touched on how to come up with an approximate probability density. I wan to elaborate on that a bit more, and show a very simple way to sample from out custom density function. There are other ways to build an approximate density function, but this is straightforward and probably easier to understand.

As this video is rather basic and doing things as described here depends a lot on how you build the histogram and do the analysis, this will likely be part one of two.

Wikipedia Article: https://en.wikipedia.org/wiki/Inverse_transform_sampling

Github Notebook: https://github.com/kpmooney/numerical_methods_youtube/blob/master/market_analysis/sample_using_cdf.ipynb

Tip Jar: https://paypal.me/kpmooney

Loading comments...