QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
denglizhoubasketengine.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2024 Klaus Spanderen
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file denglizhoubasketengine.hpp
21 \brief Deng, Li and Zhou: Closed-Form Approximation for Spread option pricing
22*/
23
24#ifndef quantlib_deng_li_zhou_basket_engine_hpp
25#define quantlib_deng_li_zhou_basket_engine_hpp
26
29
30namespace QuantLib {
31
32 //! Pricing engine for basket option on multiple underlyings
33 /*! This class implements the pricing formula from
34 "Multi-asset Spread Option Pricing and Hedging",
35 S. Deng, M. Li, J.Zhou, 2008
36 https://mpra.ub.uni-muenchen.de/8259/1/MPRA_paper_8259.pdf
37
38 The typo in formula (37) for J^2 is corrected
39
40 This pricing formula only works if exactly one asset weight is positive.
41 If more than one weight is positive then a mapping of the sum of correlated
42 log-normal processes onto one log-normal process has to be carried out.
43 This implementation is using:
44 "WKB Approximation for the Sum of Two Correlated Lognormal Random Variables",
45 C.F. Lo 2013
46 https://www.m-hikari.com/ams/ams-2013/ams-125-128-2013/loAMS125-128-2013.pdf
47 for this task.
48
49 \ingroup basketengines
50
51 \test the correctness of the returned value is tested by
52 reproducing results available in literature.
53 */
55 public:
57 std::vector<ext::shared_ptr<GeneralizedBlackScholesProcess> > processes,
58 Matrix rho);
59
60 void calculate() const override;
61
62 private:
64 const Array& s, DiscountFactor dr, const Array& dq,
65 const Array& v, const Matrix& rho, Time T);
66
67 static Real I(Real u, Real tF2, const Matrix& D, const Matrix& DF, Size i);
68
69 const Size n_;
70 const std::vector<ext::shared_ptr<GeneralizedBlackScholesProcess> > processes_;
71 const Matrix rho_;
72 };
73}
74
75#endif
Basket option on a number of assets.
Black-Scholes processes.
1-D array used in linear algebra.
Definition: array.hpp:52
Basket-option engine base class
Pricing engine for basket option on multiple underlyings.
const std::vector< ext::shared_ptr< GeneralizedBlackScholesProcess > > processes_
static Real I(Real u, Real tF2, const Matrix &D, const Matrix &DF, Size i)
static Real calculate_vanilla_call(const Array &s, DiscountFactor dr, const Array &dq, const Array &v, const Matrix &rho, Time T)
Matrix used in linear algebra.
Definition: matrix.hpp:41
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66
std::size_t Size
size of a container
Definition: types.hpp:58
Real rho
Definition: any.hpp:37
ext::shared_ptr< BlackVolTermStructure > v