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 (16.1%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
Create actuarial experience studies
Basic Info
- Host: GitHub
- Owner: mattheaphy
- License: other
- Language: R
- Default Branch: main
- Homepage: https://mattheaphy.github.io/actxps/
- Size: 20.1 MB
Statistics
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 1
- Releases: 10
Created about 4 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
editor_options:
chunk_output_type: inline
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
actxps:::set_actxps_plot_theme()
```
# actxps
[](https://github.com/mattheaphy/actxps/actions/workflows/R-CMD-check.yaml)
The actxps package provides a set of tools to assist with the creation of
actuarial experience studies. Experience studies are used by actuaries to
explore historical experience across blocks of business and to inform assumption
setting for projection models.
- The `expose()` family of functions convert census-level records into policy
or calendar year exposure records.
- The `exp_stats()` function creates experience summary data frames containing
observed termination rates and claims. Optionally, expected termination rates,
actual-to-expected ratios, and limited fluctuation credibility estimates can
also be returned.
- The `add_transactions()` function attaches summarized transactions to a
data frame with exposure-level records.
- The `trx_stats()` function creates transaction summary data frames containing
transaction counts, amounts, frequencies, and utilization. Optionally,
transaction amounts can be expressed as a percentage of one or more variables to
calculate rates or actual-to-expected ratios.
- The `autoplot()` and `autotable()` functions creates plots and tables for
reporting.
- The `exp_shiny()` function launches a Shiny app that allows for interactive
exploration of experience drivers.
## Installation
The actxps package can be installed from CRAN with:
``` r
install.packages("actxps")
```
To install the development version from [GitHub](https://github.com/) use:
``` r
devtools::install_github("mattheaphy/actxps")
```
## Basic usage
An expanded version of this demo is available in `vignette("actxps")`.
The actxps package includes simulated census data for a theoretical
deferred annuity product with an optional guaranteed income rider.
The grain of this data is one row *per policy*.
```{r packages, message=FALSE}
library(actxps)
library(dplyr)
census_dat
```
Convert census records to exposure records with one row *per policy per year*.
```{r example}
exposed_data <- expose(census_dat, end_date = "2019-12-31",
target_status = "Surrender")
exposed_data
```
Create a summary grouped by policy year and the presence of a guaranteed
income rider.
```{r stats-grouped}
exp_res <- exposed_data |>
group_by(pol_yr, inc_guar) |>
exp_stats()
exp_res
```
Calculate actual-to-expected ratios.
First, attach one or more columns of expected termination rates to the exposure
data. Then, pass these column names to the `expected` argument of `exp_stats()`.
```{r stats-ae}
expected_table <- c(seq(0.005, 0.03, length.out = 10), 0.2, 0.15, rep(0.05, 3))
# using 2 different expected termination rates
exposed_data <- exposed_data |>
mutate(expected_1 = expected_table[pol_yr],
expected_2 = ifelse(exposed_data$inc_guar, 0.015, 0.03))
exp_res <- exposed_data |>
group_by(pol_yr, inc_guar) |>
exp_stats(expected = c("expected_1", "expected_2"))
exp_res
```
Create visualizations using the `autoplot()` and `autotable()` functions.
```{r plots, warning=FALSE, message=FALSE, dpi = 300}
autoplot(exp_res)
```
```{r table1, eval = FALSE}
# first 10 rows showed for brevity
exp_res |> head(10) |> autotable()
```
```{r table2, echo = FALSE, include=FALSE}
exp_res |> head(10) |> autotable() |> gt::gtsave("man/figures/exp_gt.png")
```

Launch a Shiny app to interactively explore experience data.
```{r shiny, eval = FALSE}
exp_shiny(exposed_data)
```
**Logo**
Image by macrovector on Freepik
Owner
- Name: Matt Heaphy
- Login: mattheaphy
- Kind: user
- Twitter: entreaphy
- Repositories: 2
- Profile: https://github.com/mattheaphy
Uncertainty enthusiast and actuary. (he/him)
GitHub Events
Total
- Release event: 1
- Watch event: 5
- Delete event: 2
- Push event: 20
- Pull request event: 4
- Create event: 4
Last Year
- Release event: 1
- Watch event: 5
- Delete event: 2
- Push event: 20
- Pull request event: 4
- Create event: 4
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 284
- Total Committers: 2
- Avg Commits per committer: 142.0
- Development Distribution Score (DDS): 0.004
Top Committers
| Name | Commits | |
|---|---|---|
| Matt Heaphy | m****y@g****m | 283 |
| Matt Heaphy | 3****y@u****m | 1 |
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 15
- Total pull requests: 35
- Average time to close issues: 2 months
- Average time to close pull requests: about 7 hours
- Total issue authors: 3
- Total pull request authors: 2
- Average comments per issue: 1.13
- Average comments per pull request: 0.0
- Merged pull requests: 35
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: about 2 hours
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- MatthewCaseres (9)
- mattheaphy (4)
- YasminAnuar (2)
Pull Request Authors
- mattheaphy (37)
- EmilHvitfeldt (1)
Top Labels
Issue Labels
Pull Request Labels
enhancement (2)
documentation (1)
Packages
- Total packages: 1
-
Total downloads:
- cran 484 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 10
- Total maintainers: 1
cran.r-project.org: actxps
Create Actuarial Experience Studies: Prepare Data, Summarize Results, and Create Reports
- Homepage: https://github.com/mattheaphy/actxps/
- Documentation: http://cran.r-project.org/web/packages/actxps/actxps.pdf
- License: MIT + file LICENSE
-
Latest release: 1.6.0
published over 1 year ago
Rankings
Stargazers count: 18.7%
Forks count: 21.9%
Average: 26.9%
Downloads: 28.6%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 4.1 depends
- RColorBrewer * imports
- dplyr * imports
- generics * imports
- ggplot2 * imports
- glue * imports
- gt * imports
- lubridate * imports
- paletteer * imports
- purrr * imports
- recipes * imports
- rlang * imports
- scales * imports
- tibble * imports
- testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml
actions
- 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
.github/workflows/pkgdown.yaml
actions
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite