{"id":2131873,"date":"2020-07-20T12:43:42","date_gmt":"2020-07-20T07:13:42","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=2131873"},"modified":"2020-07-20T12:44:02","modified_gmt":"2020-07-20T07:14:02","slug":"fat-tails-sampling","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2020\/07\/20\/fat-tails-sampling\/","title":{"rendered":"Fat Tails, Sampling"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">While developing a model, historical data alone may not be sufficient to test its robustness. One way to generate test data is to re-sample historical data. This &#8220;re-arrangement&#8221; of past time-series can then be fed to the model to see how it behaves.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem with sampling historical market data is that it may not sufficiently account for <a href=\"https:\/\/stockviz.biz\/index.php\/2020\/07\/15\/fat-tails-an-introduction\/\">fat-tails<\/a>. Typically, a <em>uniform sample<\/em> is taken. The problem with this is it under-represents the tails. This leads to models that work on average but blow up on occasion. Something you&#8217;d like to avoid.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One way to overcome this problem is through <em>stratified sampling<\/em>. You chop the data into intervals and use their frequencies to probability weight the sample. This preserves the original distribution in the sample.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/fat-tails\/plots\/simulation.NIFTY%2050-density.png\" alt=\"\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/fat-tails\/plots\/simulation.NIFTY%20MIDCAP%20150-density.png\" alt=\"\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the skew and the tails in the &#8220;STRAT&#8221; densities for both NIFTY and MIDCAP indices. This distribution is far more likely to result in a robust model compared to the one that just uses uniform sampling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can check out the R-code <a href=\"https:\/\/github.com\/stockviz\/blog\/blob\/master\/fat-tails\/simulation-intro.R\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While developing a model, historical data alone may not be sufficient to test its robustness. One way to generate test data is to re-sample historical data. This &#8220;re-arrangement&#8221; of past time-series can then be fed to the model to see how it behaves. The problem with sampling historical market data is that it may not &hellip; <\/p>\n","protected":false},"author":2,"featured_media":2091813,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471],"tags":[2761,4033],"class_list":["post-2131873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-quant","tag-risk","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2131873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/comments?post=2131873"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2131873\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media\/2091813"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=2131873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=2131873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=2131873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}