Financial Models Numerical Methods: Quantitative Finance Notebooks in Python
Collection of notebooks about quantitative finance, with interactive python code.
At a glance
- What is it?
- This repository is a collection of Jupyter notebooks on quantitative finance covering PDE methods, Lévy processes, Fourier inversion, Kalman filtering, and mean-variance optimization, with runnable Python code for students and practitioners who already have a foundation in financial mathematics.
- Who is it for?
- This repository is the right resource for students in financial mathematics or practitioners who want working Python implementations of techniques that are typically skipped in introductory courses: PDE option pricing, Lévy process simulation, Fourier inversion, and Kalman filtering applied to market data. The author is clear that this is not a beginner resource and that a grounding in stochastic calculus and statistics is required.
- Can I use it commercially?
- Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
- Is it still maintained?
- Yes. The repository last received commits 15 days ago.
- What is it written in?
- Mainly Jupyter Notebook, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What This Repository Is and Who It Is For
Quantitative finance has a well-documented gap between textbook theory and working code. Standard courses teach Black-Scholes, Monte Carlo, and binomial trees, but less common techniques such as PDE finite-difference methods, Lévy processes, Fourier inversion for option pricing, and Kalman filtering for market data analysis are often presented only in academic papers or specialist textbooks without accompanying implementation.
This repository fills that gap with a set of Jupyter notebooks that present each topic with both the mathematical background and runnable Python code. The README is explicit about its audience: "students in science, economics or finance who have followed at least one undergraduate course in financial mathematics and statistics" and self-taught practitioners who have read an introductory book on financial mathematics. It is not for absolute beginners: the author states directly that the notebooks will not explain what a call option or a stochastic process is.
The author describes it as a collection of topics that are interesting but not commonly found with working code examples online. The emphasis is on interactive demonstration: Jupyter notebooks let readers run the code, change parameters, and see the results immediately, which the author identifies as the best way to study computational finance.
The series is not complete. The README notes that more notebooks will be added over time, and the last push was on 2026-09-14.
Repository Structure: How the Notebooks Are Organized
The notebooks are numbered by topic group. Each is an independent file that can be studied on its own without needing to run the others first.
The Black-Scholes group covers lognormal distribution, change of measure, Monte Carlo simulation, and the binomial method (1.1), followed by SDE simulation and statistical analysis including the Cox-Ingersoll-Ross process and Euler-Maruyama discretization (1.2), Fourier inversion methods including FFT-based option pricing (1.3), the Heston stochastic volatility model (1.4), and Lévy processes including Merton jump-diffusion, Variance Gamma, and Normal Inverse Gaussian models (1.5).
The PDE group covers Black-Scholes PDE discretization with sparse matrix solvers (2.1), exotic options including binary, barrier, and Asian options (2.2), and American option pricing with the Longstaff-Schwartz algorithm (2.3).
The PIDE group covers the Merton jump-diffusion PIDE using implicit-explicit discretization (3.1), Variance Gamma PIDE (3.2), and Normal Inverse Gaussian PIDE (3.3).
A separate group covers option pricing with transaction costs via the Davis-Panas-Zariphopoulou model and HJB variational inequalities (4.1) and volatility smile calibration (4.2).
The Kalman filter group covers linear regression and Kalman filter design on market data (5.1), autoregressive process estimation with the Kalman smoother (5.2), and volatility tracking combining GARCH(1,1) with the Kalman filter (5.3).
The final numbered sections cover the Ornstein-Uhlenbeck process with a Vasicek PDE application (6.1) and classical mean-variance optimization using quadratic programming (7.1). Three appendices cover linear equation solvers (A.1), code optimization with Cython and C (A.2), and an introduction to Lévy processes theory as a PDF (A.3).
Setting Up the Environment and Running the Notebooks
The README provides four options for setting up the Python environment. The recommended approach uses Anaconda to recreate the tested environment from the included environment.yml file:
conda env create -f environment.yml
pip install -e .The first command recreates the exact conda environment the author used. The second installs the local FMNM package, which contains helper code shared across notebooks. If you want a fresh environment with the latest Python instead:
conda create -n FMNM python
conda activate FMNM
pip install -e .For users who prefer venv with a specific Python version:
python3.11.4 -m venv --prompt FMNM python-venv
source python-venv/bin/activate
python3 -m pip install --upgrade pip
pip install --requirement requirements.txt
pip install -e .A Docker option is also available for running JupyterLab in a container. The docker-compose.yml mounts the repository directory into the container and starts JupyterLab on port 8888:
services:
jupyterlab:
image: fmnm
build: .
ports:
- "8888:8888"
volumes:
- .:/workspace
command: ["jupyter", "nbclassic", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root", "--NotebookApp.token=''"]The README notes that mathematical formulas may not render correctly when viewing notebooks on GitHub or NBviewer, and recommends cloning or downloading the repository to run them locally.
Coverage of Advanced Techniques Not Found in Standard Courses
The notebooks deliberately target topics that practitioners often skip. PDE finite-difference methods for option pricing (notebooks 2.1 through 3.3) are rarely taught in applied courses because they require understanding sparse matrix assembly and implicit-explicit time-stepping schemes. Notebook 2.1 includes a sparse matrix tutorial as part of the Black-Scholes PDE coverage.
The Lévy process group is notable for its breadth. Notebooks 1.5, 3.1, 3.2, and 3.3 cover three specific Lévy process families (Merton jump-diffusion, Variance Gamma, and Normal Inverse Gaussian) with path generation, parameter estimation, Monte Carlo pricing, Fourier inversion pricing, and PIDE numerical methods. This is a level of coverage that is difficult to find with working code examples in a single place.
The Kalman filter section (5.1 through 5.3) applies the technique to financial market data rather than engineering systems, covering autoregression tracking, volatility estimation, and a comparison with GARCH. Notebook 6.1 on the Ornstein-Uhlenbeck process includes a section on trading strategy design, which connects the theoretical model to practical application.
Notebook A.2 on code optimization covers Cython and C extensions, which is unusual for a finance notebook collection and targets users who need production-grade performance from their numerical implementations.
Limitations: Scope, Dependencies, and License
The repository is a teaching collection, not a production library. The FMNM package installed with `pip install -e .` contains helper code for the notebooks but is not a general-purpose finance library. Users cannot import it into an application as a drop-in pricing library.
The dependency list is substantial. The requirements.txt pins dozens of packages to specific versions that were current in 2023. Running the notebooks with more recent package versions may require updating version constraints, particularly for NumPy, Pandas, and the visualization libraries.
The series is incomplete by design. The author states that more notebooks will be added from time to time and that interest in enterprise-grade RAG topics (unrelated to the main topic) may influence the direction. Coverage gaps currently include interest rate models beyond the Vasicek PDE, credit derivatives, and newer machine learning approaches to derivatives pricing.
The AGPL-3.0 license is more restrictive than MIT or Apache 2.0. If you modify the code and distribute it, including as part of a hosted service, you must release the source code of your modifications under the same license. For educational use within an organization this rarely matters, but teams building commercial products using this code as a starting point should treat the license as a constraint.
This Repository versus QuantLib
QuantLib is a C++ library with Python bindings that provides production-grade implementations of pricing functions for hundreds of instrument types including bonds, swaps, options, and exotic derivatives. The difference in purpose is clear: QuantLib is a library you import and call to price instruments; this repository is a collection of notebooks that show you how the pricing algorithms work from first principles.
QuantLib does not include step-by-step mathematical derivations, Lévy process simulation from scratch, or Kalman filter applications to market data. It provides working implementations of standard models but not the PDE, PIDE, and Fourier methods covered here.
For a practitioner who needs to price instruments in production, QuantLib is the right tool. For a student or researcher who wants to understand the numerical mechanics behind option pricing, or who wants Python code that implements techniques beyond the standard textbook repertoire, this repository addresses that need directly.
Project Status and License
The repository is licensed under AGPL-3.0. The project name in pyproject.toml is FMNM (Financial Models Numerical Methods), version 1.0.0, with Python 3.8 or newer required. The package is authored by cantaro86 (Nicola Cantarutti).
The last push to the master branch was on 2026-09-14. The series is described as ongoing in the README; the author states interest in adding more content on stochastic processes, Kalman filtering, and statistics.
The top-level repository includes each notebook as a numbered .ipynb file, along with the environment.yml, requirements.txt, list_of_packages.txt, Dockerfile, and docker-compose.yml for setup, and a latex/ directory likely containing LaTeX source for the mathematical appendix A.3 that is distributed as a PDF.
Editorial conclusion
This repository is the right resource for students in financial mathematics or practitioners who want working Python implementations of techniques that are typically skipped in introductory courses: PDE option pricing, Lévy process simulation, Fourier inversion, and Kalman filtering applied to market data. The author is clear that this is not a beginner resource and that a grounding in stochastic calculus and statistics is required. The AGPL-3.0 license means that modifications to the code must be released under the same terms if distributed. The series is ongoing; the README states the author uploads more notebooks from time to time, and the last push was on 2026-09-14, so the project is still receiving updates.
Frequently asked questions
What prior knowledge is needed to use the Financial Models Numerical Methods notebooks?
The README states the notebooks require a basic knowledge of stochastic calculus, financial mathematics, and statistics, plus basic Python. They are aimed at students who have completed at least one undergraduate course in financial mathematics. Absolute beginners will find the notebooks assume too much background.
Can the Financial Models Numerical Methods notebooks be run in isolation, or must they be done in order?
Each notebook is described as almost independent from the others, so you can select only the topics you are interested in without working through the full sequence. Some notebooks build on concepts introduced earlier in the series, but the README explicitly notes the independent structure as a feature.
Does the Financial Models Numerical Methods repository cover machine learning or deep learning for finance?
The README does not describe any machine learning or neural network content. The covered topics are classical quantitative finance methods: PDE and PIDE numerical methods, Monte Carlo simulation, Fourier inversion, Kalman filtering, and mean-variance optimization.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/cantaro86-financial-models-numerical-methods)