pricing.fit_references()
A model that reproduces every reference: expected layer losses (which
Usage
pricing.fit_references(
layers=Ellipsis,
frequencies=Ellipsis,
default_alpha=2.0,
rule="minimize",
alpha_bounds=None
)may overlap or leave gaps) and excess frequencies.
Parameters
layers: list of tuple of float = Ellipsis-
(limit, attachment, expected_loss)per layer. frequencies: list of tuple of float = Ellipsis-
(threshold, frequency)per excess frequency. default_alpha: float = 2.0-
Alpha above the highest point, unless an unlimited layer sets it.
rule: (minimize, midpoint) = "minimize"alpha_bounds: tuple of (float, float) = None-
(lo, hi): keep the Pareto alpha between consecutive reference points within these bounds. The two pieces fitted inside a limited layer can still fall either side; check with TowerModel.diagnostics().
Returns
TowerModel
Raises
ValueError- Inconsistent references, or bounds that leave no tower meeting them.
Examples
>>> from prospicio.pricing import fit_references
>>> m = fit_references([(1000.0, 1000.0, 150.0), (3000.0, 1500.0, 160.0)], [(1000.0, 0.3)])
>>> round(m.layer_loss(3000.0, 1500.0), 6)160.0