aggregate.Clash
Two lines hit by the same events, each line independently within an
Usage
aggregate.Clash()event: 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 and B with 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
>>> 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)
>>> 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 | Expected events a year hitting both lines: the clash count. |
| events | Expected events a year: the mean of the shared count. |
| neither | Expected events a year hitting neither line. |
| only_a | Expected events a year hitting line A only. |
| only_b | Expected events a year hitting line B only. |
| trigger_a | The probability that an event hits line A. |
| 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() | The joint annual loss to the two lines by fft_bivariate. |
| severity() | The joint per-event severity: a with probability trigger_a |
aggregate()
The joint annual loss to the two lines by fft_bivariate.
Usage
aggregate(frequency, a, b, points)Parameters
frequency: (Poisson, NegativeBinomial, Binomial or Count)-
The shared count; its mean must be 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()
Usage
severity(a, b)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