I've made a mistake in the implementation of Pykthin Multi-factor adjustment which I'm fairly certain comes from me not understanding the model completely. The model was developed to drastically reduce computational time by using an analytic approach. When I try to implement it I found that it is much slower than the Monte Carlo approach that it is to replace....

The portfolio I'm using consists of 10 000 exposures. The way i understand Pykhtin's framework this means i must look at the all the asset correlations between these as follows:

$$\rho_{ij}^Y=\frac{r_i r_j \sum_{k=1}^N\alpha_{ik} \alpha_{jk}-a_i a_j}{\sqrt{(1-a_i^2)(1-a_j^2)}}$$

I guess that there is some symmetry that could make it a bit easier (i'm thinking n over k) but that is still a correlation matrix with 10 000 x 10 000 elements. As it stands now i cannot calculate this in matrix form due to lack of memory and using a loop takes forever...

I'm hoping someone is familiar with the model and knows where I'm wrong.

Here is a link to his paper that I'm using: "Multi-factor adjustment", by Michael Pykhtin, Risk, March 2004 http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/e9c944cf9ab30ac9c12577b4001e0342/\$FILE/Pykhtin-Multi-fractor%20adjustment.pdf

Edit: I'm now thinking that since I have a small number of variations of credit scores (8) I can calculate all the combinations of factors (sectors) and credit scores 8x13 for me and most calculations could be classed as one of these and easily summed up.

Edit 2: I think this might have worked. Essentially i made my portfolio of 10 000 exposures to a portfolio of 8x13 (credit scores x sectors) and summed up the appropriate variables so that this made sense. Then I just preceded with the calculations.