Giter Club home page Giter Club logo

imt2024's Introduction

Introduction to QuantLib - IMT 2024

Coding project: use constant parameters in Monte Carlo engines

In Monte Carlo engines, repeated calls to the process methods may cause a performance hit; especially when the process is an instance of the GeneralizedBlackScholesProcess class, whose methods in turn make expensive method calls to the contained term structures.

The performance of the engine can be increased at the expense of some accuracy. Create a new class that models a Black-Scholes process with constant parameters (underlying value, risk-free rate, dividend yield, and volatility); then modify the Monte Carlo engines copied in this repository so that they still take a generic Black-Scholes process and an additional boolean parameter. If the boolean is false, the engine runs as usual; if it is true, the engine extracts the constant parameters from the original process (based on the exercise date of the option; for instance, the constant risk-free rate should be the zero-rate of the full risk-free curve at the exercise date) and runs the Monte Carlo simulation with an instance of the constant process.

You should not modify the main.cpp file, only the engines and the new constant process.

After your modifications:

  1. Compare the results (value, elapsed time) obtained with and without constant parameters. The value with non-constant parameters should be the same returned from the original engine in QuantLib. The value with constant parameters should be similar but not identical, and hopefully the elapsed time should decrease.

  2. Try to avoid duplication between the three engines that you are modifying (European, Asian, barrier). Ideally, some of the additional code (for instance, extracting the constant parameters based on exercise date and strike) should be written just once.

To compile and run the program on your machine you'll need QuantLib installed; instructions to do that for different operating systems are at https://www.quantlib.org/install.shtml.

How to submit your solution

  1. Get a GitHub account, if you don't have one already.
  2. Clone this repository with the "Fork" button in the top right corner of the page (if you're not reading this on GitHub, go to https://github.com/lballabio/IMT2024 first).
  3. Check out your clone on your machine.
  4. Modify the source files as required by the project. Feel free to add any other file you might need. You can also add your report.
  5. When you want me to see your progress (ideally, as soon as you have a sketch of the solution), push your changes to your clone and submit a pull request. This is only needed the first time; afterwards, push the new changes to your fork and they will be added to the existing pull request automatically.

More detailed instructions for forking and creating pull requests are available at https://help.github.com/articles/fork-a-repo and https://help.github.com/articles/using-pull-requests. A basic guide to GitHub is at https://guides.github.com/activities/hello-world/.

Good luck!

imt2024's People

Contributors

lballabio avatar

Stargazers

 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.