pyfe / pyfeng Goto Github PK
View Code? Open in Web Editor NEWPython Financial ENGineering (PyFENG package in PyPI.org)
License: GNU General Public License v2.0
Python Financial ENGineering (PyFENG package in PyPI.org)
License: GNU General Public License v2.0
Line 327 in 1ee5f9e
The referenced call to np.asscalar needs to be changed to _sigma.item(). np.asscalar was deprecated.
https://numpy.org/doc/1.22/reference/generated/numpy.asscalar.html
The current docstring in OusvIft
shows the exact values reported in Li & Wu (2019) Table 2 and 3. But the actual output is slightly different. We need to improve the implementation.
>>> import pyfeng as pf
>>> model = pf.OusvIft(0.2, mr=4, vov=0.1, rho=-0.7, intr=0.09531)
>>> model.price(100, 100, texp=np.array([1, 5, 10]))
array([13.21493, 40.79773, 62.76312])
>>> model = pf.OusvIft(0.25, mr=8, vov=0.3, rho=-0.6, intr=0.09531)
>>> model.price(np.array([90, 100, 110]), 100, texp=1)
array([21.41873, 15.16798, 10.17448])
Actual results:
array([13.21341236, 40.78514465, 62.67427669])
array([21.41624282, 15.16575302, 10.17145969])
The disp() function should take forward, not spot.
Asian option is a special kind of basket option.
Provide an alternative creator for the basket option classes
It seems that both impvol and impvol_naive return nan:
m = pf.Bsm(sigma=0.5, intr=0.05, divr=0.1)
print(m.impvol(100, 80, 19.4, 0.1, 1))
nan
Currently rn_seed=None
by default.
Perhaps it's better to fix as rn_seed=123456
?
Fang F, Oosterlee C (2008) A Novel Pricing Method for European Options Based on Fourier-Cosine Series Expansions. SIAM J Sci Comput 31:826–848. https://doi.org/10.1137/080718061
Oosterlee CW, Grzelak LA (2019) Mathematical modeling and computation in finance: with exercises and python and matlab computer codes, 1st edn. World Scientific Publishing Co. Pte. Ltd, Hackensack
moments_vsk
to moments_mvsk
to show the mean (normalization)moments
for Asian/Basket optionsImplement the Abate & Whitt's (1992?) algorithm for inverting Laplace transform
quadpy
package
InvGam
Fix error after noramalization
Medvedev A, Scaillet O (2007) Approximation and Calibration of Short-Term Implied Volatilities Under Jump-Diffusion Stochastic Volatility. The Review of Financial Studies 20:427–459. https://doi.org/10.1093/rfs/hhl013
Drimus GG (2012) Options on realized variance by transform methods: a non-affine stochastic volatility model. Quantitative Finance 12:1679–1694. https://doi.org/10.1080/14697688.2011.565789
Heston and 3/2 models
Function / Class cache has been implemented since Py 3.9
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.