QuantLib-Python Does Not Expose SquareRootProcess via SWIG
Summary
The question concerns pricing an American put when the underlying follows a square-root diffusion, and asks whether QuantLib-Python can use its SquareRootProcess class. The author proposes parameter values for mapping the stated process to that class, but the exchange does not address option-pricing methods or assess the proposed mapping.
The reply clarifies that the C++ library contains SquareRootProcess, while the Python interface does not expose it through SWIG. It suggests opening an issue as a possible route to adding the binding. This is a narrow software-availability note rather than a pricing tutorial: it provides no workaround, numerical example, validation, or discussion of American-option exercise modeling.
Key ideas
- The C++ QuantLib library contains a SquareRootProcess class.
- The class is unavailable through QuantLib-Python because it has not been exposed in the SWIG interface.
- The exchange does not provide a workaround or demonstrate American put pricing under the proposed process.
- An issue requesting a Python binding is suggested as a possible next step.
Tags
Full text
# SquareRootProcess in QuantLib - Python
# SquareRootProcess in QuantLib - Python
I would like to price an American put option using the SquareRootProcess class in QuantLib - Python but it seems that it does not exist. As the underlying follows the following model : $$\rm{d}S_t=rS_t\rm{d}t + \delta\sqrt{S_t}\rm{d}W_t, $$ setting $a = -r, b=0, \sigma=\delta$ in the SquareRootProcess class should be enough. Is there any way I could price this option using QuantLib-Python ? Thanks
## Answer by David Duarte (score 1)
https://quant.stackexchange.com/a/50903
QuantLib does have the SquareRootProcess class (link) but it has not been interfaced in SWIG and that's why it is not available in QuantLib-Python.
If you open an issue on github, maybe someone will pick it up.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.