Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
EqBsPiecewiseConstantParametrization Class Reference

EQ Black Scholes constant parametrization. More...

#include <qle/models/eqbspiecewiseconstantparametrization.hpp>

+ Inheritance diagram for EqBsPiecewiseConstantParametrization:
+ Collaboration diagram for EqBsPiecewiseConstantParametrization:

Public Member Functions

 EqBsPiecewiseConstantParametrization (const Currency &currency, const std::string &eqName, const Handle< Quote > &eqSpotToday, const Handle< Quote > &fxSpotToday, const Array &times, const Array &sigma, const Handle< YieldTermStructure > &eqIrCurveToday, const Handle< YieldTermStructure > &eqDivYieldCurveToday)
 
 EqBsPiecewiseConstantParametrization (const Currency &currency, const std::string &eqName, const Handle< Quote > &eqSpotToday, const Handle< Quote > &fxSpotToday, const std::vector< Date > &dates, const Array &sigma, const Handle< YieldTermStructure > &domesticTermStructure, const Handle< YieldTermStructure > &eqIrCurveToday, const Handle< YieldTermStructure > &eqDivYieldCurveToday)
 
Real variance (const Time t) const override
 
Real sigma (const Time t) const override
 
const Array & parameterTimes (const Size) const override
 
const QuantLib::ext::shared_ptr< Parameter > parameter (const Size) const override
 
void update () const override
 
- Public Member Functions inherited from EqBsParametrization
 EqBsParametrization (const Currency &eqCcy, const std::string &eqName, const Handle< Quote > &equitySpotToday, const Handle< Quote > &fxSpotToday, const Handle< YieldTermStructure > &equityIrCurveToday, const Handle< YieldTermStructure > &equityDivYieldCurveToday)
 
virtual Real variance (const Time t) const =0
 
virtual Real sigma (const Time t) const
 
virtual Real stdDeviation (const Time t) const
 
const Handle< Quote > eqSpotToday () const
 
const Handle< Quote > fxSpotToday () const
 
const Handle< YieldTermStructure > equityIrCurveToday () const
 
const Handle< YieldTermStructure > equityDivYieldCurveToday () const
 
Size numberOfParameters () const override
 
- Public Member Functions inherited from Parametrization
 Parametrization (const Currency &currency, const std::string &name="")
 
virtual ~Parametrization ()
 
virtual const Currency & currency () const
 
virtual const Array & parameterTimes (const Size) const
 
virtual Size numberOfParameters () const
 
virtual Array parameterValues (const Size) const
 
virtual const QuantLib::ext::shared_ptr< Parameter > parameter (const Size) const
 
virtual void update () const
 
const std::string & name () const
 
virtual Real direct (const Size, const Real x) const
 
virtual Real inverse (const Size, const Real y) const
 

Protected Member Functions

Real direct (const Size i, const Real x) const override
 
Real inverse (const Size i, const Real y) const override
 
- Protected Member Functions inherited from Parametrization
Time tr (const Time t) const
 
Time tl (const Time t) const
 
Time tr2 (const Time t) const
 
Time tm2 (const Time t) const
 
Time tl2 (const Time t) const
 

Private Member Functions

void initialize (const Array &sigma)
 
- Private Member Functions inherited from PiecewiseConstantHelper1
 PiecewiseConstantHelper1 (const Array &t, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &constraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >())
 
 PiecewiseConstantHelper1 (const std::vector< Date > &dates, const Handle< YieldTermStructure > &yts, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &constraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >())
 
const Array & t () const
 
const QuantLib::ext::shared_ptr< Parameter > p () const
 
void update () const
 
Real y (const Time t) const
 
Real int_y_sqr (const Time t) const
 int_0^t y^2(s) ds More...
 
Real direct (const Real x) const
 
Real inverse (const Real y) const
 

Additional Inherited Members

- Protected Attributes inherited from Parametrization
const Real h_
 
const Real h2_
 
- Private Attributes inherited from PiecewiseConstantHelper1
const Array t_
 
const QuantLib::ext::shared_ptr< PseudoParametery_
 

Detailed Description

EQ Black Scholes constant parametrization.

EQ Black Scholes parametrization with piecewise constant volatility

Definition at line 36 of file eqbspiecewiseconstantparametrization.hpp.

Constructor & Destructor Documentation

◆ EqBsPiecewiseConstantParametrization() [1/2]

EqBsPiecewiseConstantParametrization ( const Currency &  currency,
const std::string &  eqName,
const Handle< Quote > &  eqSpotToday,
const Handle< Quote > &  fxSpotToday,
const Array &  times,
const Array &  sigma,
const Handle< YieldTermStructure > &  eqIrCurveToday,
const Handle< YieldTermStructure > &  eqDivYieldCurveToday 
)

The currency refers to the equity currency, the spots are as of today (i.e. the discounted spot)

Definition at line 23 of file eqbspiecewiseconstantparametrization.cpp.

27 : EqBsParametrization(currency, eqName, eqSpotToday, fxSpotToday, eqIrCurveToday, eqDivYieldCurveToday),
30}
const Handle< Quote > eqSpotToday() const
EqBsParametrization(const Currency &eqCcy, const std::string &eqName, const Handle< Quote > &equitySpotToday, const Handle< Quote > &fxSpotToday, const Handle< YieldTermStructure > &equityIrCurveToday, const Handle< YieldTermStructure > &equityDivYieldCurveToday)
const Handle< Quote > fxSpotToday() const
virtual const Currency & currency() const
PiecewiseConstantHelper1(const Array &t, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &constraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >())
+ Here is the call graph for this function:

◆ EqBsPiecewiseConstantParametrization() [2/2]

EqBsPiecewiseConstantParametrization ( const Currency &  currency,
const std::string &  eqName,
const Handle< Quote > &  eqSpotToday,
const Handle< Quote > &  fxSpotToday,
const std::vector< Date > &  dates,
const Array &  sigma,
const Handle< YieldTermStructure > &  domesticTermStructure,
const Handle< YieldTermStructure > &  eqIrCurveToday,
const Handle< YieldTermStructure > &  eqDivYieldCurveToday 
)

The term structure is needed in addition because it it's day counter and reference date is needed to convert dates to times. It should be the term structure of the domestic IR component in the cross asset model, since this is defining the model's date-time conversion in more general terms.

Definition at line 32 of file eqbspiecewiseconstantparametrization.cpp.

37 : EqBsParametrization(currency, eqName, eqSpotToday, fxSpotToday, eqIrCurveToday, eqDivYieldCurveToday),
38 PiecewiseConstantHelper1(dates, domesticTermStructure) {
40}
+ Here is the call graph for this function:

Member Function Documentation

◆ variance()

Real variance ( const Time  t) const
overridevirtual

must satisfy variance(0) = 0.0, variance'(t) >= 0

Implements EqBsParametrization.

Definition at line 81 of file eqbspiecewiseconstantparametrization.hpp.

81 {
83}
Real int_y_sqr(const Time t) const
int_0^t y^2(s) ds
+ Here is the call graph for this function:

◆ sigma()

Real sigma ( const Time  t) const
overridevirtual

is supposed to be positive

Reimplemented from EqBsParametrization.

Definition at line 85 of file eqbspiecewiseconstantparametrization.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parameterTimes()

const Array & parameterTimes ( const Size  Size) const
overridevirtual

the times associated to parameter i

Reimplemented from Parametrization.

Definition at line 87 of file eqbspiecewiseconstantparametrization.hpp.

87 {
88 QL_REQUIRE(i == 0, "parameter " << i << " does not exist, only have 0");
90}

◆ parameter()

const QuantLib::ext::shared_ptr< Parameter > parameter ( const Size  Size) const
overridevirtual

the parameter storing the raw parameter values

Reimplemented from Parametrization.

Definition at line 92 of file eqbspiecewiseconstantparametrization.hpp.

92 {
93 QL_REQUIRE(i == 0, "parameter " << i << " does not exist, only have 0");
95}
const QuantLib::ext::shared_ptr< PseudoParameter > y_

◆ update()

void update ( ) const
overridevirtual

this method should be called when input parameters linked via references or pointers change in order to ensure consistent results

Reimplemented from Parametrization.

Definition at line 97 of file eqbspiecewiseconstantparametrization.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ direct()

Real direct ( const Size  Size,
const Real  x 
) const
overrideprotectedvirtual

transformations between raw and actual parameters

Reimplemented from Parametrization.

Definition at line 73 of file eqbspiecewiseconstantparametrization.hpp.

+ Here is the call graph for this function:

◆ inverse()

Real inverse ( const Size  i,
const Real  y 
) const
overrideprotectedvirtual

Reimplemented from Parametrization.

Definition at line 77 of file eqbspiecewiseconstantparametrization.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

void initialize ( const Array &  sigma)
private

Definition at line 42 of file eqbspiecewiseconstantparametrization.cpp.

42 {
43 QL_REQUIRE(PiecewiseConstantHelper1::t().size() + 1 == sigma.size(),
44 "alpha size (" << sigma.size() << ") inconsistent to times size ("
45 << PiecewiseConstantHelper1::t().size() << ")");
46
47 // store raw parameter values
48 for (Size i = 0; i < PiecewiseConstantHelper1::y_->size(); ++i) {
49 PiecewiseConstantHelper1::y_->setParam(i, inverse(0, sigma[i]));
50 }
51 update();
52}
Real inverse(const Size i, const Real y) const override
+ Here is the call graph for this function:
+ Here is the caller graph for this function: