Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
eqbspiecewiseconstantparametrization.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 eqbspiecewiseconstantparametrization.hpp
20 \brief piecewise constant model parametrization
21 \ingroup models
22*/
23
24#ifndef quantext_piecewiseconstant_eqbs_parametrization_hpp
25#define quantext_piecewiseconstant_eqbs_parametrization_hpp
26
29
30namespace QuantExt {
31//! EQ Black Scholes constant parametrization
32/*! EQ Black Scholes parametrization with piecewise
33 constant volatility
34 \ingroup models
35*/
37public:
38 /*! The currency refers to the equity currency, the spots
39 are as of today (i.e. the discounted spot) */
40 EqBsPiecewiseConstantParametrization(const Currency& currency, const std::string& eqName,
41 const Handle<Quote>& eqSpotToday, const Handle<Quote>& fxSpotToday,
42 const Array& times, const Array& sigma,
43 const Handle<YieldTermStructure>& eqIrCurveToday,
44 const Handle<YieldTermStructure>& eqDivYieldCurveToday);
45 /*! The term structure is needed in addition because it
46 it's day counter and reference date is needed to
47 convert dates to times. It should be the term structure
48 of the domestic IR component in the cross asset model,
49 since this is defining the model's date-time conversion
50 in more general terms. */
51 EqBsPiecewiseConstantParametrization(const Currency& currency, const std::string& eqName,
52 const Handle<Quote>& eqSpotToday, const Handle<Quote>& fxSpotToday,
53 const std::vector<Date>& dates, const Array& sigma,
54 const Handle<YieldTermStructure>& domesticTermStructure,
55 const Handle<YieldTermStructure>& eqIrCurveToday,
56 const Handle<YieldTermStructure>& eqDivYieldCurveToday);
57 Real variance(const Time t) const override;
58 Real sigma(const Time t) const override;
59 const Array& parameterTimes(const Size) const override;
60 const QuantLib::ext::shared_ptr<Parameter> parameter(const Size) const override;
61 void update() const override;
62
63protected:
64 Real direct(const Size i, const Real x) const override;
65 Real inverse(const Size i, const Real y) const override;
66
67private:
68 void initialize(const Array& sigma);
69};
70
71// inline
72
73inline Real EqBsPiecewiseConstantParametrization::direct(const Size, const Real x) const {
75}
76
77inline Real EqBsPiecewiseConstantParametrization::inverse(const Size, const Real y) const {
79}
80
81inline Real EqBsPiecewiseConstantParametrization::variance(const Time t) const {
83}
84
86
87inline const Array& EqBsPiecewiseConstantParametrization::parameterTimes(const Size i) const {
88 QL_REQUIRE(i == 0, "parameter " << i << " does not exist, only have 0");
90}
91
92inline const QuantLib::ext::shared_ptr<Parameter> EqBsPiecewiseConstantParametrization::parameter(const Size i) const {
93 QL_REQUIRE(i == 0, "parameter " << i << " does not exist, only have 0");
95}
96
98
99} // namespace QuantExt
100
101#endif
EQ Black Scholes parametrizations.
const Handle< Quote > eqSpotToday() const
const Handle< Quote > fxSpotToday() const
Real inverse(const Size i, const Real y) const override
Real direct(const Size i, const Real x) const override
const QuantLib::ext::shared_ptr< Parameter > parameter(const Size) const override
virtual const Currency & currency() const
const QuantLib::ext::shared_ptr< PseudoParameter > y_
Real int_y_sqr(const Time t) const
int_0^t y^2(s) ds
EQ Black Scholes parametrization.
helper classes for piecewise constant parametrizations