erkandem / calcbsimpvol Goto Github PK
View Code? Open in Web Editor NEWCalculate Black Scholes Implied Volatility - Vectorwise
Home Page: https://erkandem.github.io/calcbsimpvol/
License: MIT License
Calculate Black Scholes Implied Volatility - Vectorwise
Home Page: https://erkandem.github.io/calcbsimpvol/
License: MIT License
I was wondering if any performance optimization has been explored on the GPU for this. In particular, I was thinking that Python JAX would be very well suited to this optimization. I'm still familiarizing myself with the source/algorithm used here for the computation, but in addition to providing optional GPU-backed numpy for computing, JAX also provides:
jit(), for speeding up your code
grad(), for taking derivatives
vmap(), for automatic vectorization or batching.
in case any of these would be helpful here. A demo of computing the greeks via differentials on Black-Scholes from grad()
is shown here, although I've found that the demo is further improved with jit()
on the functions there.
You can simply change S in line 236 to S[cp==-1] and similarly where it occurs for [cp==1]
Is your feature request related to a problem? Please describe.
the CI runs tests for 3.8 max. we could add 3.9+ to the pipeline
Describe the solution you'd like
Add 3.9+ to the CI runs
Describe alternatives you've considered
Using chicken bones as part of a Voodoo ritual.
Additional context
Hi Erkan,
I have been using your calcbsimpvol and it's awesome! A real life saver.
Now, while trying to use it one maturity at a time (to apply it to options
on futures, where the underlying is a specific futures contract), and
passing a 1-dim vector as 'cp', I get get an error in the broadcasting
operation line 254 linked to the shape of tau. I looked further and
wanted your opinion on whether the code had an an error in the function
"calcbsimpvol" lines 187 and 189? Shouldn't size(q) and size(cp) be
size(q)==1 and size(cp)==1?calcbsimpvol/calcbsimpvol/src/calcbsimpvol.py
Line 187 in b38639a
and
calcbsimpvol/calcbsimpvol/src/calcbsimpvol.py
Line 189 in b38639a
Best,
GregOn Tue, Mar 24, 2020 at 5:00 PM Erkan Demiralay [email protected]
wrote:โ
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AOCW7MY2KMRWS2OJOXEOCI3RJENOLANCNFSM4LS7MXXA
.Originally posted by @gregdesu in #1 (comment)
I would have committed some changes directly into master
but let's use a this issue as a wrapper.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.