pricing.price()

Risk-loaded price of a cover from its simulated losses.

Usage

pricing.price(
    losses,
    assets,
    *,
    cost_of_capital=None,
    distortion=None,
)

The assets backing the loss are a distortion risk measure of it. The premium is either a pricing distortion of the loss, or set by a constant cost of capital r on the capital a - P, which gives P = (E[X] + r a) / (1 + r).

Parameters

losses: Sampled or PredictiveDistribution

Loss draws; for a PredictiveDistribution, its total.

assets: Distortion

The measure that sets the assets, for example Distortion.tvar(0.99).

cost_of_capital: float = None

Positive rate. Give this or distortion.

distortion: Distortion = None
Pricing distortion; it must load less than assets.

Returns

Price

Raises

ValueError
Unless exactly one rule is given, or if the premium exceeds the assets.

Examples

>>> from prospicio.distributions import Sampled
>>> from prospicio.pricing import price
>>> from prospicio.risk import Distortion
>>> p = price(Sampled([0.0, 0.0, 2.0, 6.0]), Distortion.tvar(0.5), cost_of_capital=0.25)
>>> p.premium, p.capital

(2.4, 1.6)