Skip to main content

pricing.earned_exposure()

Written, earned, unearned and in-force amounts of a table of policies,

Usage

pricing.earned_exposure(
    effective,
    expiration,
    amount,
    windows,
    kind="calendar",
    method="daily",
    valuation=None,
    label=None,
    changes=None,
    cancellation=None
)

by window and label.

Each policy earns its amount (an exposure count, or a premium) evenly over its term, from its effective date up to, and not including, its expiration date. With kind="calendar" a window holds what was written and earned in it, and the unearned and in-force amounts at its end. With kind="policy" a window holds the policies written in it, with all they earn; give valuation to see them as of a date.

“At a window’s end” and “as of a valuation date” mean the close of the day before: a policy that expires on that date is still in force, and one effective on it is not yet written.

Parameters

effective: list of datetime.date or str

One entry a policy; strings are YYYY-MM-DD. The expiration is the first day the policy is not in force.

expiration: list of datetime.date or str

One entry a policy; strings are YYYY-MM-DD. The expiration is the first day the policy is not in force.

amount: list of float

The full-term amount of each policy.

windows: list of datetime.date or str

The dates the windows lie between, increasing; see calendar_windows.

kind: (calendar, policy) = "calendar"
method: (daily, half_month, twenty_fourths) = "daily"

Exact days; the half-month grid of the ratemaking exhibits; or the “15th of the month” rule, every policy date at mid-month.

valuation: datetime.date or str = None

See the table as of this date.

label: list of str = None

A label a policy; the table has a set of rows for each.

changes: list of (int, date, float) = None

Mid-term changes: the position of the policy (from 0), the date, and the full-term amount from that date.

cancellation: list of (date or None) = None
A cancellation date a policy, the first day not in force.

Returns

dict
Columns label, from, to (ISO dates), written, earned, unearned and in_force, one row a label and window.

Raises

ValueError
For columns of different lengths, a date that does not exist, an unknown kind or method, or a policy, change or cancellation that is not valid.

Examples

>>> from prospicio.pricing import calendar_windows, earned_exposure
>>> t = earned_exposure(["2010-10-01"], ["2011-10-01"], [1.0],
...                     calendar_windows(2010, 2011), method="half_month")
>>> t["written"], t["earned"]

([1.0, 0.0], [0.25, 0.75])