Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ActPersp/LTValuation
Rgogo Sample Project: Level Term Valuation
https://github.com/ActPersp/LTValuation
Last synced: 8 days ago
JSON representation
Rgogo Sample Project: Level Term Valuation
- Host: GitHub
- URL: https://github.com/ActPersp/LTValuation
- Owner: ActPersp
- License: gpl-3.0
- Created: 2020-10-18T22:06:18.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-19T02:51:19.000Z (about 4 years ago)
- Last Synced: 2024-08-13T07:11:20.670Z (4 months ago)
- Language: R
- Size: 3.74 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - ActPersp/LTValuation - Rgogo Sample Project: Level Term Valuation (R)
README
# LTValuation
A sample valuation project for a block of level term insurance policies.## Objective
The objective of this project is to demonstrate how to create a valuation project and run valuation using policy premium method for a block of level term policies.
This block consists of 200 policies with 20-year level term insurance and 200 policies with level term to age 65 insurance.
## Prerequisite
You must install `Rgogo` package and Canadian mortality table package `MortTables.CA` before using this sample project. You can download these packages with the following commands if you have not done so:
```R
library(devtools)
install_github(repo = "ActPersp/Rgogo")
install_github(repo = "ActPersp/MortTables.CA")
```
It is also assumed that you are using RStudio for development environment.## Modifying Model
You can make changes to the model by modifying any R script files under "R" subfolers.
Each R script file under "R" subfolder represents a model component:
| File Name | Model Component |
| --- | --- |
| Plan.LT20.R | 20-year level term product features |
| Plan.LT65.R | Level term to age 65 product features |
| MortAssump.R | Mortality assumption |
| LapseAssump.R | Lapse assumption |
| IntrAssump.R | Interest rate assumption |
| ExpnsAssump.R | Expense assumption |
| Model.R| Model for policy premium method valuation |## Deploying Model
Every time you make any change to the above files, you must deploy the project by executing the following commands before running the model.
```R
Rgogo::DeployProject("LTValuation", overwrite = TRUE)
```## Running Model
Build package before running the model. To build the package, click RStudio menu items: **Build > Install and Restart**.
There are three scrip files under "batch" subfolder:
### Step_1_Import_Data.RThe scripts import seriatim policy data from an Excel file under "data-raw" subfolder, and save them to a valuation database.
You do not have to run this every time. The scripts will encounter error if the database file "db/LTValuation.db" already exists. If you want to re-create database, you need to manually delete the database file before running the scripts.
### Step_2_Run_Valuation.R
The scripts carry out valuation calculation and save seriatim reserves and cash flows to valuation database.
### Step_3_Summarize_Results.R
The scripts summarize reserves and cash flows, and export to an Excel file under "export" subfolder.