## aggregate.recommend_grid()


A grid for the compound distribution of [frequency](pricing.TowerModel.md#prospicio.pricing.TowerModel.frequency) claims of


Usage


``` python
aggregate.recommend_grid(
    frequency, severity, log2=16, p=Ellipsis, p_star=Ellipsis
)
```


[severity](aggregate.Clash.md#prospicio.aggregate.Clash.severity), as [aggregate](aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) sizes one when no bucket is given: the larger of a lognormal or gamma fitted to the aggregate's mean and variance at [p](models.Elpd.md#prospicio.models.Elpd.p), and one big claim on a typical bulk at [p](models.Elpd.md#prospicio.models.Elpd.p); then one big claim at `p_star` when it fits at the same bucket.


## Parameters


`frequency: a claim count`  

`severity: a severity`  
Any distribution but [Sampled](distributions.Sampled.md#prospicio.distributions.Sampled).

`log2: int = ``16`  
At most `2**log2` points.

`p: float = 1 - 1e-5`  

`p_star: float = 1 - 1e-12`  


## Returns


`GridSize`  


## Raises


`ValueError`  
If the aggregate mean is not finite and positive, or [log2](aggregate.GridAudit.md#prospicio.aggregate.GridAudit.log2) is not in `1..=30`.


## Examples

``` python
>>> from prospicio.aggregate import recommend_grid
>>> from prospicio.distributions import Gamma, Poisson
>>> g = recommend_grid(Poisson(10.0), Gamma.from_mean_cv(50.0, 0.7))
>>> g.step, g.points, g.method
```

(0.0625, 65536, 'moments')
