Basic BootstrapODPSample#
import chainladder as cl
This example demonstrates how you can can use the Overdispersed Poisson Bootstrap sampler and get various properties about parameter uncertainty.
import chainladder as cl
# Grab a Triangle
tri = cl.load_sample('genins')
# Generate bootstrap samples
sims = cl.BootstrapODPSample(random_state=42).fit_transform(tri)
# Calculate LDF for each simulation
sim_ldf = cl.Development().fit(sims).ldf_
plot1 = tri.T / 1e6
plot2 = (sims.sum() / 1000).T / 1e6
plot3a = sim_ldf.T
plot3b = cl.Development().fit(tri).ldf_.drop_duplicates().T
plot4 = sim_ldf.T.loc['12-24']
/home/docs/checkouts/readthedocs.org/user_builds/chainladder-python/envs/experimental/lib/python3.11/site-packages/chainladder/adjustments/bootstrap.py:284: UserWarning: 'where' used without 'out', expect unitialized memory in output. If this is intentional, use out=None.
hat = xp.diagonal(xp.sqrt(xp.divide(1, abs(1 - hat), where=(1 - hat) != 0)))