C++ Programing for Financial Engineering Online Certificate. Join hundreds of graduates from over 35 countries on 5 continents.

Advanced C++11/C++14 and Multidisciplinary Applications Online Certificate. Launched in January 2017.

G2++: Swaption analytic formula

Discussion in 'Computing' started by Andrea, 11/15/08.

  1. Andrea

    Andrea New Member

    Hi all,
    i'm trying to build the analytic formula of an european swaption ,in Matlab, by following Brigo-Mercurio pag.158-59.

    I'm using the parameters present in the book (a=0.7735, b=0.08201, sigma=0.02228; eta=0.01038, rho=-0.7019), but when i try to calculate the

    rho_xy=((rho*sigma*eta)/((a+b)*sigma_x*sigma_y))*(1-exp(-(a+b)T))

    the value, with T=2(maturity), is -1.033.

    The problem is that when i have to calculate the h1_x the value sqrt(1-rho_xy^2) is negative, and that is impossible and it creates an error.

    Do someone have any suggestions??????

    Thank you
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice