## aggregate.Clash


Two lines hit by the same events, each line independently within an


Usage


``` python
aggregate.Clash()
```


event: [aggregate](aggregate.Clash.md#prospicio.aggregate.Clash.aggregate)'s `clash`.

Given the expected events a year hitting line A only, line B only and both (the clash count), independence within an event fixes those hitting neither, `only_a * only_b / both`. Each event hits A with probability [trigger_a](aggregate.Clash.md#prospicio.aggregate.Clash.trigger_a) and B with [trigger_b](aggregate.Clash.md#prospicio.aggregate.Clash.trigger_b); the dependence between the lines comes only from the shared count.


## Parameters


`only_a: float`  
Expected events a year hitting one line only, non-negative.

`only_b: float`  
Expected events a year hitting one line only, non-negative.

`both: float`  
Expected events a year hitting both lines, positive.


## Examples

``` python
>>> from prospicio.aggregate import Clash
>>> from prospicio.distributions import Grid, Poisson
>>> clash = Clash(2.0, 3.0, 1.0)
>>> clash.events, clash.trigger_a
```

(12.0, 0.25)

``` python
>>> a = Grid(1.0, [0.0, 0.5, 0.5])
>>> b = Grid(1.0, [0.0, 1.0])
>>> joint, report = clash.aggregate(Poisson(clash.events), a, b, (128, 128))
>>> round(joint.covariance(), 9)  # Poisson: both * E[X] * E[Y]
```

1.5


## Attributes

| Name | Description |
|----|----|
| [both](#both) | Expected events a year hitting both lines: the clash count. |
| [events](#events) | Expected events a year: the mean of the shared count. |
| [neither](#neither) | Expected events a year hitting neither line. |
| [only_a](#only_a) | Expected events a year hitting line A only. |
| [only_b](#only_b) | Expected events a year hitting line B only. |
| [trigger_a](#trigger_a) | The probability that an event hits line A. |
| [trigger_b](#trigger_b) | The probability that an event hits line B. |

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


#### both


Expected events a year hitting both lines: the clash count.


`both: float`


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


#### events


Expected events a year: the mean of the shared count.


`events: float`


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


#### neither


Expected events a year hitting neither line.


`neither: float`


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


#### only_a


Expected events a year hitting line A only.


`only_a: float`


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


#### only_b


Expected events a year hitting line B only.


`only_b: float`


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


#### trigger_a


The probability that an event hits line A.


`trigger_a: float`


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


#### trigger_b


The probability that an event hits line B.


`trigger_b: float`


## Methods

| Name | Description |
|----|----|
| [aggregate()](#aggregate) | The joint annual loss to the two lines by [fft_bivariate](aggregate.fft_bivariate.md#prospicio.aggregate.fft_bivariate). |
| [severity()](#severity) | The joint per-event severity: [a](distributions.Beta.md#prospicio.distributions.Beta.a) with probability [trigger_a](aggregate.Clash.md#prospicio.aggregate.Clash.trigger_a) |

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


#### aggregate()


The joint annual loss to the two lines by [fft_bivariate](aggregate.fft_bivariate.md#prospicio.aggregate.fft_bivariate).


Usage


``` python
aggregate(frequency, a, b, points)
```


##### Parameters


`frequency: (Poisson, NegativeBinomial, Binomial or Count)`  
The shared count; its mean must be [events](aggregate.Clash.md#prospicio.aggregate.Clash.events).

`a: Grid`  
The loss to each line given that the event hits it.

`b: Grid`  
The loss to each line given that the event hits it.

`points: tuple of (int, int)`  


##### Returns


`tuple of (JointGrid, BivariateReport)`  


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


#### severity()


The joint per-event severity: [a](distributions.Beta.md#prospicio.distributions.Beta.a) with probability [trigger_a](aggregate.Clash.md#prospicio.aggregate.Clash.trigger_a)


Usage


``` python
severity(a, b)
```


on line A and [b](pricing.Mbbefd.md#prospicio.pricing.Mbbefd.b) with [trigger_b](aggregate.Clash.md#prospicio.aggregate.Clash.trigger_b) on line B, independently.


##### Parameters


`a: Grid`  
The loss to each line given that the event hits it.

`b: Grid`  
The loss to each line given that the event hits it.


##### Returns


`JointGrid`
