Skip to content

R Scripts

The application is written in R, using the Shiny package to construct the web interface and ggplot2 for graphical output.

The github repository includes 17 files described below.

source_functions.R – Loads required packages and requires R files

ui.R – Defines the application layout, user interface and various user inputs

server.R – Defines the back-end of the application, calls all other functions

load_population_data.R – Loads data files for plan participants, current beneficiaries, current survivors, actives and inactives. The data files are generated from the original Excel data using python scripts.

forecast_actives.R – Forecasts the number of beneficiaries, survivors and the average level of benefits from current actives and inactives.

forecast_beneficiaries.R – Forecasts the number of beneficiaries and average benefits for current beneficiaries.

forecast_survivors.R – Forecasts the number of survivor beneficiaries and average benefits for current survivors.

mortality.R – Contains functions for male and female mortality assumptions.

retire_rate.R – Contains retirement rate assumptions based on tier.

calculate_annuitant_liabilty.R – Calculates the nominal and PV liability by period.

amortizeUAAL.R – Calculates pension wealth and annual cash flows from amortizing the UAAL.

flowsPlot.R – Plots the nominal payments due by year, by participant type.

assetLiabilityPlot.R – Plots the Actuarial Liability.

amortPlot.R – Plots future pension wealth the amortization of the UAAL.

count_plot.R – Plots the count of plan participants over time.

valuation_details.R – Constructs a table with detailed description of our valuation.

legacy_code.R – Unused, contains legacy code that we wish to retain for various reasons.