1
$\begingroup$

I'm actually trying to implement Mark Kritzman's absorption ratio (Principal Components as a Measure of Systemic Risk by Kritzmam, Li, Page and Rigobon, 2010, SSRN 1633027) using Python, but I'm not sure whether or not I'm proceding correctly.

Does anybody has a python code to share ? That would be really helpful.

My code is as follows :

def absorption_ratio(assets):  
    # Create an empty list in order to store the absorption ratio :   
    AR = []  
    # Compute the correlation matrix of the asset returns :   
    corr = assets.corr()  
    # Compute the eigenvectors of the correlation matrix :   
    evec = la.eig(corr)[1]  
    # Compute the variance of the eigenvectors :   
    evec_variance = evec.var(1)  
    # Store the lenght of the variance of the eigenvectors :   
    n = len(evec_variance)  
    # Compute the variance of the asset returns :   
    assets_variance = assets.var(1)  
    # Store the lenghts of the asset returns :   
    N = len(assets_variance)  
    # Loop over the lenghts of the assets and eigenvectors variance, and store the values in the absorption ratio list:   
    for i, j in zip(range(n), range(N)):  
        AR.append(np.sum(evec_variance[i]/np.sum(assets_variance[j])))  
    return AR  
$\endgroup$
2
$\begingroup$

You can find a python implementation here https://github.com/tzhangwps/Turbulence-Suite

The author refers to the absorption ratio as "systemic risk indicator" but the calculation is the same.

$\endgroup$
-2
$\begingroup$

I don't know the R-code; but I can maybe cut through a lot of the academic bull=plop in the paper referenced.

A decade ago, I used to work on the sell-side, and used to produce a "Correlation of Everything to Everything Else" series (of cross-asset-class correlations) that was a pretty good proxy for PCA-domination and risk-on, risk-off mono-risk as was. This was followed up by a "what should how much?" and "what's moved more than it "should" have?" market analysis, explicitly based on PCA of 50+ liquid financial markets.

Put very bluntly, I have paid off the majority of my mortgage broking eigenvectors and eingenvalues to investors, translated from Quant into English. So I flatter myself to think I know it when others appear to be playing the same game :-)

I suspect if you take the same sample of markets as him, and use the same horizons to compute a correlation matrix, then the eigenvalue of PC1 should be the same as the oh-so-mythical "absorption ratio". And if it isn't, that then opens up a whole bevy of questions about the suitability of his different measure as a broad measure of the risk of "inter-connected markets" ;-)

If it is, then that then raises a different set of problems. For any sample of returns you look at, the relative power of the relevant PC drivers can not only rise or fall in importance, but switch in order of importance. PC1 can become PC2 and vice versa every other day. The "absorption ratio" doesn't change. It looks stable... but Monday is risk-on, risk-off; Tuesday is liquidity-on;liquidity-off; Wednesday is 50:50 RORO or LOLO; Thursday is either, might be the same as any other day. And so on, and so on. "Risk" levels haven't changed; but the whole nature of what is "risky" versus "defensive" can flip from day to day? How does that work???

Additional disclosure here. In 2005-6 I built a cross-market risk appetite/aversion indicator. It got packaged up and sold in the usual way to clients (who didn't have any real clue what they were buying, whether it would or should work, or the fees involved across the financial supply chain). I'm not proud; but my indicator and the implementation we put on it actually worked while most similar products tanked. I claim no personal credit for that; it's just one of those lucky breaks I was able to exploit (while the creators of the duff products weren't instantily fired, given the excuse of the never-seen-before 2008 conditions). My biggest problem being the champion of one of the few things up >20% in 2008 was managing the fact that I knew the world had changed. The product had (luckily) worked; but the nature of risk had changed. And I couldn't re-design from scratch to a new definition of what "risk" looked like post-earthquake ;-( Needless, the product floundered (non-disastrously) for years following its glory in the moment of terror. A bit like Winston Churchill, I suppose ;-)

The point here is that there are bona-fides reasons for inter-market correlations to sky-rocket after a financial crisis. These will drive the "absorption ratio" higher by default, but without the same level of true "stress" implied by tbe historical precedents. In its simplest form, 2008 was a deflationary credit crunch. In a market where stocks are bonds are worried about growth weakness, correlations will be strongly negative. In a market where they are worried instead about inflationary upside, returns will be positively correlated. Many of the same arguments apply to any of credit, commodities, gold as well as stocks or bonds versus any of the others. The arguments are always strongest in the deflationary crunch vs any inflationary or boom conditions.

So "the absorption ratio" will always be biased to rise more AFTER a 2008, whatever then transpires... As "early warning indicators" go, this one strikes me as a perfect excercise in "fighting the last war". Albeit the incentives here are authoring academic papers on "relevant" research, rather than creating bad product that can/will actually hurt people, as seen in the derivatives game. It's maybe intellectually toxic; rather than investor-toxic.

But, bottom line, I'm very sceptical. And more than happy to advise further on your attempts to have a go, whether I'm right or very very wrong. If the latter, I promise I will mea culpa promptly and properly.

my very best wishes here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.