Comments (1)
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.
- 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.
- Take your forward curve input and subtract the price floor, i.e. add the absolute value of the price floor.
- 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.
- 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)
- Document Multi-Factor Helper Classes
- Mean reversion for three-factor seasonal model HOT 25
- Tidy Up Python Build/CI/Test Dependencies and Fix Versions
- Discount Factors Rather Than Interest Rates Provided by Caller
- Volatility and Correlation of Traded Forward Contracts
- Separate Nomination Dates From Delivery Dates
- Create .NET Console App
- Allow Excel Add-in Two Calculation Modes HOT 1
- More Vectorisations with MKL
- Fix Warnings on Creating Python Package
- Fix C# Coverage
- Add C# Sample for LSMC Valuation
- Set up Sample Notebooks with Binder
- Move Delta Calculation out of Core Valuation Code HOT 1
- Include Standard Error in LSMC Results
- Calculate and Return Standard Error of Delta
- Standard Error Bug
- Use SVD for Regression in LSMC
- issues with extrinsic expected profile HOT 2
- Example Python code for calibrating the 3-factor seasonal model will be added to this repo later.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storage.