Giter VIP home page Giter VIP logo

mbs-analytics's Introduction

mbs-analytics

Generate scenario/assumption-dependent cash flows and calculate price, yield, WAL, and other risk measures on MBS.

Technology:

Code is developed using standard C++ and STL libraries. The front-end CLI is developed in C# on .NET Core. All code should be largely cross-platform.

Quick Start:

  • docker build -t mbs-analytics .
  • docker run -t mbs-analytics

Testing:

  • There are C++ tests using the catch framework.
  • TODO: Integrate them into a GitHub actions workflow.

Features:

The cash flow engine is designed to support most of the common loan structural features and scenario specification parameters typically used in mortgage credit/prepayment analysis. While the API is extensible and allows customization of virtually any type of mortgage and (eventually) deal structure, the ultimate constraint is data availability, which would require a corresponding ETL layer that can acquire transaction information and loan-level input data.

To-Do List:

This is a work-in-progress, and many things have yet to be implemented. Basic amortization functionality has been implemented, but major work remaining includes a proper interface for parameterizing scenarios and loans, and full support of all market-standard cash flow functionality.

  • Create C# wrapper for DLL library + marshal a struct type storing cashflows returned from C++ layer
  • Add regression test for cash flow generation
  • Proper deal structure and cashflow aggregation within a group (multiple loans)
  • Calculate periodic + cumulative VPRs/CDRs during projection
  • Toggle for whether delinquency affects cash flows
  • Delinquency and advancing - confirm correct calculations and check behavior w/r/t lags
  • Distribute all recoveryPrincipal and realize all losses at maturity depending on extendLagsPastMaturity
  • Yield curve (CMT tenors + spot/par rates) for YM calculations
    • Basic yield maintenance calculations for FNMA YM type
    • Basic yield maintenance calculations for standard CMBS present value method
  • Use real first payment and maturity dates and derive loan age instead of an input
  • Proper payment date calculation logic
  • CSV output options
  • Other prepayment speeds (SMM, CPJ, CPB, CPY, CPP)
  • Other default speeds (MDR, PLD)
  • Separate term and balloon default assumptions (speed, lag, and severity)
  • Support forward rates, resets and recasts, and other features of ARM loans
  • Support true user inputs and scenario specification
  • Proper WAL calc which supports each accrual basis, settlement dates
  • Calculation of all risk measures, including price-to-yield and back and duration

mbs-analytics's People

Contributors

gandhis1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mbs-analytics's Issues

mkdir permissions issue: RUN make ./src/engine

Had an issue running the docker file, this was the error output:

Step 8/23 : RUN make
 ---> Running in 9187ffbbc916
mkdir -p obj
mkdir: cannot create directory 'obj': Permission denied
make: *** [../../Makefile.config:16: obj] Error 1
The command '/bin/sh -c make' returned a non-zero code: 2

I bypassed this by adding :

USER root

To line 8 of Dockerfile

Again, another permissions issue popped up:

Step 15/24 : RUN dotnet restore -r alpine-x64
 ---> Running in e5cefff48350
  Determining projects to restore...
/usr/share/dotnet/sdk/6.0.302/NuGet.targets(130,5): error : Access to the path '/home/nonroot/mbs-analytics/src/frontend/obj' is denied. [/home/nonroot/mbs-analytics/src/frontend/frontend.csproj]
/usr/share/dotnet/sdk/6.0.302/NuGet.targets(130,5): error :   Permission denied [/home/nonroot/mbs-analytics/src/frontend/frontend.csproj]
The command '/bin/sh -c dotnet restore -r alpine-x64' returned a non-zero code: 1

By adding

USER root

to line 16, it began to work again.

This resulted in a successful docker build.

!!! Can you add a walkthrough of how to use this program in the read me? upon running the program immediately outputs a bunch of features and exits. I am not sure how to interpret this

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.