PCA on S&P 500 Stock Return Data

PCA Plot S&P 500 Data : Highlight Select Sectors

This post is a fun exercise applying PCA (most in tidyverse framework) to stock data from S&P 500 index companies. With PCA on stock data from S&P 500, we can possibly do many interesting things, but we will focus on really simple things and try to see if PCA captures the general company trends from… Continue reading PCA on S&P 500 Stock Return Data

Linear Regression with Matrix Decomposition Methods

Add regression line using coefficients in lm() results

Still remember the first time I learned we can perform linear regression using matrix decomposition techniques like QR decomposition. Totally mind blown. Clearly had no clue that was possible. This is a fun post on performing linear regression using QR decomposition, Cholesky decomposition and Singular Value Decomposition (SVD) using #rstats. No theory behind it, just… Continue reading Linear Regression with Matrix Decomposition Methods

PCA in tidyverse framework

PCA plot: PC1 vs PC2 - PCA with tidyverse

Performing PCA in tidyverse framework is probably one of my go to approaches for any high-dimensional data. In R, we can easily perform Principal Component analysis (PCA) using prcomp() and a few other options. A common challenge I face is to quickly look at the PCA results using a few different plots. With continual development… Continue reading PCA in tidyverse framework