Logo
Reference manual - version qle_version
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Parametrization Class Reference

Parametrization. More...

#include <qle/models/parametrization.hpp>

+ Inheritance diagram for Parametrization:

Public Member Functions

 Parametrization (const Currency &currency, const std::string &name="")
 
virtual const Currency & currency () const
 
virtual const Array & parameterTimes (const Size) const
 
virtual Size numberOfParameters () const
 
virtual Array parameterValues (const Size) const
 
virtual const boost::shared_ptr< Parameterparameter (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

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
 

Protected Attributes

const Real h_
 
const Real h2_
 

Detailed Description

Parametrization.

Base class for classes representing model parameters. There is a disctinction between "actual" and "raw" parameters. The "actual" parameter value is the true value of the parameter, e.g. 0.20 to represent a black scholes volatility of 20%. The "raw" parameter is derived from the actual parameter by applying a transformation

actual value = direct( raw value ) raw value = inverse( actual value )

The idea behind that is that the optimization during a model calibration can be performed as an unconstrained optimization which usually works more stable and is faster than a constrained optimization. For example, to ensure a positive black volatility one can use the transformation

direct ( x ) = x * x

To ensure a valid correlation one can use the transformation

direct ( x ) = (atan( x ) + pi / 2) / pi

and so forth. To implement you own transformation you can overwrite the direct() and inverse() methods. The default implementation of these methods represents the trivial transformation (identity, i.e. direct( x ) = x ).

Member Function Documentation

◆ currency()

const Currency & currency ( ) const
virtual

the currency associated to this parametrization

◆ parameterTimes()

const Array & parameterTimes ( const  Size) const
virtual

◆ numberOfParameters()

virtual Size numberOfParameters ( ) const
virtual

◆ parameterValues()

Array parameterValues ( const Size  i) const
virtual

the actual parameter values

◆ parameter()

const boost::shared_ptr< Parameter > parameter ( const  Size) const
virtual

◆ update()

void update ( ) const
virtual

◆ name()

const std::string& name ( ) const

return a name (inflation index, equity name, credit name, etc.)

◆ direct()

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

◆ tr()

Time tr ( const Time  t) const
protected

adjusted central difference scheme

Member Data Documentation

◆ h_

const Real h_
protected

step size for numerical differentiation