# Contribution to Mahalanobis Distance

I am using Mahalanobis Distance to measure abnormal behavior within a portfolio consisting of a handful of general asset types, and am trying to figure out how to decompose this measurement into marginal contributors on a granular level. My variables are as follows:

• $$r_i$$ is scalar, representing the return from asset $$i$$
• $$\Sigma_{i,j}^{-1}$$ is the $$(i,j)$$ element of the inverse covariance matrix ($$\Sigma^{-1}$$)
• $$MD$$ represents the Mahalanobis Distance value
• $$MD_i$$ represents the marginal contribution to Mahalanobis Distnace from asset $$i$$

I've already split it up into marginal contribution from each asset (done similarly as marginal contribution to portfolio volatility): $$MD_i = r_i\frac{\partial MD}{\partial r_i} = \frac{r_i\sum_j(r_j\Sigma^{-1}_{i,j})}{MD}$$ But would like to split it up even further into individual volatility and correlation components. Below is my attempt at that: \begin{align} MD_i &= \frac{r_i\sum_j(r_j\Sigma^{-1}_{i,j})}{MD} \\ &= \frac{r_i^2\Sigma^{-1}_{i,i}}{MD} + \frac{r_i\sum_{j\neq i}r_j\Sigma^{-1}_{i,j}}{MD} \\ &= \underbrace{\frac{r_i^2\Sigma^{-1}_{i,i}}{MD}}_{\text{Volatility Component}_i} + \underbrace{\frac{r_ir_j\Sigma^{-1}_{i,j}}{MD} + \frac{r_ir_k\Sigma^{-1}_{i,k}}{MD} + \dots + \frac{r_ir_l\Sigma^{-1}_{i,l}}{MD}}_{\text{Correlation Component}_i} \end{align} My logic is that if I split up all terms into those that:

1. Contain return data just from asset $$i$$ ($$r_i^2$$)
2. Contain return data from both assets $$i$$ and $$j\neq i$$ ($$r_ir_j$$)

Then I will have split up this marginal contribution into terms that pertain to volatility (1) and correlation (2). However, I've read a bit about how the inverse covariance matrix (precision matrix) and learned that each element contains data regarding volatilities and correlation, which makes me think that my attempt isn't valid.

Can anybody shed some light on whether my logic is indeed off, and perhaps how to go about accomplishing my goal?

• Just added some bullets to the top to explain the symbols. Let me know if you need additional context/details. – Ringleader May 19 at 13:55
• In order to split this in a ‚marginal contribution‘ kind of way wrt to any parameter, you need a function that is homogeneous (degree = 1 if you want to apply your formula) in that parameter. What you could try is to see how the MD‘s vola and mu estimates react to your r values; after all they are only estimates, no? – Kermittfrog May 19 at 16:42
• The covariance matrix is empirically derived from the asset returns, and it isn't necessarily the sensitivity to the vol/mu that I'm caring about. At a high level, I understand MD to be a measure of abnormality in terms of the realized volatilities of each asset and the realized correlations between all assets. I want to be able to explain how volatility and correlation are each contributing to MD. – Ringleader May 19 at 17:14
• You could disentangle correlation and volatility by rewriting $\Sigma=SRS$ with $S$ the diagonal matrix of volatilities and $R$ the correlation matrix. This way you can easily calculate both derivatives (wrt to $S$ and $R$) see matrix cookbook ,but I still do not think that the MD is a homogeneous function in those parameters; but I could be wrong in that assumption. – Kermittfrog May 19 at 19:52
• @Kermittfrog I like that idea, and appreciate the link! I'll look into it and update if I make progress. – Ringleader May 19 at 20:11