Skip to main content

aggregate.EventLossTable

A catastrophe model’s event loss table with secondary uncertainty.

Usage

aggregate.EventLossTable()

Each row is an event with an annual rate, a mean loss, independent and correlated standard deviations, and an exposure, the most it can lose. Events occur as independent Poisson processes; an event’s loss, given that it occurs, is a beta distribution on [0, exposure] with the row’s mean and standard deviation sd_independent + sd_correlated (summed, as catastrophe models report them for one portfolio), or the mean exactly when that is 0. A row whose standard deviation no beta on its exposure can have is an error naming the row.

Parameters

rate: list of float

One value per event, as the table’s columns.

mean: list of float

One value per event, as the table’s columns.

sd_independent: list of float

One value per event, as the table’s columns.

sd_correlated: list of float

One value per event, as the table’s columns.

exposure: list of float
One value per event, as the table’s columns.

Examples

>>> from prospicio.aggregate import EventLossTable
>>> elt = EventLossTable([0.01, 0.05], [800.0, 200.0], [200.0, 0.0], [100.0, 0.0], [2000.0, 500.0])
>>> round(elt.rate, 12), round(elt.expected_annual_loss, 12)

(0.06, 18.0)

>>> events, ids = elt.simulate(1000, seed=1)
>>> events.n_sims

1000

Attributes

Name Description
expected_annual_loss The expected annual loss, the sum of rate times mean.
rate The mean number of events a year, the rates’ sum.

expected_annual_loss

The expected annual loss, the sum of rate times mean.

expected_annual_loss: float


rate

The mean number of events a year, the rates’ sum.

rate: float

Methods

Name Description
aggregate_grid() The annual total loss on the grid 0, step, ..., (points - 1) *</td> </tr> <tr> <td><a href="#count" class="doc-function doc-label doc-label-method">count()</a></td> <td>The year's number of events, a Poisson count with meanrate.</td> </tr> <tr> <td><a href="#exceedance_frequency" class="doc-function doc-label doc-label-method">exceedance_frequency()</a></td> <td>The annual frequency of events losing more thanx.</td> </tr> <tr> <td><a href="#occurrence_pml" class="doc-function doc-label doc-label-method">occurrence_pml()</a></td> <td>The occurrence PML at annual probabilityp: the loss whose</td> </tr> <tr> <td><a href="#oep" class="doc-function doc-label doc-label-method">oep()</a></td> <td>The occurrence exceedance probability atx,</td> </tr> <tr> <td><a href="#severity_grid" class="doc-function doc-label doc-label-method">severity_grid()</a></td> <td>One event's loss on the grid0, step, …, (points - 1) * step``,
severity_moments() The first three raw moments of one event’s loss given that it
simulate() Simulated years of events, with each loss’s event (row index).

aggregate_grid()

The annual total loss on the grid ``0, step, …, (points - 1) *

Usage

aggregate_grid(step, points, bucketing="nearest")

step:count()compounded withseverity_gridbyfft``.

Parameters
step: float
points: int
bucketing: (nearest, means_linear) = "nearest"
Returns
tuple of (Grid, CompoundReport, dict)
The annual total, the compound report and the severity’s report.

count()

The year’s number of events, a Poisson count with mean rate.

Usage

count()
Returns
Poisson

exceedance_frequency()

The annual frequency of events losing more than x.

Usage

exceedance_frequency(x)
Parameters
x: float
Returns
float

occurrence_pml()

The occurrence PML at annual probability p: the loss whose

Usage

occurrence_pml(p)

occurrence exceedance probability is p.

Parameters
p: float
Returns
float

oep()

The occurrence exceedance probability at x,

Usage

oep(x)

1 - exp(-exceedance_frequency(x)).

Parameters
x: float
Returns
float

severity_grid()

One event’s loss on the grid 0, step, ..., (points - 1) * step,

Usage

severity_grid(step, points, bucketing="nearest")

the severity of the table’s compound Poisson model for fft and Tower.on_grid with count().

bucketing="nearest" is aggregate’s rule for a table with secondary uncertainty: each row’s loss law bucketed by the nearest node, an atom exactly on a bucket edge split evenly, and the mass above the top bucket’s edge on the top node. "means_linear" is its rule for a table of means alone: the secondary uncertainty is dropped and each mean split between its two neighbouring nodes so that the mean is kept.

Parameters
step: float
points: int
bucketing: (nearest, means_linear) = "nearest"
Returns
tuple of (Grid, dict)
The severity and a report: bucketing, rate_above (the annual rate of events above the grid, moved onto its top node), severity_mean and grid_mean.
Examples
>>> from prospicio.aggregate import EventLossTable, fft
>>> elt = EventLossTable([0.5, 0.25], [100.0, 300.0], [0.0, 0.0], [0.0, 0.0], [400.0, 400.0])
>>> sev, report = elt.severity_grid(100.0, 64)
>>> [round(p, 12) for p in sev.probs[:4]]

[0.0, 0.666666666667, 0.0, 0.333333333333]

>>> annual, _ = fft(elt.count(), sev, 64)
>>> round(annual.mean(), 9)

125.0


severity_moments()

The first three raw moments of one event’s loss given that it

Usage

severity_moments()

occurs, [E X, E X**2, E X**3]; the annual cumulants are rate times them.


simulate()

Simulated years of events, with each loss’s event (row index).

Usage

simulate(n_years, seed=0)

Year i draws from its own stream of the seed: a Poisson count, then for each event the row by its rate and its loss, so any year replays alone.

Parameters
n_years: int
seed: int = 0
Returns
tuple of (EventSet, list of list of int)