Serving the Quantitative Finance Community

 
User avatar
pcaspers
Topic Author
Posts: 712
Joined: June 6th, 2005, 9:49 am

Normal Free Boundary SABR

December 20th, 2020, 3:16 pm

Implementing the normal free boundary SABR model by Antonov et al. using the approximation for G(t,s) as outlined in "SABR spreads it wings", formulas (11), (12), (13) involves the bit "...  In computation, R(t,s) is replaced by its fourth-order expansion for small s, as is the square root expression in (11) ..." on which I can't find any more details in the paper or the references (but I might have missed something...). So partly for the record and partly to confirm what people tend to do, here's my implementation of g(s) and R(t,s). Notice the cutoff point s=0.03 (found simply by experimentation) and the Taylor polynomial in the associated if(...) block.
double g(const double s) { return s / std::tanh(s) - 1.0; }

double R(const double t, const double s) {
    double s2 = s * s;
    double s4 = s2 * s2;
    if (s < 0.03) {
        return (3072.0 + t * (384.0 + t * (24.0 + t))) / 3072.0 - t * (2688.0 + t * (80.0 + 21.0 * t)) / 322560.0 * s2 +
               t * (2816.0 - t * (88.0 + 63.0 * t)) / 3548160.0 * s4;
    }
    double s6 = s2 * s4;
    double t2 = t * t;
    double t3 = t2 * t;
    double gval = g(s);
    return 1.0 + 3.0 * t * gval / (8.0 * s2) - (5.0 * t2 * (-8.0 * s2 + gval * (24.0 + 3.0 * gval))) / (128.0 * s4) +
           (35.0 * t3 * (-40.0 * s2 + gval * (120 + gval * (24.0 + 3.0 * gval)))) / (1024.0 * s6);
}