I have a portfolio (p) of N equities, with let's say weights vector (m) at the start of the calculation period. Each equity has its own set of factors (like corresponding country, industry index, etc.), some of the equities have the same factors.
I am trying to break down the systematic risk into individual factor contributions to portfolio's (p) systematic risk.
What I do is for each component of portfolio (p) I calculate corresponding factors exposures (betas), and say that portfolio's (p) expo to those factors are weighted (based on weights m) sums of betas.
Systematic risk is R2 of portfolio's (p) returns vs sum of factor returns with calculated weights (sums of betas).
Factor k % contribution to portfolio's risk is corr(p,k) * p expo to k * standard deviation of k / standard deviation of the whole portfolio.
Using this methodology I am able to sum up each factors k % contribution to R2 only if portfolio is made of one instrument but if it is of multiple instruments the sum of factor's % contributions does not exactly equal R2.
Q - How to calculate factors % contribution to portfolio's systematic risk? Or does sum of contributions not need to be equal portfolio vs factors (with calculated weights) R2?
Help would be appreciated a lot, thank you in advance