## risk.equal_risk()


The equal risk allocation of an exogenous [total](risk.Allocation.md#prospicio.risk.Allocation.total): the one level at


Usage


``` python
risk.equal_risk(
    pd,
    total,
    measure,
)
```


which the components' stand-alone [measure](risk.Distortion.md#prospicio.risk.Distortion.measure)s add up to [total](risk.Allocation.md#prospicio.risk.Allocation.total), each getting its own (*Pricing Insurance Risk*, section 12.2.4). For VaR and TVaR this prices the components as if comonotonic; for EPD each has the same EPD ratio.

A VaR of draws moves in steps: where no level adds up exactly, the level is the lowest that reaches [total](risk.Allocation.md#prospicio.risk.Allocation.total) and its VaRs are scaled to it.


## Parameters


`pd: PredictiveDistribution`  

`total: float`  

`measure: str`  
`"var"`, `"tvar"` or `"epd"`.


## Returns


`LevelAllocation`  
With the [level](reserving.ApcGlmFit.md#prospicio.reserving.ApcGlmFit.level) found.


## Raises


`ValueError`  
When no level makes the stand-alone measures add up to [total](risk.Allocation.md#prospicio.risk.Allocation.total).


## Examples

``` python
>>> from prospicio.distributions import PredictiveDistribution
>>> from prospicio.risk import equal_risk
>>> pd = PredictiveDistribution(["lob"], [("motor",), ("property",)],
...                             [[1.0, 2.0], [4.0, 1.0], [2.0, 5.0], [3.0, 6.0]])
>>> round(equal_risk(pd, 9.0, "tvar").level, 9)
```

0.5
