Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
normalfreeboundarysabr.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19#include "toplevelfixture.hpp"
20
22
23#include <boost/make_shared.hpp>
24#include <boost/test/unit_test.hpp>
25
26using namespace QuantLib;
27using namespace QuantExt;
28using namespace boost::unit_test_framework;
29
30BOOST_FIXTURE_TEST_SUITE(QuantExtTestSuite, qle::test::TopLevelFixture)
31
32BOOST_AUTO_TEST_SUITE(NormalFreeBoundarySabrTest)
33
34BOOST_AUTO_TEST_CASE(testNormalFreeBoundarySabr) {
35
36 BOOST_TEST_MESSAGE("Testing normal free boundary SABR...");
37
38 Real forward = 0.0, expiryTime = 5.0, alpha = 0.0050, nu = 0.52, rho = -0.23;
39
40 BOOST_TEST_MESSAGE("vol=" << normalFreeBoundarySabrVolatility(0.0, forward, expiryTime, alpha, nu, rho));
41
42 // WIP...
43
44 // for (Real strike = -0.10; strike < 0.10 + 1E-5; strike += 0.0001) {
45 // BOOST_TEST_MESSAGE(strike << " " << normalSabrVolatility(strike, forward, expiryTime, alpha, nu, rho) << " "
46 // << normalFreeBoundarySabrVolatility(strike, forward, expiryTime, alpha, nu, rho));
47 // }
48}
49
50BOOST_AUTO_TEST_SUITE_END()
51
52BOOST_AUTO_TEST_SUITE_END()
Real normalFreeBoundarySabrVolatility(Rate strike, Rate forward, Time expiryTime, Real alpha, Real nu, Real rho)
Definition: normalsabr.cpp:118
BOOST_AUTO_TEST_CASE(testNormalFreeBoundarySabr)
normal SABR model implied volatility approximation
Fixture that can be used at top level.