Comments (21)
Can I work on this issue?
from tf-quant-finance.
Hi Joy!
Thanks for your interest! I've assigned the issue to you. Please follow Google Python and TensorFlow Probability Style Guides. Will update with the internal one once it is published.
In case you are new to TensorFlow, we have create a training you might find useful
As a guidance, please familiarize yourself with option_price and binary_price implementations so that it is easier for you to get started.
Please reach out if you have any issues.
from tf-quant-finance.
Sure, will do.
from tf-quant-finance.
Hi Joy, Are you still working on this issue? If you aren't could you please let us know?
-Ashish
from tf-quant-finance.
@saxena-ashish-g I'm not working on this issue. Whoever wants to take this please go ahead.
from tf-quant-finance.
@cyrilchim I didnt come across any folder named volatility under tf_quant_finance. Can you please point me to the file?
from tf-quant-finance.
@Rish001 It has been refactored. This has to go to models/sabr/approximations/european_option.py (similarly to heston structure)
from tf-quant-finance.
Do you want this approximation of SABR model to be implemented?
from tf-quant-finance.
Yes, Rishav, that is the approximation. One could use it for calibration purposes as described in the paper
from tf-quant-finance.
What are the possible test cases that my implementation needs to be tested against?
from tf-quant-finance.
from tf-quant-finance.
How are these integrations working? are these integrations nested in one inside the other?
It would help me if you can give me a clue how this integral would look like for tenor T2 and beyond.
And, from where can I obtain the value of B(t,T_N)?
And, while numerically evaluating the integral how should I set up the grid? the domain of integration is (0,infinity)^2
source : Wu
Also, in the same paper, data has been collected in the following manner:
and model has been calibrated in the following manner:
summary statistics of data:
and that of residuals errors of model calibration:
my question is, for the purpose of calibration, are volatility values of two option tenors say 3M(10.81,10.22,...) and 6M(10.99,10.32...) are being considered?
if so, then what are the option tenors T1 and T2 that are mentioned in residual error summary?
from tf-quant-finance.
@Rish001 The approximation p(t, ... )
is the forward transition density of the SABR process. Computing option prices could be done by creating a uniform grid of points in (F, A)
space and computing the average in the formula (2.6) from the original paper. B
is a zero-coupon bond price which is a standard notion. In case of a constant interest rate r
it is a discount factor exp(-r * (T - t))
. (see, e.g., here)
I think the best way to get started is to implement the approximation first. It seems that the original paper is self-contained in terms of notations.
By the time this is implemented, we will have the SABR model in the module and you will be able to use Monte Carlo method to get option prices and get your implementation tested. Does this sound good?
from tf-quant-finance.
As the mentioned integral is unbounded, I think Monte Carlo integration is to be applied. Do you think there is any other way to compute the integral?
from tf-quant-finance.
@cyrilchim I have built a minimal viable code for determining option price for option tenor T1. But i am encountering overflow error which I am unable to remove. I would really appreciate it if you can provide me some helpful direction.
Please find the link to code in google colab
from tf-quant-finance.
@Rish001 Could you please give me access to the colab? As for the integration boundaries, make them function arguments and give them some sensible values for the tests. We will figure out appropriate default values later (e.g., based on the analytical approximations to implied vol)
from tf-quant-finance.
@cyrilchim I have given the access. Please check it out
from tf-quant-finance.
@Rish001 You need to write unit tests for the functions. There is clearly a bug somewhere as it seems your values overflow. At this point this is not a TF problem but this is an issue with the numpy code you have written. Try rerunning monte carlo with fewer iterations and maybe use pdb tool to debug the code (see colab usage here)
from tf-quant-finance.
Just to leave you an update. I have mostly finished debugging and will be submitting shortly
from tf-quant-finance.
@cyrilchim could you give me a set of test cases to test my implementation against? I need a number of combinations of alpha, beta,rho, nu,forwards,strikes and time to maturity and corresponding implied volatility values so that I can test my SABR implied vol calculation
from tf-quant-finance.
Hi Rishav,
We do not have explicit tests but you should be able to use current SABR model to sample trajectories and estimate European option price (put or call). Your approximation should give similar results. For parameters use similar values to what we have in tests
from tf-quant-finance.
Related Issues (20)
- New Release
- JointItoProcess
- Unable to import tf_quant_finance as tff in Colab notebook: Monte_Carlo_Euler_Scheme.ipynb
- Memory leak with TF.function HOT 2
- Discrete dividens for american options HOT 24
- Which precision should I use? float32 or float64 HOT 2
- case-sensitive paths on a case-insensitive filesystem HOT 4
- XLA compilation error of a TARF payoff with MC HOT 16
- IRS Delta HOT 1
- conda-forge package HOT 1
- Fair performance comparison with QuantLib HOT 9
- times grid bug (XLA) HOT 1
- Quant
- The mailing-list is set to Invite Only HOT 1
- Issue with running Bazel tests HOT 2
- Options at-expiration return `nan` HOT 2
- SOFR USD OIS curve
- Hull White Model - calibration not aligning to input prices HOT 3
- Negative price for barrier option
- TF 2.12 (and Python 3.11) support HOT 2
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 tf-quant-finance.