Skip to content

Marginal Expected Shortfall (MES)


marginal_expected_shortfall(firm_returns, market_returns, q=0.05)

Marginal Expected Shortfall (MES).

The firm's average return during the 5% worst days for the market.

MES measures how exposed a firm is to aggregate tail shocks and, interestingly, together with leverage, it has a significant explanatory power for which firms contribute to a potential crisis as noted by Acharya, Pedersen, Philippon, and Richardson (2010).

It is used to construct the Systemic Expected Shortfall.

  • firm_returns (np.ndarray) (n_days,) array of the returns (equity or CDS) for the firm.
  • market_returns (np.ndarray) (n_days,) array of the returns (equity or CDS) for the market as a whole.
  • q (float, optional) The percentile. Range is [0, 1]. Deaults to 0.05.
Returns (float)

The marginal expected shortfall of firm i at time t.

>>> from numpy.random import RandomState
>>> from frds.measures import marginal_expected_shortfall

Let's simulate some returns for the firm and the market

>>> rng = RandomState(0)
>>> firm_returns = rng.normal(0,1,100)
>>> mkt_returns = rng.normal(0,1,100)

Compute the MES.

>>> marginal_expected_shortfall(firm_returns, mkt_returns)


Source code | Bug report | Sponsor me

Last update: July 26, 2021
Back to top