Hi everyone!
I am trying to replicate results from this paper. I got as far as writing some code to calculate the "eigenportfolio", however, I cannot replicate the results from Figure 3.
I appreciate that this is not the cleanest implementation, but any help will be appreciated.
My main points of confusion are:
- How many stocks were selected for the PCA?
- What is a Market eigenvalue?
- When computing equation (9) do I need to rescale Q_i such their sum=1 when adding across all i's?
- What is a principal eigenportfolio? Why is my result so different?
PokerWinner
Hi all,
A week or so later I managed to "fix" it a bit. It does not produce the same results but at least it crashes in 2007 just like in the paper. can anyone guide me on what I can do.
Â
Could it be that my results are so wrong because of the fees? How would I create the same plot as in the paper?
Â
Derek Melchin
Hi Pietro,
#1 In the algorithm above, all of the stocks in the universe are invested in.
#2 The paper doesn't explicitly define the market eigenvalue. However, the paper notes "the dominant eigen vector is associated with the 'market portfolio'" (p. 10), so it seems to be the eigenvalue of the first PCA component.
#3 The paper doesn't instruct us to rescale the `Q_i`. The underlying reason the sum exceeds 1 may be because the pandas `corr` method can contain negative values where the empirical correlation matrix described in the paper is "non-negative definite" (p. 7). Consider using a different method for computing the empirical correlation matrix.
#4 The principal eigenportfolio is the portfolio that's constructed by using the PCA factors. There are several reasons the results from the algorithms above differ from Figure 3 in the paper:
When continuing the development of this algorithm, it may help to remove fees, slippage, and spread costs. The attached backtest demonstrates how we can accomplish this, and it also demonstrates how we can remove the daily history calls from the universe selection model.
Best,
Derek Melchin
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
PokerWinner
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!