## aggregate.simulate_events()


Simulates [n_sims](aggregate.EventSet.md#prospicio.aggregate.EventSet.n_sims) years of claims: a count from [frequency](pricing.TowerModel.md#prospicio.pricing.TowerModel.frequency), then that


Usage


``` python
aggregate.simulate_events(
    frequency,
    severity,
    n_sims,
    seed,
)
```


many independent losses from [severity](pricing.TowerModel.md#prospicio.pricing.TowerModel.severity).


## Parameters


`frequency: (Poisson, NegativeBinomial or Binomial)`  

`severity: (Lognormal, Grid, Pareto, PiecewisePareto, LogAffinePareto or GeneralizedPareto)`  

`n_sims: int`  

`seed: int`  


## Returns


`EventSet`  


## Raises


`ValueError`  
If [n_sims](aggregate.EventSet.md#prospicio.aggregate.EventSet.n_sims) is 0.


## Examples

``` python
>>> from prospicio.aggregate import simulate_events
>>> from prospicio.distributions import Lognormal, Poisson
>>> events = simulate_events(Poisson(5.0), Lognormal.from_mean_cv(1000.0, 1.0), 20_000, 42)
>>> abs(events.totals().mean() - 5000.0) < 75.0
```

True
