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

FX Black Scholes parametrization. More...

#include <qle/models/fxbsconstantparametrization.hpp>

+ Inheritance diagram for FxBsConstantParametrization:
+ Collaboration diagram for FxBsConstantParametrization:

Public Member Functions

 FxBsConstantParametrization (const Currency &currency, const Handle< Quote > &fxSpotToday, const Real sigma, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &sigmaConstraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >())
 
Real variance (const Time t) const override
 
Real sigma (const Time t) const override
 
const QuantLib::ext::shared_ptr< Parameter > parameter (const Size) const override
 
- Public Member Functions inherited from FxBsParametrization
 FxBsParametrization (const Currency &foreignCurrency, const Handle< Quote > &fxSpotToday)
 
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 > fxSpotToday () 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 Attributes

const QuantLib::ext::shared_ptr< PseudoParametersigma_
 

Additional Inherited Members

- Protected Attributes inherited from Parametrization
const Real h_
 
const Real h2_
 

Detailed Description

FX Black Scholes parametrization.

FX Black Scholes parametrization, with constant volatility

Definition at line 34 of file fxbsconstantparametrization.hpp.

Constructor & Destructor Documentation

◆ FxBsConstantParametrization()

FxBsConstantParametrization ( const Currency &  currency,
const Handle< Quote > &  fxSpotToday,
const Real  sigma,
const QuantLib::ext::shared_ptr< QuantLib::Constraint > &  sigmaConstraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>() 
)

The currency refers to the foreign currency, the spot is as of today (i.e. the discounted spot)

Definition at line 24 of file fxbsconstantparametrization.cpp.

28 sigma_(QuantLib::ext::make_shared<PseudoParameter>(1, *sigmaConstraint)) {
29 sigma_->setParam(0, inverse(0, sigma));
30}
Real inverse(const Size i, const Real y) const override
const QuantLib::ext::shared_ptr< PseudoParameter > sigma_
FxBsParametrization(const Currency &foreignCurrency, const Handle< Quote > &fxSpotToday)
const Handle< Quote > fxSpotToday() const
virtual const Currency & currency() const
+ 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 FxBsParametrization.

Definition at line 59 of file fxbsconstantparametrization.hpp.

59 {
60 return direct(0, sigma_->params()[0]) * direct(0, sigma_->params()[0]) * t;
61}
Real direct(const Size i, const Real x) const override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigma()

Real sigma ( const Time  t) const
overridevirtual

is supposed to be positive

Reimplemented from FxBsParametrization.

Definition at line 63 of file fxbsconstantparametrization.hpp.

63{ return direct(0, sigma_->params()[0]); }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 65 of file fxbsconstantparametrization.hpp.

65 {
66 QL_REQUIRE(i == 0, "parameter " << i << " does not exist, only have 0");
67 return sigma_;
68}

◆ direct()

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

transformations between raw and actual parameters

Reimplemented from Parametrization.

Definition at line 55 of file fxbsconstantparametrization.hpp.

55{ return x * x; }
+ Here is the caller graph for this function:

◆ inverse()

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

Reimplemented from Parametrization.

Definition at line 57 of file fxbsconstantparametrization.hpp.

57{ return std::sqrt(y); }
+ Here is the caller graph for this function:

Member Data Documentation

◆ sigma_

const QuantLib::ext::shared_ptr<PseudoParameter> sigma_
private

Definition at line 50 of file fxbsconstantparametrization.hpp.