Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
eqbsparametrization.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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/*! \file eqbsparametrization.hpp
20 \brief EQ Black Scholes parametrization
21 \ingroup models
22*/
23
24#ifndef quantext_eqbs_parametrization_hpp
25#define quantext_eqbs_parametrization_hpp
26
27#include <ql/handle.hpp>
28#include <ql/termstructures/yieldtermstructure.hpp>
30
31namespace QuantExt {
32using namespace QuantLib;
33
34//! EQ Black Scholes parametrizations
35/*! Base class for EQ Black Scholes parametrizations
36 \ingroup models
37*/
39public:
40 /*! The currency refers to the equity currency,
41 the equity and fx spots are as of today
42 (i.e. the discounted spot) */
43 EqBsParametrization(const Currency& eqCcy, const std::string& eqName, const Handle<Quote>& equitySpotToday,
44 const Handle<Quote>& fxSpotToday, const Handle<YieldTermStructure>& equityIrCurveToday,
45 const Handle<YieldTermStructure>& equityDivYieldCurveToday);
46 /*! must satisfy variance(0) = 0.0, variance'(t) >= 0 */
47 virtual Real variance(const Time t) const = 0;
48 /*! is supposed to be positive */
49 virtual Real sigma(const Time t) const;
50 virtual Real stdDeviation(const Time t) const;
51 const Handle<Quote> eqSpotToday() const;
52 const Handle<Quote> fxSpotToday() const;
53 const Handle<YieldTermStructure> equityIrCurveToday() const;
54 const Handle<YieldTermStructure> equityDivYieldCurveToday() const;
55
56 Size numberOfParameters() const override { return 1; }
57
58private:
59 const Handle<Quote> eqSpotToday_, fxSpotToday_;
60 const Handle<YieldTermStructure> eqRateCurveToday_, eqDivYieldCurveToday_;
61 std::string eqName_;
62};
63
64// inline
65
66inline Real EqBsParametrization::sigma(const Time t) const {
67 return std::sqrt((variance(tr(t)) - variance(tl(t))) / h_);
68}
69
70inline Real EqBsParametrization::stdDeviation(const Time t) const { return std::sqrt(variance(t)); }
71
72inline const Handle<Quote> EqBsParametrization::eqSpotToday() const { return eqSpotToday_; }
73
74inline const Handle<Quote> EqBsParametrization::fxSpotToday() const { return fxSpotToday_; }
75
76inline const Handle<YieldTermStructure> EqBsParametrization::equityIrCurveToday() const { return eqRateCurveToday_; }
77
78inline const Handle<YieldTermStructure> EqBsParametrization::equityDivYieldCurveToday() const {
80}
81
82} // namespace QuantExt
83
84#endif
EQ Black Scholes parametrizations.
const Handle< YieldTermStructure > equityDivYieldCurveToday() const
const Handle< Quote > fxSpotToday_
virtual Real variance(const Time t) const =0
const Handle< Quote > eqSpotToday() const
Size numberOfParameters() const override
const Handle< YieldTermStructure > eqDivYieldCurveToday_
const Handle< Quote > eqSpotToday_
virtual Real stdDeviation(const Time t) const
const Handle< YieldTermStructure > eqRateCurveToday_
const Handle< Quote > fxSpotToday() const
const Handle< YieldTermStructure > equityIrCurveToday() const
virtual Real sigma(const Time t) const
Time tl(const Time t) const
Time tr(const Time t) const
base class for model parametrizations