I would like to contribute bug fixes and some extenions to implementation of Cox-Ingersoll-Ross model. It includes following:
- Bug Fix: Initialization of discretization in CoxIngersollRoss::HelperProcess. In current implementation the discretization of the stochastic process is not initialized and I have not found any way to set it after the construction of object. So I added a parameter disc to the constructor of the class with default value equal to Euler Discretization.
- Bug Fix: Method dynamics of the ExtendedCoxIngersollRoss class should be declared virtual to ensure proper overloading in derived classes
- Current implementation of CoxIngersollRoss class prevents initialization if Feller condition is not fulfilled. But actually the model and the process makes sence also in this case. It just has some not nice distributional properties. So why don't we let the user decide if he wants to force Feller condition or not. I have added a boolean parameter withFellerConstraint to the parameter list of CoxIngersollRoss. It is set to "true" by default, so that the current behaviour of the class is not affected.
Best regards
Sascha
Thanks! I've simplified #1 somewhat by hard-coding the initialization in the
HelperProcess
constructor. Since it's an internal class, it probably doesn't warrant adding a default argument across two classes. #2 was not needed, since thedynamics
method is already declaredvirtual
in the base class.