Skip to contents

Distributions

distribution()
Abstract parent of every distribution class
lognormal()
Lognormal distribution
lognormal_from_mean_cv()
Lognormal distribution from its mean and coefficient of variation
grid_distribution()
Distribution on an evenly spaced grid
discretize()
Discretize a severity onto a grid
map_grid()
Transform a grid distribution
sampled()
Distribution of equally weighted draws
gamma_distribution() gamma_from_mean_cv() gamma_from_mean_dispersion()
Gamma distribution
tweedie() tweedie_from_poisson_gamma()
Tweedie distribution
weibull_distribution()
Weibull distribution
loglogistic_distribution()
Loglogistic distribution
mixture_distribution()
Mixture of severities
custom_distribution()
Custom severity from your own distribution function
dist_to_json() dist_from_json()
Save and load distributions as JSON
log_density()
Log density

Large-loss severities

pareto()
Single-parameter Pareto distribution
piecewise_pareto()
Piecewise Pareto distribution
log_affine_pareto()
Log-affine local Pareto distribution
generalized_pareto() generalized_pareto_riegel()
Generalized Pareto severity
pareto_fit() piecewise_pareto_fit() generalized_pareto_fit()
Maximum likelihood fits to large losses
local_pareto_to_piecewise()
Convert a local Pareto distribution to piecewise Pareto
survival() layer_variance()
Survival function and layer variance
local_alpha()
Local Pareto alpha

Claim counts

poisson_count()
Poisson claim counts
negative_binomial_count()
Negative binomial claim counts
negative_binomial_count_from_mean_variance()
Negative binomial from its mean and variance
binomial_count()
Binomial claim counts
claim_count()
Claim count by mean and dispersion
pmf()
Claim-count probability mass

Distribution functions

cdf()
Distribution function
variance()
Variance of a distribution
draws()
Reproducible random draws
lev() stop_loss() layer()
Limited expected value, stop-loss and layer
VaR() TVaR()
Value at risk and tail value at risk

Predictive distributions

predictive_distribution()
Joint predictive distribution
blend_predictive()
Blend predictive distributions
join_predictive() reorder_groups()
Join predictive distributions into a portfolio
marginal()
One component of a predictive distribution
total()
Total over all components
draw_matrix()
Draw matrix of a predictive distribution
provenance()
Where a result came from

Aggregate loss

compound_distribution()
Compound (aggregate) loss distribution
simulate_events()
Simulated years of losses
events_from_years()
Years of losses from elsewhere
event_sums_insured()
Sums insured of one year's losses
event_times()
Times of one year's losses
with_uniform_times()
Date events uniformly over the year
with_seasonal_times()
Date events by a season
event_set()
Simulated years of losses (class)
events()
One simulated year's losses
event_counts()
Number of losses in each simulated year

Reinsurance

xol_layer()
Excess-of-loss reinsurance layer
with_loss_corridor()
Loss corridor
quota_share()
Quota share
aggregate_stop_loss()
Aggregate stop-loss
surplus_treaty()
Surplus treaty
ceded()
Ceded loss for one year
ceded_by_event()
Ceded loss per event
reinstatement_premium()
Reinstatement premium for one year
reinsurance_tower()
Reinsurance tower
inuring_tower()
Reinsurance tower with inuring order
tower_to_json() tower_from_json()
Save and load reinsurance towers as JSON
tower_ceded()
Ceded loss of each layer in a tower for one year
apply_tower()
Apply a reinsurance tower to simulated years
tower_on_grid()
Reinsurance tower on the aggregate grid

Pricing

Risk measures

distortion()
Distortion risk measure
distortion_g() distortion_weights()
Distortion function and rank weights
risk_measure()
Distortion risk measure of a distribution
allocate()
Allocate a risk measure to components
capital_allocation()
Capital allocation and diversification
entropic_risk() esscher_premium()
Exponential-utility risk measures
marginal_expected_shortfall() esscher_allocation() covar()
Systemic risk contributions

Models

glm_fit()
Fit a generalized linear model
glm_model()
Fitted GLM (class)
robust_vcov()
Sandwich covariance of a GLM
bayes_glm_fit()
Fit a Bayesian GLM by NUTS
bayes_glm_model()
Sampled Bayesian GLM (class)
bayes_loo()
PSIS-LOO of a Bayesian GLM
save_model() load_model()
Save and load a model
elastic_net_fit()
Fit an elastic-net GLM
elastic_net_model()
Fitted elastic net (class)
elastic_net_cv()
Cross-validate an elastic net
gam_fit()
Fit a generalized additive model
gam_model()
Fitted GAM (class)
booster_fit()
Fit gradient-boosted trees
booster_model()
Fitted gradient-boosted trees (class)
simulate_from_means()
Predictive distribution from fitted means
predict_quantiles()
Quantile sets from several quantile boosters
predict_dispersion()
Dispersion per row of a boosted model
predict_distribution()
Joint predictive distribution of a fitted model
family_deviance() gini_index() lift_table() crps_draws() pinball_loss() log_score() pit_values() ks_uniform()
Model metrics
k_fold() group_k_fold() time_ordered()
Resampling splits
cross_validate() grid_search() random_search()
Cross-validation and hyperparameter search
compare_models()
Compare models on the same splits
actual_vs_expected()
Monitor a model: actual against expected by period
mcmc_diagnostics()
MCMC convergence diagnostics
elpd_loo() elpd_waic()
Expected log pointwise predictive density
stacking_weights() pseudo_bma_weights()
Model weights for blending: stacking and pseudo-BMA
bayes_stacking() hierarchical_stacking() pooling_scales()
Bayesian and hierarchical stacking
stacking_fit()
Posterior stacking weights (class)

Dependence

copula() gaussian_copula() t_copula() archimedean_copula()
Copulas
copula_sample()
Draw uniforms from a copula
copula_simulate()
Simulate marginals joined by a copula
iman_conover()
Reorder draws to a target correlation (Iman-Conover)

Extreme value tails

pot_tail()
Peaks-over-threshold tail
mean_excess() hill_estimator()
Tail diagnostics
gpd_fit()
Generalized Pareto fit

Reserving

triangle()
Loss triangle
subset.triangle
Select segments and columns of a triangle by name
aggregate.triangle
Sum a triangle over keys
triangle_views
View, summarise and print a triangle
to_incremental() to_cumulative()
Incremental and cumulative triangles
latest_diagonal()
Latest diagonal of a triangle
link_ratios()
Link ratios of a triangle
grain()
Change the grain of a triangle
chain_ladder_fit() chain_ladder()
Chain ladder
mack_fit() mack()
Mack chain ladder
claims_development_result()
Claims development result: the one-year view of a Mack fit
tail_constant()
Constant tail factor
tail_curve()
Curve-fitted tail
tail_bondy()
Bondy tail
tail_log_linear()
R ChainLadder's log-linear tail
expected_loss_fit() expected_loss() bornhuetter_ferguson() benktander()
Expected loss, Bornhuetter-Ferguson and Benktander
cape_cod_fit() cape_cod()
Cape Cod
odp_bootstrap_fit() odp_bootstrap()
ODP bootstrap
mack_bootstrap_fit() mack_bootstrap()
Bootstrap of Mack's model
one_year_fit() odp_one_year() mack_one_year()
Simulated one-year view
clark_fit() clark_ldf() clark_cape_cod() growth()
Clark's growth-curve methods
totals_frame() development_frame() segment()
Long results of a fit over every segment