## risk.marginal_expected_shortfall()


Marginal expected shortfall of each component at level [p](models.Elpd.md#prospicio.models.Elpd.p): its mean


Usage


``` python
risk.marginal_expected_shortfall(
    pd,
    p,
)
```


over the simulations where the total is in its worst `1 - p`.

The same as `allocate(pd, Distortion.tvar(p))`; it sums to the total's TVaR.


## Parameters


`pd: PredictiveDistribution`  

`p: float`  


## Returns


`list of float`  
One per component, in `pd.components()` order.


## Examples

``` python
>>> from prospicio.distributions import PredictiveDistribution
>>> from prospicio.risk import marginal_expected_shortfall
>>> pd = PredictiveDistribution(["lob"], [("motor",), ("property",)],
...                             [[1.0, 2.0], [4.0, 1.0], [2.0, 5.0], [3.0, 6.0]])
>>> marginal_expected_shortfall(pd, 0.5)
```

\[2.5, 5.5\]
