Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.1%) to scientific vocabulary
Repository
An R Package for loss reserving in general insurance
Basic Info
- Host: GitHub
- Owner: AshesITR
- Language: R
- Default Branch: master
- Homepage: https://ashesitr.github.io/reservr/
- Size: 179 MB
Statistics
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 3
Metadata Files
README.md
reservr
The goal of reservr is to provide a flexible interface for specifying distributions and fitting them to (randomly)
truncated and possibly interval-censored data.
It provides custom fitting algorithms to fit distributions to i.i.d. samples as well as dynnamic TensorFlow
integration to allow training neural networks with arbitrary output distributions.
The latter can be used to include explanatory variables in the distributional fits.
Reservr also provides some tools relevant for working with its core functionality in an actuarial setting, namely the
functions prob_report() and truncate_claims(), both of which make assumptions on the type of random truncation
applied to the data.
Please refer to the vignettes distributions.Rmd and tensorflow.Rmd for detailed introductions.
Installation
reservr is not yet on CRAN.
You can install the latest development version of reservr via
r
devtools::install_github("AshesITR/reservr")
You can install the released version of reservr from CRAN with:
r
install.packages("reservr")
If you want to use all of reservrs features, make sure to also install tensorflow.
Example
This is a basic example which shows how to fit a normal distribution to randomly truncated and censored data.
``` r library(reservr) set.seed(123) mu <- 0 sigma <- 1 N <- 1000 p_cens <- 0.8
x <- rnorm(N, mean = mu, sd = sigma) iscensored <- rbinom(N, size = 1L, prob = pcens) == 1L xlower <- x xlower[iscensored] <- x[iscensored] - runif(sum(iscensored), min = 0, max = 0.5) xupper <- x xupper[iscensored] <- x[iscensored] + runif(sum(iscensored), min = 0, max = 0.5)
tlower <- runif(N, min = -2, max = 0) tupper <- runif(N, min = 0, max = 2)
isobserved <- tlower <= x & x <= t_upper
obs <- truncobs( xmin = pmax(xlower, tlower)[isobserved], xmax = pmin(xupper, tupper)[isobserved], tmin = tlower[isobserved], tmax = tupper[is_observed] )
Summary of the simulation
cat(sprintf( "simulated samples: %d\nobserved samples: %d\ncensored samples: %d\n", N, nrow(obs), sum(is.na(obs$x)) ))
Define outcome distribution and perform fit to truncated and (partially) censored sample
dist <- distnormal() thefit <- fit(dist, obs)
Visualize resulting parameters and show a kernel density estimate of the samples.
We replace interval-censored samples with their midpoint for the kernel density estimate.
plotdistributions( true = dist, fitted = dist, empirical = distempirical(0.5 * (obs$xmin + obs$xmax)), .x = seq(-5, 5, length.out = 201), plots = "density", withparams = list( true = list(mean = mu, sd = sigma), fitted = thefit$params ) ) ```
Code of Conduct
Please note that the reservr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Owner
- Login: AshesITR
- Kind: user
- Repositories: 3
- Profile: https://github.com/AshesITR
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Alexander Rosenstock | a****k@w****e | 183 |
| AxelBuecher | 5****r | 5 |
| Alexander Rosenstock | A****k@w****e | 2 |
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 10
- Total pull requests: 4
- Average time to close issues: 4 months
- Average time to close pull requests: 3 days
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: 10 days
- Average time to close pull requests: less than a minute
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- AshesITR (10)
Pull Request Authors
- AshesITR (4)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 591 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
cran.r-project.org: reservr
Fit Distributions and Neural Networks to Censored and Truncated Data
- Homepage: https://ashesitr.github.io/reservr/
- Documentation: http://cran.r-project.org/web/packages/reservr/reservr.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL]
-
Latest release: 0.0.3
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- JamesIves/github-pages-deploy-action 4.1.4 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- R >= 3.5 depends
- R6 >= 2.4.1 imports
- Rcpp * imports
- RcppParallel * imports
- assertthat >= 0.2.1 imports
- generics * imports
- glue >= 1.3.1 imports
- keras >= 2.2.5.0 imports
- matrixStats * imports
- nloptr * imports
- numDeriv * imports
- purrr >= 0.3.3 imports
- rlang >= 0.4.5 imports
- stats * imports
- utils * imports
- callr * suggests
- colorspace * suggests
- covr * suggests
- data.table * suggests
- dplyr >= 0.8.4 suggests
- evmix * suggests
- fitdistrplus >= 1.0.14 suggests
- flextable >= 0.5.8 suggests
- formattable >= 0.2.0.1 suggests
- furrr >= 0.1.0 suggests
- ggplot2 >= 3.2.1 suggests
- ggridges >= 0.5.2 suggests
- knitr >= 1.28 suggests
- logKDE >= 0.3.2 suggests
- officer >= 0.3.7 suggests
- patchwork >= 1.0.0 suggests
- reticulate * suggests
- rmarkdown >= 2.1 suggests
- rstudioapi * suggests
- tensorflow >= 2.0.0 suggests
- testthat >= 2.1.0 suggests
- tibble * suggests
- tidyr >= 1.0.2 suggests