QuantLib icon indicating copy to clipboard operation
QuantLib copied to clipboard

RuntimeError: Boost assertion failed: px != 0 using Merton Jump Diffusion model

Open philippb90 opened this issue 3 years ago • 5 comments
trafficstars

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?

philippb90 avatar Aug 26 '22 09:08 philippb90

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.

boring-cyborg[bot] avatar Aug 26 '22 09:08 boring-cyborg[bot]

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.

github-actions[bot] avatar Oct 26 '22 02:10 github-actions[bot]

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.

github-actions[bot] avatar Dec 26 '22 01:12 github-actions[bot]

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.

lballabio avatar Jan 03 '23 16:01 lballabio

https://github.com/lballabio/QuantLib/pull/1551 fixes the null pointer access; the other issue remains.

lballabio avatar Jan 09 '23 15:01 lballabio