  This paper presents a method for predicting stock returns using principal
component analysis (PCA) and the hidden Markov model (HMM) and tests the
results of trading stocks based on this approach. Principal component analysis
is applied to the covariance matrix of stock returns for companies listed in
the S&P 500 index, and interpreting principal components as factor returns, we
apply the HMM model on them. Then we use the transition probability matrix and
state conditional means to forecast the factors returns. Reverting the factor
returns forecasts to stock returns using eigenvectors, we obtain forecasts for
the stock returns. We find that, with the right hyperparameters, our model
yields a strategy that outperforms the buy-and-hold strategy in terms of the
annualized Sharpe ratio.
