Code Monkey home page Code Monkey logo

open-social-security's Introduction

OpenSocialSecurity

This project was generated with Angular CLI version 1.7.4.

What Does This Calculator Do?

Firstly, please know that everything is done in "real" (i.e., inflation-adjusted) dollars. So there is no need for the user to make manual inflation adjustments.

Let's consider the simplest example: an unmarried person, using the calculator prior to age 62.

For such a person, the calculator:

  1. First assumes they file ASAP at 62.
  2. Calculates the amount of their monthly retirement benefit under such assumption.
  3. For each year up to age 115, the calculator multiplies the annual retirement benefit by the user's probability of being alive in such year, to arrive at a probability-weighted annual benefit.
  4. That probability-weighted benefit is then discounted back to age-62 value using the discount rate the user provided as input (i.e., to account for the fact that a dollar today can be invested and is therefore worth more than even an inflation-adjusted dollar in the future).
  5. All of those probability-weighted, discounted benefit amounts are summed, to arrive at a total "present value" for the assumed claiming strategy (e.g., claiming ASAP at 62).
  6. The above process is repeated for each possible claiming age (i.e., every month between 62 and 70).
  7. The claiming age that had the highest present value is then suggested to the user, and the present value associated with such claiming age is provided as well.

If the person is older than 62 when using the calculator, claiming strategies that are no longer possible (i.e., filing in the past) are eliminated from the analysis.

For a married couple, it's the same sort of process, but with more going on. Specifically:

  1. In addition to retirement benefits, spousal benefits and survivor benefits are included in the analysis.
  2. Probability weighting the various benefits each period involves separate calculations for "probability only Spouse A is alive", "probability only Spouse B is alive", and "probability both spouses are still alive."
  3. Each combination of possible claiming ages must be considered, for both spouses, and for both types of benefits (i.e., retirement and spousal).

Flow of Information

When a user clicks the "submit" button, the "onsubmit" method from home.component.ts is triggered. This is the "parent" function in which the whole process happens.

First, we use the findSSbirthDate and findFRA functions from birthday.service.ts to find the user(s) Social Security birthdate, full retirement age, and full retirement age for the sake of survivor benefits.

Then, either maximizeSinglePersonPV, maximizeCouplePV, or maximizeDivorceePV functions are called from presentvalue.service.ts, depending on the user's marital status.

The "maximizePV" functions call either calculateSinglePersonPV or calculateCouplePV for each possible claiming age (or set of claiming ages) to find that claiming age's present value. In the process of doing this step, the various functions from benefit.service.ts are called in order to calculate applicable monthly benefit amounts.

Then the claiming age (or set of claiming ages) with the highest PV is returned to the user, as well as the corresponding PV.

open-social-security's People

Contributors

angular-cli avatar mikepiper avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.