DecL on one page

In Python: build('...') or an %%agg cell.

aggregate {{version}}
aggregate.readthedocs.io

1 · An aggregate

agg LABEL VOLUME COVERAGE SEVERITY FREQUENCY
agg Book                  # label
  250 claims              # volume
  1000 xs 0               # coverage
  sev lognorm 100 cv 1.5  # severity
  poisson                 # frequency

Clauses in this order, coverage optional.

2 · Exposure

volume
250 claimsexpected claim count
25000 lossexpected loss
40000 premium at 65% lrpremium times loss ratio
1000 exposure at 25 rateunits × rate
dfreq [1 2 3] [.5 .3 .2]listed counts and probabilities
coverage (optional)
1000 xs 0limit xs deductible, per claim
omitfor unlimited, from the ground up
[500 1000] xs [0 0]lists build a mixed book

3 · Severity

sev lognorm 100 cv 1.5family, mean, cv
sev 50 * lognorm 1.2scale times shape
sev 40 * lomax 2.5 + 40shifted
sev lognorm [80 400] cv [1 2] wts [.7 .3] a mixture
dsev [1 2 10] [.4 .4 .2]listed outcomes
picks [250 1000] [20000 4500]adjust expected loss by layer

Common families: lognorm, gamma, pareto, expon, lomax, or any scipy.stats continuous family.

4 · Frequency

poissonthe textbook choice
mixed gamma 0.3gamma mixing, cv 0.3
negbin 2variance twice the mean
fixedexactly the expected count
binomial 0.5success probability 0.5

5 · Reinsurance

agg Book.Net 250 claims 1000 xs 0
  sev lognorm 100 cv 1.5
  occurrence net of 250 xs 750
  poisson
  aggregate net of 5000 xs 30000
occurrenceeach claim, before frequency
aggregateafter frequency
net of, ceded toview output
250 xs 250 and 500 xs 500limit xs attachment, lowest first
50% po 500 xs 500partial placement
tower [0 250 500 1000]program breakpoints
as "Cat XL"label a layer

6 · Reinsurance terms

rol 5%rate on line
deposit 600premium as an amount
rate 100%share of subject premium
cede 30%ceding commission
reinstatements 1 at 100%or no reinstatements
swingslidepccorridorvariable terms, aggregate covers

Terms follow a layer's limit and flow into a P&L, as in 500 xs 500 rol 5% cede 30%.

7 · A portfolio

port Two.Books
  agg Book 250 claims 1000 xs 0
    sev lognorm 100 cv 1.5 poisson
  agg Casualty 20 claims 2000 xs 0
    sev lognorm 250 cv 2 mixed gamma 0.4

Units are independent, share one grid, and sum to the total. A unit is any agg, with its own reinsurance, or a stored one such as agg.BasicBook. Pricing allocates by unit.

8 · A profit and loss

xpnl LABEL PREMIUM less ENGINE less EXPENSES
xpnl Book.PnL
  38000 premium  # or inherit or derive
  less agg Book 250 claims 1000 xs 0
    sev lognorm 100 cv 1.5
    occurrence net of 250 xs 250 deposit 3400
      and 500 xs 500 deposit 1600
    poisson
  less 25% premium expense as "G&A"
    1000 fixed expense as "Overhead"
  peel top-down  # or bottom-up
38000 premiumthe premium booked
inherit premiumthe engine's own premium
derive premiumgrossed up for expenses
agg.Labela stored engine
port.Labela stored portfolio, with pnl only
5% loss expenseother bases
500 fixed expenseoptionally joined with and
peel top-downone block per layer (or bottom-up)
pnlsame syntax, one consolidated block

The PnL button wraps last object built.

9 · Writing rules

  • A blank line, or ; at the end of a line, separates statements.
  • Line breaks and indentation are free. # comment
  • Labels start with a letter; dots group them: Book.Net.
  • 10_000 65% inf; arithmetic within parentheses, (3 * exp(4) / 2).
  • Lists [1 2 3][1:6][2:12:2].
  • Trailer, last: note{...}tags{...}hints{log2=16;}.

10 · The library, and more

  • agg.BasicBook, port.TwoLineBook reuse shipped objects; Ctrl+K searches them.
  • distortion D wang 0.3 a pricing risk measure.
  • bivariateclash two dependent lines.
  • grossnet agg ... gross and net as one joint view.
  • nttagg exact answers for small discrete books.
  • Everything else: the DecL reference.