PCA in practical applications

Discussion on Practical Financial Econometrics
Forum rules
DISCLAIMER: We do not warrant or represent that this forum or its content is free of viruses, worms or other code that might be contaminating or destructive. We cannot guarantee that documents or files downloaded from the Site will be free from viruses and we do not accept any responsibility for any damage or loss caused by any virus. Accordingly, for your own protection, you must use virus-checking software when using the forum. You must not post or provide to us via the forum, any document or file which you believe may contain a virus. You must virus check any document or file which you intend to post or provide to us via the forum. You must ensure that any document or file you intend to post to the forum does not contravene any applicable laws or contravene any person's legal rights. We do not accept any responsibility for any damage or loss you may suffer.
Rolandyau6622
Posts: 3
Joined: Wed Feb 01, 2012 4:25 pm

PCA in practical applications

Postby Rolandyau6622 » Thu Feb 02, 2012 6:51 pm

Hi Prof Alexander,

Very nice to have this interactive platform so that all readers can truly understand the content.
As recently I am doing some PCA investigation in my work, so I have faced some questions. But some cannot be solved even
I have read many papers. Hopefully, you can have some advice on them.


Refer to the formula in book: II.2.4.1

Change p = wTp (matrix form) (with meaning and situation same as the book)


1) Covariance/Correlation Matrix (II.2.3.3 and II.2.3.5)

Many literatures, including this book, mention lots of natures of using covariance/correlation matrix. But I am still not clear about
something.
a) Correlation matrix caters for the problem of different units. But for variables with the same unit and compariable variances,
should I better use covariance? If I use correlation, I have to de-standardize the results due to the unit problem right?
b) The PCA results depend on which matrix to be used. I know the different meanings of them from the graph. But when we cater for the PnL,
In Change p = wTp, do i have to de-standardize the results if I use correlation matrix to esimate the PnL?
If so, the results will still be different. Then why?


2) Interpretation of PCA results (II.2.4)
Seldom do i see people using PCA for quantitative, but only qualatitive explanation. Is it the turth?
I am interested in the quant. explanation.
a) which is the meaning of weighting in each PC? I can only interprete its size and sign? say in table II.2.2,
what is the actual meaning of 0.675 (0.5yr) in the first PC?
b) If I wanna estimate the PnL, say Change p = wTp = w1P1 + w2P2 + W3P3,
I have to assume some parallel shift scenarios, twist and bow scenarios if I wanna find the predicted figure of PnL?
If so, there will be a big problem of how to assume them and make PCA practically less convenient.
c) From Change p = wTp = w1P1 + w2P2 + W3P3, I can calculate the variances of the PnL using different numbers of PCs
E.g. eigenvalue 1 = 70%, eigenvalue 2 = 20%. But Var(PnL) using 1st PC is 30%, Var(PnL) using 2nd PC only is 60%.
This situation may come from the significant risk positions appearing unimportant in PCs.
Then what do we choose the PCs? or We have to use both?




3) Multiple Curves in PCA (II.2.4.7)
In your example, 3 curves are included in one PCA. 3 PCs are obtained.
a) if the patterns of 3 curves coming from that one PCA are different from results from separate PCAs,
does it mean there are high correlation among the curves? If so, how should I interprete them?
b) In the example, Should I have to use the same number of tenors for each curve for fairness? Otherwise, result will be biased?
c) If I apply the PCA for those 3 curves separately, can i find the covariances if those 3 PC1s, how?
Should it imply if there are some common risk factors across the curves? Or anything else?


Sorry to have so many questions as it seems there are seldom very practical applications of PCA with clear explanation (in finance)to be found.
Hope it wont bother you much. Thanks very much for it. =]

Best,
Roland

coalexander
Posts: 815
Joined: Sun Sep 28, 2008 10:30 pm

Re: PCA in practical applications

Postby coalexander » Fri Feb 03, 2012 1:52 pm

Dear Roland, I will do my best to answer all your questions but you have many questions which, on a more careful reading, you will see that the answers are already there in the text.

Which is the equation number to which you refer?

1a) Refer to FAQS, section II.2.2.3 (a)
1b) Refer to Case Study I.2.6.3 and excel spreadsheet which shows how to get exactly the same units back after de-standardizing

2a) Refer to (I.2.38) or (II.2.3) - or in words, the eigenvalue gives you the % of the total sample variance that is explained by movements of the type associated with the corresponding PC - also see quant interpretation of common trend as first PC in Case study i.2.6.3.
2b) Your comment only assumes you apply PCA to a term structure. Then, the shift/tilt/convexity is automatic - refer to section II.2.3.5.
2c) I cannot understand this question, sorry.

3a) there are two examples in this section, the first uses 2 PCs the second uses 6 PCs.
3b) Interpretation is given in the text eg in para about the figure on page 77, also in bullets pages 78-79.
3c) PCs have zero covariance by construction because they are orthogonal


This time I have answered all your questions but it has taken me a lot of time as there are so many, and I have many demands on my time. In future please think more about the material in the book before asking for help in understanding it.

Rolandyau6622
Posts: 3
Joined: Wed Feb 01, 2012 4:25 pm

Re: PCA in practical applications

Postby Rolandyau6622 » Fri Feb 03, 2012 6:10 pm

Hi Prof Alexander,

I do apology about it if it did spent you much time on reading my questions. I had read through the contents of PCA in your book.
Maybe I didnt ask in a clear way. Let me tryna ask more clearly.


2) Given some background,
say in table II.2.2, 0.675 (0.5yr), 0.1030(1yr)....are the weighting of PC1

Given (PnL) p = wTp = w1P1 + w2P2 + W3P3, (refer to the formula in book: II.2.4.1)
w1 = PV01*b1, where b1 is the weighing of PC1, like 0.657, 0.1030... PV01 is the duration of te portfolio.
Then

a) what is the actual meaning of 0.675( 0.675 is the component of PCs, instead of the eigenvalue.)?
(like what is the unit of 0.675? its the corresponding scale of rate movement? does 0.657 mean the change of rate per unit change of PC1? if so, what is per unit?)
when i apply it for PnL using one PC only, does it make sense to approximate the PnL by the value of w1? (p~w1)
Or p~w1, where every weighting in b1 is divided by the benchmark tenor (say 1Y) weighting to see the PnL movement per bp change of 1Y rate movement

b) If I wanna estimate the value of PnL using more than 1 PC, like p = wTp = w1P1 + w2P2
Assumed P1 and P2 present shift, and tilt.
Qualitatively, I can interpret the movement of PnL w.r.t. the shift, tilt implied by PCs.
But, quantitatively, if i am interested in the any actual number of PnL movement,
what I can ONLY do to estimate the Pnl is to assume some numbers with the corresponding scenarios into the weighting of PC1,PC2 and PC3?
like for PC1, i assume all weightings are +10bp, then for PC2, i may assume some negative bp changes for short tenors and positive ones for long tenors, etc...
If this is the way to quantitatively find the value of PnL, this assumption process makes PCA seemingly less efficient.


3)


a) In eg. II.2.8. the GBP eigenvectors in combined PCA and single curve PCA are similar but the eigenvalues are not.
As the GBP PCs in combined PCA include the correlation effects coming from USD and EURO, right?
If so, the results in multiple curve PCA are more realistic and accurate than single curve PCA, right?


b) I am sorry that I dun see any words mentioning if using equal numbers of tenors for each curve in one PCA is a must.
From the examples in the book, i assume its a must.

c) What I mean about PC1s are from different separate PCAs, instead of a single PCA.
PCs are set such that PC1,PC2,PC3... are uncorrelated among them within a PCA.
But however if, say, do PCAs for GBP, USD and EURO SEPARATELY. Then I will have 3 PC1s.
can I find the covariances/correlations of these 3 PC1s?
will it imply some common risk factors across GBP, USD and EURO if these covariances/correlations are high?
like , assume there are the similar monetary policy applied in UK, US and EUR countries at the same time, we may see the common tilt movement implied by PC2s in each of the single curve PCA. Am i correct?


I am very very glad to see your kindness of spending time on answering questions of readers. I do sincerely thank you very much of it.

Best,
Roland

coalexander
Posts: 815
Joined: Sun Sep 28, 2008 10:30 pm

Re: PCA in practical applications

Postby coalexander » Sat Feb 11, 2012 5:28 pm

Here are some (relatively brief) answers Roland, plus a presentation I made for a PRMIA webinar, which should help you gain a bit more understanding. Please also refer to the excel spreadsheets as many of your questions could be answered on closer examination of these.
2.
a) Depends on what the data were but if PCA applied to covariance matrix of returns then Rtn = w1*PC1 + … means when PC1 increases by 1%, but other PCs remain fixed, the Rtn increases by w1%. If PCA on covariance of PnL, then PnL = w1*PC1 + … means when PC1 increases by 1$, PnL increases by w1$. Same as any factor model.
b) I don’t understand your question.
3.
a) Eigenvalues are normalized so that their sum of squares is one, so their values depend on the size of the system. Yes, correlation between both curves is in multiple curve model. Cannot say one is more accurate than another – depends on purpose.
b) Can have different vertices in each curve in multiple PCA
c) Yes indeed, covariance between PCs very important to determine correlation of major factors in each curve.
best wishes, Carol

coalexander
Posts: 815
Joined: Sun Sep 28, 2008 10:30 pm

Re: PCA in practical applications

Postby coalexander » Sat Feb 11, 2012 5:32 pm

Here's one of the spreadsheets I use -- 12 meg in total and discussion board blows up so can't upload all. Hope it helps, Carol

Rolandyau6622
Posts: 3
Joined: Wed Feb 01, 2012 4:25 pm

Re: PCA in practical applications

Postby Rolandyau6622 » Tue Feb 14, 2012 4:29 pm

Hi Prof Alexander,

Again thanks very much for your reply.


2a) "... when PC1 increases by 1%...". So what do you exactly mean by this sentense? PC1 here u mentioned is vector or value?
Assume PC1 represents the parallel shift, then what does it mean by 1% increase of parallel shift implied by PC1? 1% of what numbers? its a little bit abtract.

b) In the "PCA_monthly.xls", in tab "P&L", there are some tilt numbers in col E and shifts in col C so the PnLs in col F and D are obtained.
Those numbers in col C and E are assumed? If I dun make this assumption, I cannot predict PnL from R=w1PC1+w2PC2..., like "expected PnL" or else?
(except the PnL's volatility)



3a) The reason why i said multiple curve model is more realistic is the products/curves co-exist in the real market instead of alone. So the correlation of products
have to be included in the analysis, even if I only take one of the curves in my analysis.
Also, I encountered some cases in which the PC patterns of, say one ccy, in multiple curve(ccy) model and in single curve(ccy) model differs significantly.
I know its due to the correlation problem. But how can I interprete it more precisely?

c) to compare the correlation of PC1s in different PCAs, should i just use the excel formula "CORREL()" to the weightings of any 2 PC1s to find their correlation?

coalexander
Posts: 815
Joined: Sun Sep 28, 2008 10:30 pm

Re: PCA in practical applications

Postby coalexander » Tue Feb 14, 2012 9:25 pm

Hi again

Here are my answers to your further questions:

2a) A principal component is a time series -see the graphs of PCs in vol I and II
2b) As stated in the intro to each book, anything red is an input that can be changed by the user, anything blue is an output
3a) By examining the eigenvectors, as explained in the text
3c) Yes, this is one way of doing it. Vol II chapters 3 and 4 explain other ways.

Best wishes, Carol

mtsm
Posts: 1
Joined: Sat May 12, 2012 12:33 pm

Re: PCA in practical applications

Postby mtsm » Sat May 12, 2012 10:04 pm

hi,

rolandyau99, I am quite interested in your question 3 on PCA on multiple curves. Have you done any interesting research on this or found
research being published? I would be interested.

In other words I wonder how to perform PCA on (two) segmented but correlated markets? Performing PCA on the two market segments
separately corresponds to assuming 0 cross-correlations between the segments (???). I wonder if someone has tried to characterized
this for cross-currency rate markets for example?

thanks,
mtsm

coalexander
Posts: 815
Joined: Sun Sep 28, 2008 10:30 pm

Re: PCA in practical applications

Postby coalexander » Sun May 13, 2012 10:37 am

Yes, there is an example on this in Vol II. Also, see the thread in this discussion forum entitled 'Comparative PCA on Multiple Yield Curves'

Cheers, Carol

asimakoa
Posts: 5
Joined: Thu Aug 08, 2013 8:02 am

Re: PCA in practical applications

Postby asimakoa » Thu Aug 08, 2013 12:12 pm

Dear Dr Alexander,
I am an IR trader and I am using the classic PV01 method to calculate my Delta risk to each point of the swap curve. I have recently applied PCA to have and a view of my exposure to the 3 major curve movements. I have used your notes and the workbook “PCA_Monthly” (that I found at the web).
At worksheet “VaR” you use as an input a “PVO1 column” and the three main eigenvectors to find:
Net sensitivities
P1 P2 P3
£8,056 -£15,264 -£167

Question. If I put at PCA_Monthly workbook/VaR worksheet/PV01 Column" my PVO1 possition in swaps EG:
Term PVO1
1y 5,000
2Y -2,000
3y -5,000
4y -5,000
5y 16,000
.
.
.
30y -5,000
Where, the meaning is that I will make 16,000eur if 5y swap increases by 0.01%, and I will loose 2,000eur if 2y swap increases by 0.01%... ext...

What will be the meaning of the calculated Net Sensitivities in terms of sign and absolute value? To be more specific suppose that i find:

P1 P2 P3
4,000eur -18,000eur 2,000eur

1) Does it mean that I will make money if I have a parallel movement defined by first eigenvector?
2) If yes does the absolute value of 4,000 informs me of the size of that amount?
3) Moreover, If i draw the first factor i see the move of the swap curve that it implies. However, I have no clue regarding the range of the move that it implies as at y'y axis I have the eigen vector components and no basis points... So, how do i proceed ?


Return to “Volume II”

Who is online

Users browsing this forum: No registered users and 1 guest