{"id":2094023,"date":"2018-12-04T09:58:38","date_gmt":"2018-12-04T04:28:38","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=2094023"},"modified":"2018-12-04T09:58:38","modified_gmt":"2018-12-04T04:28:38","slug":"mixture-model-over-sp-500-returns","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2018\/12\/04\/mixture-model-over-sp-500-returns\/","title":{"rendered":"Mixture model over S&amp;P 500 returns"},"content":{"rendered":"<p>Market returns have different characteristics depending on whether they are in a &#8220;bull&#8221; phase or a &#8220;bear&#8221; phase. Daily returns can be labeled as either belonging to the &#8220;bull&#8221; camp or the &#8220;bear&#8221; camp using mixture models. This post extends Eran Raviv&#8217;s idea described <a href=\"https:\/\/eranraviv.com\/create-recession-indicator-using-mixture-models\/\" rel=\"noopener\" target=\"_blank\">here<\/a>.<\/p>\n<h3>Rolling vs. whole period analysis<\/h3>\n<p>The density plot of daily returns of the distributions fit by the mixture model using the entire data-set of daily returns looked promising. There was a very visible difference in the way returns behaved under the two regimes. However, rolling period analysis hews closer to the real world. And the densities don&#8217;t look as pretty:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/mixture%20model\/sp500.regime.density.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/mixture%20model\/sp500.regime.density.png\" width=\"3600\" height=\"1800\" alt=\"density plot of returns in stable and unstable regimes\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>Sure, &#8220;unstable&#8221; or &#8220;bear&#8221; regimes have slightly fatter tails but the densities are not as different as they appeared to be in the whole-period analysis.<\/p>\n<p>Another <em>gotcha<\/em> is that when the regimes are superimposed on the S&amp;P 500 price index, it looks like it could be good idea to use this system to trade it:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/mixture%20model\/sp500.regime.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/mixture%20model\/sp500.regime.png\" width=\"3600\" height=\"1800\" alt=\"S&amp;P 500 regimes\" class=\"alignnone size-full\" \/><\/a><br \/>\n<small>1 (blue) =&gt; stable<\/small><\/p>\n<h3>Timing signal?<\/h3>\n<p>It looks like the model helped escape most of the 2008 carnage and the &#8220;stable&#8221; regime looks to be long most of the up-trends. However, the overall return profile is sub-par when used in a systematic trading strategy:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/mixture%20model\/sp500.regime.cumulative.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/mixture%20model\/sp500.regime.cumulative.png\" width=\"1400\" height=\"800\" alt=\"S&amp;P 500 cumulative returns\" class=\"alignnone size-full\" \/><\/a><\/p>\n<h3>Take-away<\/h3>\n<p>Mixture models are an interesting tool in the quant tool-box. However, like how using <a href=\"https:\/\/stockviz.biz\/2018\/10\/19\/is-skewness-a-timing-signal\/\">skew as a timing signal<\/a> appeared to be a good idea on the face of it, it turns out that using mixture models to time trades in a linear fashion is not such a good idea.<\/p>\n<p>Code and charts on <a href=\"https:\/\/github.com\/stockviz\/blog\/tree\/master\/mixture%20model\" rel=\"noopener\" target=\"_blank\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Market returns have different characteristics depending on whether they are in a &#8220;bull&#8221; phase or a &#8220;bear&#8221; phase. Daily returns can be labeled as either belonging to the &#8220;bull&#8221; camp or the &#8220;bear&#8221; camp using mixture models. This post extends Eran Raviv&#8217;s idea described here. Rolling vs. whole period analysis The density plot of daily &hellip; <\/p>\n","protected":false},"author":2,"featured_media":2057031,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471],"tags":[2761],"class_list":["post-2094023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-quant","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2094023","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=2094023"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2094023\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media\/2057031"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=2094023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=2094023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=2094023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}