Skip to content
/ lossrx Public

An R package, plumber API, database, and Shiny App for Actuarial Loss Development and Reserving Workflows.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

jimbrig/lossrx

lossrx

R-CMD-check Lifecycle:experimental Project Status:WIP

View the Changelog for detailed progression on development of the package.

View the GITHUB.md document for details on the various CI/CD workflows implemented with this repository on the R Package (~14 total workflows).

View the Latest Database Documentation for a detailed look into its structure.

Contents

Table of Contents

Overview

The desired outcome of the lossrx R package is to provide actuaries and data scientists valuable tools and frameworks for performing Property Casualty related workflows.

Specifically, the package will contain:

  • A suite of utility and workflow oriented functions bundled as an R package
  • A plumber API that serves various endpoints related to a backend database and models
  • A comprehensive, yet simple migration-friendly relational database representing the various entities, attributes, and relationships involved with actuarial reserving.1
  • A demo Shiny App for Actuarial Loss Development and Reserving including triangles, loss development factor selection, preliminary ultimates, etc. and a backend database/API to store results and selections.
  • Comprehensive documentation and tests

Installation

You can install the development version of lossrx with pak: 2

pak::pak("jimbrig/lossrx")

Data

Data Preparation

This package utilizes a lot of data and in turn has a lot of code inside the data-raw folder. I recommend taking a look at its README to gain an understanding of how the data was prepared for both use in the package as well as included and uploaded to the database.

Data is prepared in the following ways:

  • Simulated transactional claims data using the claims_transactional.R Simulation R Script
  • Downloaded and extracted using ropensci’s piggyback package - see the dataprep.R Script.
  • Supplemental mocked data generated using the Mockaroo API for randomizing certain data attribute’s.
  • Uploaded and merged into the relational database using SQL, R, CSVs, and YAML files (see below about database details).
  • Certain datasets are budled and included with the package as native .rda packaged data files.

Database

View Detailed Database Documentation created via dbdocs

The core database files are housed in the inst/database directory and are included on package installation.

Checks

Latest R CMD CHECK:

-- R CMD check results -------------------------------------- lossrx 0.0.2 ----
Duration: 1m 19.3s

0 errors v | 0 warnings v | 0 notes v

R CMD check succeeded

Jimmy Briggs | 2022

Footnotes

  1. See the database container package for details on how to run the database as a container image.

  2. Similarly, you can install the package using the more common devtools::install_github() and remotes::install_github()