{"id":2090593,"date":"2018-10-29T18:18:34","date_gmt":"2018-10-29T12:48:34","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=2090593"},"modified":"2018-10-30T14:19:40","modified_gmt":"2018-10-30T08:49:40","slug":"macro-nifty-vs-inr-oil-correlation-part-ii","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2018\/10\/29\/macro-nifty-vs-inr-oil-correlation-part-ii\/","title":{"rendered":"Macro: NIFTY vs. INR\/OIL Correlation, Part II"},"content":{"rendered":"<p><em><small>This is a continuation of the correlation study of <a href=\"https:\/\/stockviz.biz\/2018\/10\/29\/macro-nifty-vs-inr-oil-correlation-part-i\/\">Part I<\/a><\/small><\/em><br \/>\nOur correlation study showed a -0.54 between NIFTY 50 and USDINR whereas a 0.21 with OIL. Here, we will use weekly returns of the NIFTY and USDINR to build a simple linear model.<\/p>\n<h3>Building a linear model<\/h3>\n<p>A weak correlation doesn&#8217;t usually lend itself to a useful linear model. To illustrate this point, have a look at the diagnostics below:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/macro\/NIFTY%2050.INR.lag-1.lm.2010-01-01.2015-12-31.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/macro\/NIFTY%2050.INR.lag-1.lm.2010-01-01.2015-12-31.png\" width=\"3000\" height=\"3000\" alt=\"NIFTY~INR linear model\" class=\"alignnone size-full\" \/><\/a><br \/>\nIdeally, the &#8216;Residuals vs. Fitted&#8217; plot should show residuals evenly distributed around the zero line &#8211; it doesn&#8217;t. The Q-Q plot should lie on the diagonal &#8211; it is marred by heavy tails. Hence, we should scale-down our expectations from the model. <\/p>\n<p>For this post, we will split the time-series that we have into a &#8220;training set&#8221; that goes from 2010-01-01 to 2015-12-31 and a &#8220;test set&#8221; that goes from 2016-01-01 to 2018-09-30. We will build the model with the former and test it with the latter.<\/p>\n<h3>Results<\/h3>\n<p>Predicted vs. actual weekly NIFTY 50 returns:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/macro\/actual.vs.pred.NIFTY%2050.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/macro\/actual.vs.pred.NIFTY%2050.png\" width=\"3000\" height=\"1800\" alt=\"actual.vs.pred.NIFTY50\" class=\"alignnone size-full\" \/><\/a><br \/>\nTo test our model, we will give it the actual NIFTY 50 returns (x-axis) and plot the predict NIFTY 50 returns (y-axis.) The problem here is immediately apparent: it is heavily bullish! It consistently gives a positive prediction. <\/p>\n<p>Long and Long-short cumulative returns:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/macro\/linear.model.cumulative.NIFTY%2050.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/macro\/linear.model.cumulative.NIFTY%2050.png\" width=\"1400\" height=\"800\" alt=\"linear.model.cumulative.NIFTY50\" class=\"alignnone size-full\" \/><\/a><br \/>\nIf we use our model to go long-only (L) or long-short (LS), we get the cumulative returns shown above. The model is no better than buy-and-hold (at least it is no worse, so there is that.)<\/p>\n<h3>Take-away<\/h3>\n<p>A weak correlation between NIFTY 50 and USDINR is not much to work with and a linear model built over that relationship is no better than buy-and-hold. Given the narrative spun by the media, it is tough to wrap ones head around the results above. <\/p>\n<p>We conclude with density charts of weekly NIFTY returns under different USDINR return thresholds in <a href=\"https:\/\/stockviz.biz\/2018\/10\/30\/macro-nifty-vs-inr-oil-correlation-part-iii\/\">Part III<\/a>.<\/p>\n<p>Code and charts on <a href=\"https:\/\/github.com\/stockviz\/blog\/tree\/master\/macro\" rel=\"noopener\" target=\"_blank\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a continuation of the correlation study of Part I Our correlation study showed a -0.54 between NIFTY 50 and USDINR whereas a 0.21 with OIL. Here, we will use weekly returns of the NIFTY and USDINR to build a simple linear model. Building a linear model A weak correlation doesn&#8217;t usually lend itself &hellip; <\/p>\n","protected":false},"author":2,"featured_media":2066301,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471],"tags":[954,3481,3391],"class_list":["post-2090593","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-correlation","tag-macro","tag-nifty","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2090593","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=2090593"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2090593\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media\/2066301"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=2090593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=2090593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=2090593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}