#include <qle/models/parametrization.hpp>
Public Member Functions | |
Parametrization (const Currency ¤cy, 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 | |
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_ |
Private Attributes | |
Currency | currency_ |
std::string | name_ |
const Array | emptyTimes_ |
const QuantLib::ext::shared_ptr< Parameter > | emptyParameter_ |
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 ).
Definition at line 57 of file parametrization.hpp.
Parametrization | ( | const Currency & | currency, |
const std::string & | name = "" |
||
) |
Definition at line 23 of file parametrization.cpp.
|
virtual |
Definition at line 60 of file parametrization.hpp.
|
virtual |
|
virtual |
the times associated to parameter i
Reimplemented in EqBsPiecewiseConstantParametrization, FxBsPiecewiseConstantParametrization, Lgm1fPiecewiseConstantHullWhiteAdaptor< TS >, Lgm1fPiecewiseConstantParametrization< TS >, and Lgm1fPiecewiseLinearParametrization< TS >.
Definition at line 126 of file parametrization.hpp.
|
virtual |
the number of parameters in this parametrization
Reimplemented in CirppParametrization< TS >, CommoditySchwartzParametrization, EqBsParametrization, FxBsParametrization, HwParametrization< TS >, InfJyParameterization, and Lgm1fParametrization< TS >.
Definition at line 69 of file parametrization.hpp.
|
virtual |
the actual parameter values
Definition at line 130 of file parametrization.hpp.
|
virtual |
the parameter storing the raw parameter values
Reimplemented in CirppConstantParametrization< TS >, CirppConstantWithFellerParametrization< TS >, CommoditySchwartzParametrization, EqBsConstantParametrization, EqBsPiecewiseConstantParametrization, FxBsConstantParametrization, FxBsPiecewiseConstantParametrization, Lgm1fConstantParametrization< TS >, Lgm1fPiecewiseConstantHullWhiteAdaptor< TS >, Lgm1fPiecewiseConstantParametrization< TS >, and Lgm1fPiecewiseLinearParametrization< TS >.
Definition at line 128 of file parametrization.hpp.
|
virtual |
this method should be called when input parameters linked via references or pointers change in order to ensure consistent results
Reimplemented in EqBsPiecewiseConstantParametrization, FxBsPiecewiseConstantParametrization, HwParametrization< TS >, InfJyParameterization, Lgm1fParametrization< TS >, Lgm1fPiecewiseConstantHullWhiteAdaptor< TS >, Lgm1fPiecewiseConstantParametrization< TS >, and Lgm1fPiecewiseLinearParametrization< TS >.
Definition at line 108 of file parametrization.hpp.
const std::string & name | ( | ) | const |
return a name (inflation index, equity name, credit name, etc.)
Definition at line 83 of file parametrization.hpp.
|
virtual |
transformations between raw and actual parameters
Reimplemented in CirppConstantParametrization< TS >, CirppConstantWithFellerParametrization< TS >, CommoditySchwartzParametrization, EqBsConstantParametrization, EqBsPiecewiseConstantParametrization, FxBsConstantParametrization, FxBsPiecewiseConstantParametrization, Lgm1fConstantParametrization< TS >, Lgm1fPiecewiseConstantHullWhiteAdaptor< TS >, Lgm1fPiecewiseConstantParametrization< TS >, and Lgm1fPiecewiseLinearParametrization< TS >.
Definition at line 120 of file parametrization.hpp.
|
virtual |
Reimplemented in CommoditySchwartzParametrization, EqBsConstantParametrization, EqBsPiecewiseConstantParametrization, FxBsConstantParametrization, FxBsPiecewiseConstantParametrization, CirppConstantParametrization< TS >, CirppConstantWithFellerParametrization< TS >, Lgm1fConstantParametrization< TS >, Lgm1fPiecewiseConstantHullWhiteAdaptor< TS >, Lgm1fPiecewiseConstantParametrization< TS >, and Lgm1fPiecewiseLinearParametrization< TS >.
Definition at line 122 of file parametrization.hpp.
|
protected |
adjusted central difference scheme
Definition at line 110 of file parametrization.hpp.
|
protected |
|
protected |
Definition at line 114 of file parametrization.hpp.
|
protected |
Definition at line 116 of file parametrization.hpp.
|
protected |
Definition at line 118 of file parametrization.hpp.
|
protected |
step size for numerical differentiation
Definition at line 91 of file parametrization.hpp.
|
protected |
Definition at line 91 of file parametrization.hpp.
|
private |
Definition at line 100 of file parametrization.hpp.
|
private |
Definition at line 101 of file parametrization.hpp.
|
private |
Definition at line 102 of file parametrization.hpp.
|
private |
Definition at line 103 of file parametrization.hpp.