Coder Social home page Coder Social logo

fangoost's Introduction

Linux Windows Codecov
lin-badge win-badge cov-badge

This is a generic implementation of the Fang-Oosterlee paper for inverting density functions and convolutions. Depends on my Functional Utilities library.

The library falls into two categories: a "Levy" section which assumes that the characteristic function and the integrand depend on a common variable, and a standard section where the characteristic function and integrand do not depend on a common variable. To price options, the characteristic function is of the form exp(ui x_0+\phi(u)) where x_0 is equal to log(S/K) and K iterates over all required strikes. Hence when integrating, the characteristic function must be re-evaluated at every interval. Without this requirement, the algorithm is more efficient since the characteristic function can be evaluated once for every discrete u.

To see how this algorithm can be used, see the test code, my FFTOptionPricing repo, and my cfdistutilities repo.

Some API oddities

The computeInvDiscrete functions (and some of the other discrete functions) assume that the CF has already been multiplied by cp; see the test cases with computeInvDiscrete. However, some discrete functions do take a "raw" CF: see for example computeInvDiscreteLog. The reason is that adding cp is not added to the computeInvDiscrete function is for efficiency purposes.

Limitations

For densities without derivatives of all orders, the convergence may be slow. For example, Beta distributions may not converge at all when the mode of the distribution is near zero or one.

fangoost's People

Contributors

danielhstahl avatar

Stargazers

Uhri avatar Vlad Trukhin avatar  avatar

Watchers

 avatar

Forkers

zeta1999

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.