QuantLib icon indicating copy to clipboard operation
QuantLib copied to clipboard

Computation of cdf in LocalVolRNDCalculator

Open mdotlic opened this issue 3 years ago • 3 comments
trafficstars

Computing cdf boundaries was wrong. In case xl is positive, while loop lowers xl but only to 0, if it is negative xl (through while loop) rise towards 0. In case xr is positive previous code is good as it tends towards +infinity. However, if xr is negative it tends towards -infinity.

xl should always tends towards -infinity and xr towards +infinity (up to a tolerance)

Maybe this can be done in better way, however this should work

mdotlic avatar Jul 22 '22 08:07 mdotlic

Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.

boring-cyborg[bot] avatar Jul 22 '22 08:07 boring-cyborg[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 22 '22 08:07 CLAassistant

Hi

thanks for spotting this issue. Maybe we should initialize the addition factor with a relative scale instead of an absolute value? E.g.

Real addition = 0.1*(xr-xl);

cheers Klaus

klausspanderen avatar Aug 05 '22 15:08 klausspanderen

Thanks, @mdotlic! May you check the automated comment above by CLAassistant and click the link?

lballabio avatar Aug 16 '22 14:08 lballabio

Coverage Status

Coverage increased (+0.002%) to 71.174% when pulling b76d14ee29846efd567d4d0b68427bdef951342a on mdotlic:master into 63bac2f94e6c046ab18cf573a92129ea414c25b4 on lballabio:master.

coveralls avatar Aug 16 '22 15:08 coveralls

Congratulations on your first merged pull request!

boring-cyborg[bot] avatar Sep 07 '22 15:09 boring-cyborg[bot]