## aggregate.wiener_hopf()


The probability of eventual ruin when the waits between claims follow


Usage


``` python
aggregate.wiener_hopf(
    severity, wait, rho=None, *, loss_ratio=None, points=None
)
```


any law (a renewal, or Sparre Andersen, process), as [aggregate](aggregate.Clash.md#prospicio.aggregate.Clash.aggregate)'s [wiener_hopf](aggregate.wiener_hopf.md#prospicio.aggregate.wiener_hopf): claims of this severity, waits drawn from `wait`, and the premium at the rate `(1 + rho) E[X] / E[W]`. Ruin comes at a claim, so `psi(u)` is the chance that the walk with steps `X - cW` ever rises above [u](aggregate.Ruin.md#prospicio.aggregate.Ruin.u), found by the cepstral Wiener-Hopf factorization. Exponential waits give [eventual_ruin](aggregate.eventual_ruin.md#prospicio.aggregate.eventual_ruin).


## Parameters


`severity: Grid`  

`wait: distribution`  
The law of the wait between claims, with a finite mean.

`rho: float = None`  
The margin to loss, positive. Or give [loss_ratio](pricing.Price.md#prospicio.pricing.Price.loss_ratio).

`loss_ratio: float = None`  
`1 / (1 + rho)`, in (0, 1).

`points: int = None`  
Grid points for [psi](aggregate.Ruin.md#prospicio.aggregate.Ruin.psi), at least the severity's (the default). Raise it when [psi](aggregate.Ruin.md#prospicio.aggregate.Ruin.psi) at the last point is not small.


## Returns


`RenewalRuin`  


## Examples

``` python
>>> from prospicio.aggregate import eventual_ruin, wiener_hopf
>>> from prospicio.distributions import Gamma, Grid
>>> sev, _ = Grid.rounding(Gamma.from_mean_cv(10.0, 0.3), 1 / 32, 1 << 14)
>>> # Gamma waits (shape 2) are more regular than Poisson arrivals.
>>> wh = wiener_hopf(sev, Gamma(2.0, 1.0), rho=0.2)
>>> pk = eventual_ruin(sev, rho=0.2)
>>> wh.psi_at(50.0) < pk.psi_at(50.0)
```

True
