Skip to content

Commit

Permalink
make jaeckel the default name
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaspers committed Jul 26, 2024
1 parent da79d43 commit 11c8559
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
24 changes: 12 additions & 12 deletions ql/pricingengines/blackformula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,12 @@ namespace QuantLib {

}

Real bachelierBlackFormulaImpliedVol(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount) {
Real bachelierBlackFormulaImpliedVolChoi(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount) {

const static Real SQRT_QL_EPSILON = std::sqrt(QL_EPSILON);

Expand Down Expand Up @@ -881,12 +881,12 @@ namespace QuantLib {

} // namespace

Real bachelierBlackFormulaImpliedVolExact(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount) {
Real bachelierBlackFormulaImpliedVol(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount) {

Real theta = optionType == Option::Call ? 1.0 : -1.0;

Expand Down
24 changes: 12 additions & 12 deletions ql/pricingengines/blackformula.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,24 +365,24 @@ namespace QuantLib {
Implied Volatility Under Arithmetic Brownian Motion”,
Applied Math. Finance, 16(3), pp. 261-268.
*/
Real bachelierBlackFormulaImpliedVol(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount = 1.0);
Real bachelierBlackFormulaImpliedVolChoi(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount = 1.0);

/*! Exact Bachelier implied volatility
It is calculated using the analytic implied volatility formula
of Jaeckel (2017), "Implied Normal Volatility"
*/
Real bachelierBlackFormulaImpliedVolExact(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount = 1.0);
Real bachelierBlackFormulaImpliedVol(Option::Type optionType,
Real strike,
Real forward,
Real tte,
Real bachelierPrice,
Real discount = 1.0);

/*! Bachelier formula for standard deviation derivative
\warning instead of volatility it uses standard deviation, i.e.
Expand Down
8 changes: 4 additions & 4 deletions test-suite/blackformula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ BOOST_AUTO_TEST_CASE(testBachelierImpliedVol) {

Real callPrem = bachelierBlackFormula(optionType, strike, forward, stdDev, discount);

Real impliedBpVol =
bachelierBlackFormulaImpliedVol(optionType, strike, forward, tte, callPrem, discount);
Real impliedBpVol = bachelierBlackFormulaImpliedVolChoi(optionType, strike, forward, tte,
callPrem, discount);

if (std::fabs(bpvol - impliedBpVol) > 1.0e-12) {
BOOST_ERROR("Failed, expected " << bpvol << " realised " << impliedBpVol);
}

Real impliedBpVolExact = bachelierBlackFormulaImpliedVolExact(optionType, strike, forward,
tte, callPrem, discount);
Real impliedBpVolExact =
bachelierBlackFormulaImpliedVol(optionType, strike, forward, tte, callPrem, discount);

if (std::fabs(bpvol - impliedBpVolExact) > 1.0e-15) {
BOOST_ERROR("Failed, expected " << bpvol << " realised " << impliedBpVolExact);
Expand Down

0 comments on commit 11c8559

Please sign in to comment.