## pricing.CollectiveModel


The collective risk model: a claim count and a severity, with layer


Usage


``` python
pricing.CollectiveModel()
```


moments in closed form.

For the layer [limit](reinsurance.Layer.md#prospicio.reinsurance.Layer.limit) xs [attachment](reinsurance.Layer.md#prospicio.reinsurance.Layer.attachment) applied to each loss, with `Y` the loss to the layer from one claim, the aggregate has mean `E[N] E[Y]` and variance `E[N] Var[Y] + Var[N] E[Y]**2`.


## Parameters


`frequency: (Poisson, NegativeBinomial or Binomial)`  

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


## Examples

``` python
>>> from prospicio.distributions import Pareto, claim_count
>>> from prospicio.pricing import CollectiveModel
>>> m = CollectiveModel(claim_count(2.0, 1.5), Pareto(1e6, 2.0))
>>> round(m.layer_mean(4e6, 1e6))
```

1600000

``` python
>>> m.excess_frequency(2e6)
```

0.5


## Methods

| Name | Description |
|----|----|
| [excess_frequency()](#excess_frequency) | Expected number of losses above [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x). |
| [layer_mean()](#layer_mean) | Expected aggregate loss to the layer [limit](reinsurance.Layer.md#prospicio.reinsurance.Layer.limit) xs [attachment](reinsurance.Layer.md#prospicio.reinsurance.Layer.attachment). |
| [layer_std()](#layer_std) | Standard deviation of the aggregate loss to the layer. |
| [layer_variance()](#layer_variance) | Variance of the aggregate loss to the layer. |
| [mean()](#mean) | Expected aggregate loss. |
| [simulate()](#simulate) | [n_sims](aggregate.EventSet.md#prospicio.aggregate.EventSet.n_sims) simulated years of individual losses. |
| [variance()](#variance) | Variance of the aggregate loss. |

------------------------------------------------------------------------


#### excess_frequency()


Expected number of losses above [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x).


Usage


``` python
excess_frequency(x)
```


##### Parameters


`x: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### layer_mean()


Expected aggregate loss to the layer [limit](reinsurance.Layer.md#prospicio.reinsurance.Layer.limit) xs [attachment](reinsurance.Layer.md#prospicio.reinsurance.Layer.attachment).


Usage


``` python
layer_mean(limit, attachment)
```


##### Parameters


`limit: float`  
`inf` for an unlimited layer.

`attachment: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### layer_std()


Standard deviation of the aggregate loss to the layer.


Usage


``` python
layer_std(limit, attachment)
```


##### Parameters


`limit: float`  

`attachment: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### layer_variance()


Variance of the aggregate loss to the layer.


Usage


``` python
layer_variance(limit, attachment)
```


##### Parameters


`limit: float`  

`attachment: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### mean()


Expected aggregate loss.


Usage


``` python
mean()
```


##### Returns


`float`  


------------------------------------------------------------------------


#### simulate()


[n_sims](aggregate.EventSet.md#prospicio.aggregate.EventSet.n_sims) simulated years of individual losses.


Usage


``` python
simulate(n_sims, seed)
```


##### Parameters


`n_sims: int`  

`seed: int`  


##### Returns


`EventSet`  


------------------------------------------------------------------------


#### variance()


Variance of the aggregate loss.


Usage


``` python
variance()
```


##### Returns


`float`
