custom pca - seb · 2016-10-10 · page 4 the danish yield curve in 2011 traditional pca of the...

12
2014 Custom PCA SEB Investment Management House View Resarch Group

Upload: others

Post on 10-Apr-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

2014

Custom PCASEB Investment ManagementHouse View Resarch Group

Page 2: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Editorial

SEB Investment ManagementSveavågen 8SE-106 Stockholm

Authors:

Portfolio Manager, TAA: Peter Lorin RasmussenPhone: +46 8 763 69 26E-mail: [email protected]

Portfolio Manager, Fixed Income & TAA: Tore Davidsen Phone: +45 33 28 14 25 E-mail: [email protected]

This document produced by SEB contains general marketing information about its investment products. Although the content is based on sources jud-ged to be reliable, SEB will not be liable for any omissions or inaccuracies, or for any loss whatsoever which arises from reliance on it. If investment research is referred to, you should if possible read the full report and the disclosures contained within it. Information relating to taxes may become outdated and may not fit your individual circumstances. Investment products produce a return linked to risk. Their value may fall as well as rise, and historic returns are no guarantee of future returns; in some ca-ses, losses can exceed the initial amount invested. Where either funds or you invest in securities denominated in a foreign currency, changes in exchange rates can impact the return. You alone are responsible for your investment decisions and you should al-ways obtain detailed information before taking them. For more information, please see the relevant simplified prospectus for the funds, and the relevant information brochure for funds and for structured products. If necessary you should seek advice tailored to your individual circumstances from your SEB advisor.Skandinaviska Enskilda Banken AB (publ) is incorporated in Sweden as a Li-mited Liability Company. It is regulated by Finansinspektionen, and by the local financial regulators in each of the jurisdictions in which it has branches or subsidiaries. Skandinaviska Enskilda Banken AB, Sveavågen 8, SE-106 Stockholm

Disclaimer

Table of Contents

Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3The Danish Yield Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4Traditional PCA of the Yield Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4Custom PCA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5Optimization Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Factor Loadings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

Page 3: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 3

Editorial

IntroductionThis note shows how custom factors can be constructed in a covariance decomposition of the yield curve. In the present yield environment this can be useful if the output of the covariance decomposition is used as input in a return attribution and/or a risk model.

In a textbook world a covariance decomposition of the yield curve will tell you that the variance is dominated by the shifts, the steepenings, and the bends herein. However, because nominal government bond yields in safe haven countries, such as Denmark and Germany, dropped to unprecedented low levels in 2011, this relationship is no longer guaranteed to hold. We find that the shifts in the short end of the Danish yield curve is now a dominating factor, and explains a larger degree of variance than both the steepenings and the bends.

The method proposed in this paper can be interpreted as an extension of the two industry standard covariance decomposition methods, the principal components analysis (PCA) and the singular value decomposition (SVD). It allows for the custom definition of a limited and unique set of factors. This is particularly useful in the interpretation of the output factors; i.e. the eigen-vectors.

In order to increase the readability of the note we will not distinguish bet-ween a decomposition of the yield curve and a decomposition of the chan-ges in the yield curve. This is merely because the distinction can become cumbersome to highlight all the time. Naturally, all the results are based pu-rely on changes in the yield curve. Furthermore, all results are based purely on the Danish (government bond) yield curve.

The methodology is in large part inspired by Meucci (2010)1. In a context of quantifying the diversification of a generic portfolio, he applies methods very similar to those shown in this note.

The note will start by analysing the Danish government bond yield curve in a traditional PCA. It will then present the conditional covariance decompo-sition method.

1 Meucci, Attilio. Risk and Asset Allocation. Springer, 2010.

Page 4: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 4

The Danish Yield Curve in 2011

Traditional PCA of the Yield Curve

In a textbook setting the correlation matrix of the yield curve should be a Toeplitz matrix. It can be shown that this implies that the first three eigenve-ctors of the covariance decomposition, sorted by eigenvalues, are:

1. Parallel shifts of the yield curve

2. Steepenings of the yield curve

3. Bends of the yield curve

In practice, however, the covariance decomposition will not per definition yield the textbook ordering of the eigenvectors. To illustrate, Figure 2 graphs the first four eigenvectors of the yield curve. It should be apparent that the second eigenvector represents the short end of the curve. This factor has pushed down the steepenings and the bends of the curve to the third and fourth most important eigenvectors, respectively.

Figure 1 graphs the yield curve from April to November 2011. The important thing to note is that the general yield level dropped significantly from the beginning of May. This coincided with the resurgence of the European debt crisis and the ensuing flight to safety. At the same time, the curve flattened in absolute terms due to the short end of the curve reaching its nominal “lower” bound of 0%.

Figure 1: The Danish Government Bond Yield Curve - 2011

Source: SEB internal calculations

Page 5: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 5

Custom PCA

Figure 2: Eigenvectors of the Danish Government Bond Yield Curve

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Eigenvector #1

1 2 3 4 5 6 7 8 9 10 11-1

0

1Eigenvector #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Eigenvector #3

1 2 3 4 5 6 7 8 9 10 11-1

0

1Eigenvector #4

Source: SEB internal calculations

It is important to note that there is nothing wrong with the second eigen-vector being the short end of the curve. One merely has to be aware of it and adjust the interpretation accordingly. For example, if one merely estimated the first three eigenvectors and directly applied them in a return attribution model without looking at them, one would make an interpretation error if the textbook labels were used.

Furthermore, if the eigenvectors are estimated on the basis of a rolling win-dow, then the interpretation hereof could change over time. In a return at-tribution model it is clearly not optimal to have time-varying eigenvectors and thereby interpretations. It is much easier just to have time varying ex-planatory power; i.e. eigenvalues.

Instead of using the direct output of a PCA, we propose a methodology where a limited set of custom factors can be defined. The factors are con-structed so that they obey the same restrictions as normal eigenvectors. Then, conditional hereof, we estimate the set of remaining residual “eigen-vectors”.

Figure 3 graphs our custom factors. They are exactly the factors that one would find in a perfect textbook world; that is they are all sine waves with varying frequency. The first factor represents shifts to the yield curve, the second factor represents a steepening of the yield curve, and the third fac-tor represents a bend of the yield curve.

Page 6: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 6

Figure 3: Custom Factors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

Source: SEB internal calculations

The custom factors must satisfy two conditions:

1. They must be orthogonal. If not, they cannot be used to reconstruct the covariance matrix keeping the full rank. Let denote the i’th custom factor. Then the condition can be written as:

2. The norm of each factor must be 1. This is merely a scaling condition to allow us to compare the factor loadings on an equal basis. This can be written as

Under these two constraints one could in principal create all kinds of fac-tors. For example it would be possible to create a factor that isolates the spread between the 2 year and 10 year point on the yield curve. We feel that the factors should be chosen so as to focus on the particular trading stra-tegy. If the primary bet is on the spread between two separate points on the curve then one should create a factor to illustrate this. This is particularly important if the output is going to be used in a return attribution model.

Custom PCA of the yield curve.doc

4(7)

Figure 3: Custom factors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

Source: SEB internal calculations

The custom factors must satisfy two conditions: 1. They must be orthogonal. If not, they can not be used to reconstruct the

covariance matrix keeping the full rank. Let ic denote the i’th custom factor

then the condition can be written as: 0' =ji cc

2. The norm of each factor must be 1. This is merely a scaling condition, to allow us the compare the factor loadings on an equal basis. This can be written as

1=ic

Under these two constraints one could in principal create all kinds of factors. For example it would be possible to create a factor that isolates the spread between the 2 year and 10 year point on the yield curve. We feel that the factors should be chosen so as to focus on the particular trading strategy. So if the primary bet is on the spread between two separate points on the curve then one should create a factor to illustrate this. This in particular if the output is going to be used in a return attribution model.

Optimization problem

With a predefined set of custom factors the question then becomes how to estimate a set of new orthogonal vector and factor loadings so that we can replicate the covariance matrix. First, note that the standard eigenvectors of a covariance matrix can be estimated as:

0,1,.

}'max{arg

>=<>=<

∑=

ji

ii

i

eeeest

eee

Custom PCA of the yield curve.doc

4(7)

Figure 3: Custom factors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

Source: SEB internal calculations

The custom factors must satisfy two conditions: 1. They must be orthogonal. If not, they can not be used to reconstruct the

covariance matrix keeping the full rank. Let ic denote the i’th custom factor

then the condition can be written as: 0' =ji cc

2. The norm of each factor must be 1. This is merely a scaling condition, to allow us the compare the factor loadings on an equal basis. This can be written as

1=ic

Under these two constraints one could in principal create all kinds of factors. For example it would be possible to create a factor that isolates the spread between the 2 year and 10 year point on the yield curve. We feel that the factors should be chosen so as to focus on the particular trading strategy. So if the primary bet is on the spread between two separate points on the curve then one should create a factor to illustrate this. This in particular if the output is going to be used in a return attribution model.

Optimization problem

With a predefined set of custom factors the question then becomes how to estimate a set of new orthogonal vector and factor loadings so that we can replicate the covariance matrix. First, note that the standard eigenvectors of a covariance matrix can be estimated as:

0,1,.

}'max{arg

>=<>=<

∑=

ji

ii

i

eeeest

eee

Custom PCA of the yield curve.doc

4(7)

Figure 3: Custom factors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

Source: SEB internal calculations

The custom factors must satisfy two conditions: 1. They must be orthogonal. If not, they can not be used to reconstruct the

covariance matrix keeping the full rank. Let ic denote the i’th custom factor

then the condition can be written as: 0' =ji cc

2. The norm of each factor must be 1. This is merely a scaling condition, to allow us the compare the factor loadings on an equal basis. This can be written as

1=ic

Under these two constraints one could in principal create all kinds of factors. For example it would be possible to create a factor that isolates the spread between the 2 year and 10 year point on the yield curve. We feel that the factors should be chosen so as to focus on the particular trading strategy. So if the primary bet is on the spread between two separate points on the curve then one should create a factor to illustrate this. This in particular if the output is going to be used in a return attribution model.

Optimization problem

With a predefined set of custom factors the question then becomes how to estimate a set of new orthogonal vector and factor loadings so that we can replicate the covariance matrix. First, note that the standard eigenvectors of a covariance matrix can be estimated as:

0,1,.

}'max{arg

>=<>=<

∑=

ji

ii

i

eeeest

eee

Page 7: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 7

Optimization Problem

With a predefined set of custom factors the question then becomes: how do we estimate a set of new orthogonal vectors and factor loadings so that we can replicate the covariance matrix?

First, note that the standard eigenvectors of a covariance matrix can be es-timated as:

Where denotes the covariance matrix.

With our predefined custom factors, this optimization problem is slightly changed so that it becomes:

That is we find the residual factors by a standard PCA optimization problem, under the additional constraint that the factors must be orthogonal not only to each other but also to our predefined set of factors.

With the set of custom factors it is easy to estimate their factor loadings as:

Figure 4 graphs the first three custom factors and the largest residual ”eigenvector” based on the yield curve graphed in Figure 1.

Figure 4: Custom factors and residual eigenvectors

Source: SEB internal calculations

Custom PCA of the yield curve.doc

4(7)

Figure 3: Custom factors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

Source: SEB internal calculations

The custom factors must satisfy two conditions: 1. They must be orthogonal. If not, they can not be used to reconstruct the

covariance matrix keeping the full rank. Let ic denote the i’th custom factor

then the condition can be written as: 0' =ji cc

2. The norm of each factor must be 1. This is merely a scaling condition, to allow us the compare the factor loadings on an equal basis. This can be written as

1=ic

Under these two constraints one could in principal create all kinds of factors. For example it would be possible to create a factor that isolates the spread between the 2 year and 10 year point on the yield curve. We feel that the factors should be chosen so as to focus on the particular trading strategy. So if the primary bet is on the spread between two separate points on the curve then one should create a factor to illustrate this. This in particular if the output is going to be used in a return attribution model.

Optimization problem

With a predefined set of custom factors the question then becomes how to estimate a set of new orthogonal vector and factor loadings so that we can replicate the covariance matrix. First, note that the standard eigenvectors of a covariance matrix can be estimated as:

0,1,.

}'max{arg

>=<>=<

∑=

ji

ii

i

eeeest

eee

Custom PCA of the yield curve.doc

5(7)

Where ∑ denotes the covariance matrix With our predefined custom factors this optimization problem is slightly changed so that it becomes:

0,

0,1,.

}'max{arg

>=<

>=<>=<

∑=

ji

ji

ii

i

ceee

eesteee

That is we find the residual factors by a standard PCA optimization problem, under the additional constraint that the factors must be orthogonal not only to each other but also to our predefined set of factors. With the set of eigenvectors is easy to estimate the factor loadings as:

EE ∑= 'λ Figure 4 graphs the first three custom factors and the largest residual eigenvector based on the yield curve graphed in figure 1. Figure 4: Custom factors and residual eigenvectors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

1 2 3 4 5 6 7 8 9 10 11-1

0

1Non custom factor #1

Source: SEB internal calculations

Although the largest residual eigenvector has a nonzero exposure to almost all eigenvectors it is still dominated by the short end of the curve. It is also interesting to see that the long end of the curve is included in the vector which makes sense in light of the development in 2011.

Factor In a traditional PCA decomposition the eigenvectors are sorted by the factor

Custom PCA of the yield curve.doc

5(7)

Where ∑ denotes the covariance matrix With our predefined custom factors this optimization problem is slightly changed so that it becomes:

0,

0,1,.

}'max{arg

>=<

>=<>=<

∑=

ji

ji

ii

i

ceee

eesteee

That is we find the residual factors by a standard PCA optimization problem, under the additional constraint that the factors must be orthogonal not only to each other but also to our predefined set of factors. With the set of eigenvectors is easy to estimate the factor loadings as:

EE ∑= 'λ Figure 4 graphs the first three custom factors and the largest residual eigenvector based on the yield curve graphed in figure 1. Figure 4: Custom factors and residual eigenvectors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

1 2 3 4 5 6 7 8 9 10 11-1

0

1Non custom factor #1

Source: SEB internal calculations

Although the largest residual eigenvector has a nonzero exposure to almost all eigenvectors it is still dominated by the short end of the curve. It is also interesting to see that the long end of the curve is included in the vector which makes sense in light of the development in 2011.

Factor In a traditional PCA decomposition the eigenvectors are sorted by the factor

Custom PCA of the yield curve.doc

5(7)

Where ∑ denotes the covariance matrix With our predefined custom factors this optimization problem is slightly changed so that it becomes:

0,

0,1,.

}'max{arg

>=<

>=<>=<

∑=

ji

ji

ii

i

ceee

eesteee

That is we find the residual factors by a standard PCA optimization problem, under the additional constraint that the factors must be orthogonal not only to each other but also to our predefined set of factors. With the set of eigenvectors is easy to estimate the factor loadings as:

EE ∑= 'λ Figure 4 graphs the first three custom factors and the largest residual eigenvector based on the yield curve graphed in figure 1. Figure 4: Custom factors and residual eigenvectors

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

1 2 3 4 5 6 7 8 9 10 11-1

0

1Non custom factor #1

Source: SEB internal calculations

Although the largest residual eigenvector has a nonzero exposure to almost all eigenvectors it is still dominated by the short end of the curve. It is also interesting to see that the long end of the curve is included in the vector which makes sense in light of the development in 2011.

Factor In a traditional PCA decomposition the eigenvectors are sorted by the factor

1 2 3 4 5 6 7 8 9 10 110

0.2

0.4Custom factor #1

1 2 3 4 5 6 7 8 9 10 11-0.5

0

0.5Custom factor #2

1 2 3 4 5 6 7 8 9 10 11-1

0

1Custom factor #3

1 2 3 4 5 6 7 8 9 10 11-1

0

1Residual factor

Page 8: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 8

Factor Loadings In a traditional PCA decomposition, the eigenvectors are sorted by the fac-tor loadings. Because we have created a set of custom vectors to which the eigenvectors are orthogonal, this relationship can and will be broken.

Figure 5 graphs the loadings of the different factors, where the first three are the custom vectors and the remaining are the residual eigenvectors.

Figure 5: Factor Loadings

1 2 3 4 5 6 7 8 9 10 110

0.5

1

1.5

2

2.5

3

3.5x 10

-6

Factor

Load

ing

Source: SEB internal calculations

The figure illustrates that in our sample the most significant factor is the first custom factor; shifts to the yield curve. Second, the first residual fac-tor (factor four) is more important than the second (steepenings) and the third (bends). The residual eigenvectors are all declining; an artefact of the optimization problem, and they are smaller than the smallest of the custom factors.

As we have stated a couple of times, using a traditional PCA decomposition, results in time-varying factors. Because we have fixed our three custom fac-tors, this is no longer a problem. The variation is, however, transferred to the degree of explanation in the system. That is, the three factors will now describe a varying factor of the entire variation in the system. In a traditional PCA this factor loading variation would also exist, but it would probably not be as extreme.

Although the largest residual ”eigenvector” has a nonzero exposure to al-most all maturities, it is still dominated by the short end of the curve. It is also interesting to see that the long end of the curve is included in the first residual ”eigenvector”. This makes sense in light of the developments in 2011, where long maturity bonds came into high demand during the crisis.

Page 9: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 9

SummaryThis note presents a methodology that allows one to fix the factors in a PCA decomposition of the yield curve. This can be useful if one uses factor mo-dels for a return attribution and/or risk model.

The methodology is particularly useful in the current economic and yield environment. This note illustrates that the traditional results of the PCA do not follow that of the textbook anymore. The second most important factor in the decomposition is not the steepenings of the yield curve, but the short end of the curve.

The methodology is merely a simple extension of a traditional PCA and should be easy to incorporate provided one has a decent non-linear solver.

Page 10: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 10

Page 11: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should

Page 11

Page 12: Custom PCA - SEB · 2016-10-10 · Page 4 The Danish Yield Curve in 2011 Traditional PCA of the Yield Curve In a textbook setting the correlation matrix of the yield curve should