Coder Social home page Coder Social logo

cvavaluation's Introduction

Implementation of a CVA Valuation Incorporating Wrong Way Risk.

This implementation is built upon finmath-lib many thanks to cfries.

What is this project about?

This project implements a CVA valuation dropping the assumption of independence between default and payoff. Thus right way and wrong way risk can be introduced. Two approaches are implemented. First the intensity based approach and second a constrained worst case approach.

What is the folder structure?

The source code is located in src. The excel sheets located in ObbaExcelSheets access a .jar version of this source code and other necessary libraries located in the lib folder. They further use the Ice.jar and the Obba.jar located in the MA folder.

All code relevant for the implementation is located in the src.main.finmath.antonsporrer.masterthesis package. The class test.net.finmath.antonsporrer.masterthesis.montecarlo.cva.IntBasedCWCCVAforDifCor is used in the IntensityBasedCVAAndCWCCVAvsCorrelation.xlsx excel sheet. Apart from that the test.net.finmath.antonsporrer.masterthesis package just contains tests, unit tests, explorative analysis and general experiments.

How to to make the excel sheets work?

  1. Install Excel
  2. Install Obba for Excel
  3. Clone this repository
  4. Open the desired sheet

After the previous steps you can run the the excel files located in ObbaExcelSheets. The excel files contain a reference to the lib folder. The lib folder contains the necessary libraries including cva-excel.jar. cva-excel.jar contains the code located in the src folder.

How to use the excel sheets?

The color convention for the excel sheets is as follows. Green indicates a parameter which can be changed. Blue indicates an output. The excel sheets located in the ObbaExcelSheets folder allow for a CVA valuation of a bond and a swap. The sheets CVACouponBond, CVASwap output plots of simulation paths of the short rate, default intensity, net present value of the underlying and some additional quantities. Further they provide the intensity based CVA using an approach correlating the stochastic drivers and Lando's approach and they provide the constrained worst case CVA as well as the actual net present value of the product.

The IntensityBasedCVAAndCWCCVAvsCorrelation excel sheet provides an overview over the intensity based CVA and the constrained worst case CVA for both the bond and the swap. That is to say that the different quantities are compared and especially the effect of the correlation on the intensity based CVA is examined. To this end a plot of correlation vs. CVA value is provided.

Further remarks:

Not all functionality implemented in the Java code is used in the excel sheets for instance deterministic discounting. The sheets provide a first overview over the most important functionalities of the CVA implementation. The sheets can serve as a boilerplate to create sheets which employ further functionalities of this Java CVA implementation.

Disclaimer:

This code is not thoroughly tested and therefore the correctness of the results cannot be guaranteed.

cvavaluation's People

Contributors

asporrer avatar

Watchers

 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.