Giter VIP home page Giter VIP logo

Comments (1)

cmdty avatar cmdty commented on May 26, 2024

I can think of a hacky way to allow negative prices. The multifactor model used is lognormal, so no negative prices are assumed not to be allowed. So to fudge the model to allow negative prices you need to then adjust the inputs such that the forward curve you input is not actually the forward price, but actually the forward price minus the minimum allowable price. So this assumes that forward prices are shifted-lognormal, the price + a constant is lognormal. For example if you say that the minimum price floor is -12.5, then the model (with hacked inputs) assumes that the price - (-12.5) is lognormal. The problem with this is that you then have to hack the inject/withdraw costs to adjust the cashflow to take into account the difference between the forward curve you feed in, and what the actual prices should be.

  1. Choose a price floor, i.e. the minimum price that should be allowed which in your case will be negative. This can be time-varying.
  2. Take your forward curve input and subtract the price floor, i.e. add the absolute value of the price floor.
  3. The problem now is that the spot prices simulated by the model aren't actually spot prices, they are the spot prices plus the absolute value of the price floor, hence the cash flows from injection and withdrawal will be wrong. The inject/withdraw cost can be used to adjust for this be subtracting or adding the difference between the simulated spot price and the actual price. This difference will be the price floor.
  4. Finally you will need to adjust the vols fed into the model to take into account that the model is simulating the spot price plus a constant. This will be a bit complicated, but something with moment matching could work.

Another more advanced thing you could to is just create your own spot price simulator code, which follows whatever process you want, and use this for the valuation. This is possible with the C# API, but not the Python API yet. When creating and instance of LsmcValuationParameters.Builder, instead of calling SimulateWithMultiFactorModelAndMersenneTwister or SimulateWithMultiFactorModel to create the builder with a multi-factor simulator you can assign to the builder properties RegressionSpotSimsGenerator and ValuationSpotSimsGenerator delegates which return the simulated price under whatever model you choose to implement.

from storage.

Related Issues (20)

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.