Package: reservr 0.0.3

Alexander Rosenstock

reservr: Fit Distributions and Neural Networks to Censored and Truncated Data

Define distribution families and fit them to interval-censored and interval-truncated data, where the truncation bounds may depend on the individual observation. The defined distributions feature density, probability, sampling and fitting methods as well as efficient implementations of the log-density log f(x) and log-probability log P(x0 <= X <= x1) for use in 'TensorFlow' neural networks via the 'tensorflow' package. Allows training parametric neural networks on interval-censored and interval-truncated data with flexible parameterization. Applications include Claims Development in Non-Life Insurance, e.g. modelling reporting delay distributions from incomplete data, see Bücher, Rosenstock (2022) <doi:10.1007/s13385-022-00314-4>.

Authors:Alexander Rosenstock [aut, cre, cph]

reservr_0.0.3.tar.gz
reservr_0.0.3.tar.gz(r-4.5-noble)reservr_0.0.3.tar.gz(r-4.4-noble)
reservr_0.0.3.tgz(r-4.4-emscripten)reservr_0.0.3.tgz(r-4.3-emscripten)
reservr.pdf |reservr.html
reservr/json (API)
NEWS

# Install 'reservr' in R:
install.packages('reservr', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ashesitr/reservr/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library

3.18 score 9 scripts 629 downloads 68 exports 42 dependencies

Last updated 5 months agofrom:fa7ed11875. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKNov 22 2024
R-4.5-linux-x86_64OKNov 22 2024

Exports:as_paramsas_trunc_obsblended_transitionblended_transition_invcallback_adaptive_lrcallback_debug_dist_gradientsdgpddist_bdegpdist_betadist_binomialdist_blendeddist_diracdist_discretedist_empiricaldist_erlangmixdist_exponentialdist_gammadist_genparetodist_genpareto1dist_lognormaldist_mixturedist_negbinomialdist_normaldist_paretodist_poissondist_translatedist_truncdist_uniformdist_weibulldparetodsoftmaxfitfit_blendedfit_distfit_dist_directfit_dist_startfit_erlang_mixturefit_mixtureflatten_boundsflatten_paramsflatten_params_matrixinflate_paramsintegrate_gkintervalinterval_intersectioninterval_unionis.Distributionis.Intervalk_matrixpgpdplot_distributionspparetoprob_reportqgpdqparetorepdel_obsrgpdrparetosoftmaxtf_compile_modeltf_initialise_modeltrunc_obstruncate_claimstruncate_obsweighted_medianweighted_momentsweighted_quantileweighted_tabulate

Dependencies:assertthatbackportsbase64encBHcliconfigfastmapgenericsglueherejsonlitekeras3latticelifecyclemagrittrMatrixmatrixStatsnloptrnumDerivpngprocessxpspurrrR6rappdirsRcppRcppArmadilloRcppParallelRcppTOMLreticulaterlangrprojrootrstudioapitensorflowtfautographtfrunstidyselectvctrswhiskerwithryamlzeallot

Fitting Distributions and Neural Networks to Censored and Truncated Data: The R Package reservr

Rendered fromjss_paper.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2024-06-25
Started: 2024-06-25

TensorFlow Integration

Rendered fromtensorflow.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2024-06-25
Started: 2022-12-09

Working with Distributions

Rendered fromdistributions.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2022-12-09
Started: 2022-12-09

Readme and manuals

Help Manual

Help pageTopics
Convert TensorFlow tensors to distribution parameters recursivelyas_params
Transition functions for blended distributionsblended_transition blended_transition_inv
Keras Callback for adaptive learning rate with weight restorationcallback_adaptive_lr
Callback to monitor likelihood gradient componentscallback_debug_dist_gradients
Construct a BDEGP-Familydist_bdegp
Beta Distributiondist_beta
Binomial Distributiondist_binomial
Blended distributiondist_blended
Dirac (degenerate point) Distributiondist_dirac
Discrete Distributiondist_discrete
Empirical distributiondist_empirical
Erlang Mixture distributiondist_erlangmix
Exponential distributiondist_exponential
Gamma distributiondist_gamma
Generalized Pareto Distributiondist_genpareto dist_genpareto1
Log Normal distributiondist_lognormal
Mixture distributiondist_mixture
Negative binomial Distributiondist_negbinomial
Normal distributiondist_normal
Pareto Distributiondist_pareto
Poisson Distributiondist_poisson
Tranlsated distributiondist_translate
Truncated distributiondist_trunc
Uniform distributiondist_uniform
Weibull Distributiondist_weibull
Base class for DistributionsDistribution
Fit a Blended mixture using an ECME-Algorithmfit_blended
Fit a general distribution to observationsfit.Distribution fit_dist fit_dist_direct
Find starting values for distribution parametersfit_dist_start fit_dist_start.MixtureDistribution
Fit an Erlang mixture using an ECME-Algorithmfit_erlang_mixture
Fit a generic mixture using an ECME-Algorithmfit_mixture
Fit a neural network based distribution model to datafit.reservr_keras_model
Flatten / Inflate parameter lists / vectorsflatten_bounds flatten_params flatten_params_matrix inflate_params
The Generalized Pareto Distribution (GPD)dgpd GenPareto pgpd qgpd rgpd
Adaptive Gauss-Kronrod Quadrature for multiple limitsintegrate_gk
Intervalsinterval is.Interval
Convex union and intersection of intervalsinterval-operations interval_intersection interval_union
Test if object is a Distributionis.Distribution
Cast to a TensorFlow matrixk_matrix
The Pareto Distributiondpareto Pareto ppareto qpareto rpareto
Plot several distributionsplot_distributions
Predict individual distribution parameterspredict.reservr_keras_model
Determine probability of reporting under a Poisson arrival Processprob_report
Quantiles of Distributionsquantile.Distribution
Soft-Max functiondsoftmax softmax
Compile a Keras model for truncated data under disttf_compile_model
Initialise model weights to a global parameter fittf_initialise_model
Define a set of truncated observationsas_trunc_obs repdel_obs truncate_obs trunc_obs
Truncate claims data subject to reporting delaytruncate_claims
Compute weighted momentsweighted_moments
Compute weighted quantilesweighted_median weighted_quantile
Compute weighted tabulationsweighted_tabulate