Decomposing & Predicting the Euro Yield Curve
Applying Principal Component Analysis
The term structure of interest rates (“yield curve”) is a representation that plots bonds of the same type (e.g. credit quality, sector) in terms of their prices, expressed as yields, over different maturity dates. For financial institutions is it crucial to understand its behavior and the direct implications it has on the firms capital base.
In this article I study the underlying dynamics of the yield curve by decomposing it into its main drivers. Therefore I will apply Principal Component Analysis (PCA), as proposed in several academic papers. The following topics will be explored:
- Introduce the data
- Interpret the main drivers of variance (principal components) in contrast to traditional yield curve factors “level”, ”slope” and “curvature”
- Evaluate the fit of generated model yield curves from a reduced set of dimensions against actual yields (in-sample vs. out-of-sample)
- Derive non-linear stress scenarios for 1-month ahead
- Test predictability of the main principal components with an autoregressive time series model against a benchmark
The Python implementation of the described ideas can be accessed and forked from my respective repository.
Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.
1. Introducing the Data
The underlying data represents spot rates of Euro Area AAA-rated government bonds on a daily basis. The selected time horizon spans from Jan-2005 to Dec-2020 and can be freely accessed here.
After cleaning & filtering the data for the relevant information, yield curves for different points in time can be plotted. The chart below makes a decline in level as well as steepness quite prominent.
Inspecting the yield curve shifts in more granular time steps, uncovers the volatile dynamics in level, slope and curvature underneath macroeconomic long-term drifts.
In order to better understand what drives each point on the curve, the volatility, as well as the varying correlation between maturities needs to be assessed. Consequently a yield curve that is formed of spot rates from 30 different maturities, would require a 30x30 covariance matrix.
2. Interpretation of Principal Components
Building statistical models with such a large number of parameters, increases model complexity as well as uncertainty stemming from spurious inputs. Principal Component Analysis (PCA) is a well-known technique to reduce this high dimensionality by compressing the variability of all features into a limited set of transformed features.
In this case, each feature of X is a vector of daily yields for a given maturity. In order to capture the maximum variability of all maturities, Eigenvectors are derived. These vectors are based on the covariance matrix of X and minimize the sum of distances when being projected onto the vector itself. For reference see a more in-depth explanation of the topic in the following video...
The Eigenvalue decomposition results in the same number of vectors, as the initial data matrix has. However, the vectors are ordered by importance, so that only the most important ones need to be retained for further analysis.
When plotting the first 3 Eigenvectors, the pronunciation of specific maturities can be observed, which gives an initial intuition about the vector’s economic meaning (e.g. PC2 captures yield curve shifts with divergent directions in short- and long-term maturities)
After retaining only the first 3 Eigenvectors, a simple matrix multiplication with the original yield curves, transforms each yield curve into a data point of 3 dimensions.
It can be observed that a high value in PC1 corresponds to a generally low level of interest rates (violet/blue points in 2019/20) and vice versa. Also the increased steepness of the yield curve is tracked by PC2 (lime green/orange points in 2009/10).
To finalize my conclusion about the interpretability of the derived Eigenscores (Principal Components), each can be compared to a proxy of the traditional factors “level”, “slope” and “curvature”. These are usually observed as some kind of spread between maturities (e.g. 10Y-6M spread as proxy for steepness)
In order to model and predict future behavior of the yield curve, the derived scores need to be back-transformed into meaningful original units. This is done by multiplying the Eigenscores with the inverse of Eigenvectors.
The resulting matrix, represents generated model yield curves, where each curve can be described by only 3 factors.
3. Goodness of Fit
To see if model yield curves generated from low-dimensionality are actually helpful, it is necessary of evaluate their fit against the actually realized curves. A direct comparison of these curves is depicted below, together with the squared deviations at each point in time.
It is obvious that the model-curves based on 3-dimenions are closer to the actual yield curves, than the 2-dimensional ones, since a compression into less dimensions always implies some loss of information.
For predictive modeling it is furthermore important to assess the out-of-sample fit, since Eigenvectors can only be derived ex-post.
Unsurprisingly the out-of-sample fit shows an increased RMSE, compared to the yield curve model that is fitted over the whole time horizon. However the yield curve shape is the overlaying driver for overall RMSE.
4. Deriving Stress Scenarios
The assessment of stress scenarios and their implications on the capital base are an integral part of the financial risk management function in banks and insurances. Its simplest form are parallel upward-, or downward shocks.
However since the explored 3 PCs’ capture the yield curve variability that well, stressing the components directly can give realistic non-linear stress scenarios. The intuitive historical Value at Risk concept can be applied, to find maximum upward-, and downward changes for a selected rolling time window. By considering the 5% largest deviations within that window, a 95% confidence interval can be established.
Again, the back-transformation of Eigenscores gives model yield curves, which in this case are the stressed curves. Consistent to the proven economic interpretation of each PC, a shock in level, slope and curvature is the result.
5. Yield Curve Prediction
The most-interesting question in almost every financial modeling task is concerning its potential for making predictions about the future. In this case I propose a simple Autoregressive (AR) model to predict each vector of Eigenscores separately by its own lags.
By definition the one-step ahead forecast of x shall be a dot-product of its own lags and the fitted corresponding coefficients. To fully specify model parameters, a train & test horizon as well as the maximum number of considered lags is defined.
Additionally a valid time series model requires the stationarity in mean, variance and covariance of the underlying data.
It is clearly observable that the first two vectors of Eigenscores are clearly non-stationary (also supported by Augmented Dickey-Fuller test). Therefore a transformation of the time series into first differences is necessary.
After fulfilling these relevant specifications and transformations, the actual model fit can be assessed. It seems promising that the first lag of each component shows statistical significant (p-value > 0.05), even though the coefficients size is only marginal.
To evaluate how well the model predictions perform, its errors need to be compared to a benchmark model. Its most commonly used implementation is a naive forecaster, that predicts the value in t+1 to be equal to the value in the previous period t+0.
Comparing the prediction errors of both models makes clear, that the AR-model almost resembles the benchmark model due to its small coefficient values close to 0. However the small but significant first-lag causes a marginal out-performance in RMSE over the whole test data.
Conclusion
Altogether, the application of PCA helps to decompose the seemingly high-dimensional yield curve data, into its few main drivers. With this limited set of dimensions, that also holds an economic meaning, causality and explainabilty of financial models can be improved. The derivation of stress scenarios or one-step-ahead forecasts, are use cases in financial risk management or portfolio construction that can be further extended.
In case you want to build up on my work, feel free to check out the respective Github repository.