Linear Algebra for Finance

Principal Component Analysis for Finance

In today’s era of advanced financial analytics, quantitative concepts that have been around for quite some time are finding their applications in the domain of Finance. In recent times the explosion of data courtesy of the big data revolution is impacting almost all industries and financial industry is no exception to this. Sophisticated mathematical techniques are making rapid inroads into various areas of finance especially financial analytics.

One such concept that has been borrowed from linear algebra which is a branch of mathematics is the concept of Principal Component Analysis (hereinafter also referred to as ‘PCA’). PCA has found application in many areas of finance including yield analysis, risk management etc. In this post we will discuss how PCA can be used for the purpose of risk measurement of a portfolio.

For any financial institution be it a bank, insurance company, NBFI etc., interest rate is a key risk factor which must be managed. Market quotes interest rates for various tenors ranging from overnight rates up to say 30 years, thus there are more than 15 tenor points for which market interest rate quotes are available. Financial firms have ready systems for fetching this market data for further usage. Now this data on a daily basis and further considered over a long period of time is huge in volume. It would be inefficient to use all of the available data for further analysis, the reason being not all of the available data will be used for the purpose of managing risk i.e. not all tenor points contribute significantly to the risk measurement of the portfolio. Thus, if we can have a mathematical model to process the incoming data and select only those interest rate tenor points which contribute to the risk of the company’s portfolio, it would make the model highly efficient for usage thereby enhancing overall system performance. By doing this we would have a fast calculator for measuring the risk of a bond portfolio. We chose a bond portfolio because plain vanilla bonds have one source of risk factor i.e. interest rate only, assuming we ignore the default risk for now.

PCA as a concept is useful for measuring risk arising from a set of correlated market variables. Interest rates that are quoted in the market have correlation to each other. Thus, an interest rate for tenor 1Y is not independent of interest rate for tenor say 3Y. There is always some degree of correlation between all the tenor points with each other. To achieve this objective, the PCA model computes a set of variables that are called as Principal components (PCs). PCA is a model which involves transforming a set of observations (i.e. interest rate time series in our case) into a set of uncorrelated variables called as the PCs. This transformation behaves in way such that the first PC explains the largest possible variance, and this accounts for majority of the variability in the data. Each succeeding component in turn explains the highest possible variance while at the same time following the condition of orthogonality to each of the preceding PCs. Orthogonality is a property in linear algebra which is used to test if two vectors are perpendicular to one other i.e. the two vectors are uncorrelated with one another.

Orthogonal Vectors. The essence of a PCA model (image source: internet)

Resulting PCs computed by the model are uncorrelated to each other, thereby allowing them to be used independently with respect to each other. Individual PCs are calculated using the concept of Eigen values again a concept of linear algebra. PCs represent directions of the data that explain the maximum amount of variance, i.e. the vectors that capture most of the information that is embedded in the data. The relationship between the variance and information is that, the larger the variance carried by the vector, the larger the dispersion of the data points along it, and larger the dispersion along the vector, the more information it contains.

PCA algorithm performs dimensionality reduction on the data set. Dimensionality reduction implies, we attempt to capture the essence of a multivariate dataset into fewer number of variables that would explain the required result.

So subsequent to generation of individual PCs, only those PCs are selected that explain the maximum variation thereby capturing the essence of the analysis. Machine learning algorithms implementing the concept of Principal Component Analysis (PCA) can be used to this end. A PCA algorithm accepts all of the incoming interest data as an input, and it processes the data so that as an output we get a certain set of interest rate tenor points which contribute to around say 97% to 98% of the risk of our interest rate sensitive portfolio. This is technically termed as dimensionality reduction as mentioned earlier. This substantially reduces the load on the system resources, since now, the system will use only those tenor points as have been chosen by the PCA algorithm. This enables freeing up of valuable system resources which now can be used for other productive purposes. PCA can be implemented in Python.

Below given is the algorithm for implementation of PCA model for risk measurement, we will discuss the Python code for the same in a later post

PCA algorithm involves the following steps:

It is worthwhile to note that there is no correlation term involved in the formula of σ (portfolio). The reason being that the PCs are independent of each other and thus correlation between them is 0.

c. Next assume we are calculating the 99% 1-day VaR of the portfolio, then the portfolio VaR is given by formula σ (portfolio) * 2.33.

This is the risk measurement of the portfolio using PCA methodology. There are multiple other models that are used for risk measurement of the portfolio. PCA model provides one more viable alternative for calculation of portfolio risk. In a later post we will discuss the implementation of PCA algorithm for risk measurement by developing a model using Python programming.



Founder: FinQuest Institute | Ekspert Consulting;;

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store