QuantLib
QuantLib copied to clipboard
RuntimeError: Boost assertion failed: px != 0 using Merton Jump Diffusion model
I'm using the python Quantlib implementation to run monte carlo simulations and implemented different processes (GeometricBrownianMotionProcess, HestonProcess, BlackProcess and Merton76Process). All processes use the same GaussianMultiPathGenerator and all processes I implemented so far work, except for the Merton76Process.
While the GaussianMultiPathGenerator can be initialized with the Merton76Process it fails when calling the next() method with the error message: RuntimeError: Boost assertion failed: px != 0. This seems to be an issue with boost::shared_ptr - C++ memory management.
For reproducing the error, the unit tests from this branch (https://github.com/interlay/collateralization-analysis/tree/feat/unit-tests) can be run using pytest unit_tests/test_simulation.py
Any idea how to solve this?
Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.
This issue was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.
This issue was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.
Apologies for the delay — there was a null pointer access that I'm fixing for next release, but that only masked the real issue; that is, that the Merton76Process class is missing the implementation of the machinery needed for path generation. In its current form, it shouldn't have inherited from StochasticProcess at all. It might actually make sense to replace it with a different class and deprecate the current one. Sorry.
https://github.com/lballabio/QuantLib/pull/1551 fixes the null pointer access; the other issue remains.