{"id":2089493,"date":"2018-10-17T10:08:39","date_gmt":"2018-10-17T04:38:39","guid":{"rendered":"http:\/\/stockviz.biz\/index.php\/?p=2089493"},"modified":"2019-02-01T09:31:19","modified_gmt":"2019-02-01T04:01:19","slug":"principal-component-analysis-part-ii","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2018\/10\/17\/principal-component-analysis-part-ii\/","title":{"rendered":"Principal Component Analysis, Part II"},"content":{"rendered":"<p><em>This post is an update to <a href=\"https:\/\/stockviz.biz\/index.php\/2018\/09\/25\/principal-component-analysis-part-i\/\">Part I<\/a> of applying PCA to NASDAQOMX India TR indices.<\/em><\/p>\n<p>Daily returns tends to be noisy. One way to smooth things out is to use rolling returns over a certain period of days. Rolling returns also allows a bit of slack in terms of variable response times. We wanted to check if using rolling returns would help shake out any obvious regime shifts that daily returns could not.<\/p>\n<p>To recap, we split the NASDAQOMX India TR Index (NQINT) into two regimes. One above SMA-200 (A SMA_200) and the other below (B SMA_200.) The idea was to use PCA on the component indices to see if we could develop a &#8220;good times&#8221; and &#8220;bad times&#8221; portfolio based on the regime we are in.<\/p>\n<p>NQINT 200-day SMA chart:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/NQINT.SMA_200.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/NQINT.SMA_200.png\" width=\"7200\" height=\"3600\" alt=\"NQINT SMA 200\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>Factor loadings of indices when NQINT is above its 200-day SMA:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/factor-loadings.ROLLING.A-SMA_200.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/factor-loadings.ROLLING.A-SMA_200.png\" width=\"7200\" height=\"3600\" alt=\"loadings above 200-day SMA\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>Factor loadings of indices when NQINT is below its 200-day SMA:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/factor-loadings.ROLLING.B-SMA_200.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/factor-loadings.ROLLING.B-SMA_200.png\" width=\"7200\" height=\"3600\" alt=\"factor loadings below 200-day SMA\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>And finally, factor loadings through out:<br \/>\n<a href=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/factor-loadings.ROLLING.ALL.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/stockviz\/blog\/raw\/master\/NASDAQ%20OMX%20India%20Index%20PCA\/factor-loadings.ROLLING.ALL.png\" width=\"7200\" height=\"3600\" alt=\"factor loadings\" class=\"alignnone size-full\" \/><\/a><\/p>\n<p>Unfortunately, neither using daily returns nor lagged rolling returns resulted in PCA being useful in chalking out a regime specific portfolio.<\/p>\n<p>Code and more charts are on <a href=\"https:\/\/github.com\/stockviz\/blog\/tree\/master\/NASDAQ%20OMX%20India%20Index%20PCA\" rel=\"noopener\" target=\"_blank\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is an update to Part I of applying PCA to NASDAQOMX India TR indices. Daily returns tends to be noisy. One way to smooth things out is to use rolling returns over a certain period of days. Rolling returns also allows a bit of slack in terms of variable response times. We wanted &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":[3894,2761],"class_list":["post-2089493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-pca","tag-quant","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2089493","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=2089493"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/2089493\/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=2089493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=2089493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=2089493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}