Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | List of all members
ZeroInflationTraits Class Reference

Bootstrap traits to use for PiecewiseZeroInflationCurve. More...

#include <qle/termstructures/inflation/inflationtraits.hpp>

+ Collaboration diagram for ZeroInflationTraits:

Classes

class  BootstrapFirstDateInitializer
 

Public Types

typedef QuantLib::BootstrapHelper< QuantLib::ZeroInflationTermStructure > helper
 

Static Public Member Functions

static QuantLib::Date initialDate (const BootstrapFirstDateInitializer *t)
 
static QuantLib::Rate initialValue (const QuantLib::ZeroInflationTermStructure *t)
 
template<class C >
static QuantLib::Rate guess (QuantLib::Size i, const C *c, bool validData, QuantLib::Size)
 
template<class C >
static QuantLib::Rate minValueAfter (QuantLib::Size i, const C *c, bool validData, QuantLib::Size)
 
template<class C >
static QuantLib::Rate maxValueAfter (QuantLib::Size i, const C *c, bool validData, QuantLib::Size)
 
static void updateGuess (std::vector< QuantLib::Rate > &data, QuantLib::Rate level, QuantLib::Size i)
 
static QuantLib::Size maxIterations ()
 

Detailed Description

Bootstrap traits to use for PiecewiseZeroInflationCurve.

Definition at line 37 of file inflationtraits.hpp.

Member Typedef Documentation

◆ helper

typedef QuantLib::BootstrapHelper<QuantLib::ZeroInflationTermStructure> helper

Definition at line 45 of file inflationtraits.hpp.

Member Function Documentation

◆ initialDate()

static QuantLib::Date initialDate ( const BootstrapFirstDateInitializer t)
static

Definition at line 48 of file inflationtraits.hpp.

48{ return t->initialDate(); }
+ Here is the call graph for this function:

◆ initialValue()

static QuantLib::Rate initialValue ( const QuantLib::ZeroInflationTermStructure *  t)
static

Definition at line 50 of file inflationtraits.hpp.

50{ return t->baseRate(); }

◆ guess()

static QuantLib::Rate guess ( QuantLib::Size  i,
const C *  c,
bool  validData,
QuantLib::Size   
)
static

Definition at line 54 of file inflationtraits.hpp.

56 {
57 if (validData) // previous iteration value
58 return c->data()[i];
59
60 if (i == 1) // first pillar
62
63 // could/should extrapolate
65 }
const QuantLib::Rate avgInflation

◆ minValueAfter()

static QuantLib::Rate minValueAfter ( QuantLib::Size  i,
const C *  c,
bool  validData,
QuantLib::Size   
)
static

Definition at line 69 of file inflationtraits.hpp.

71 {
72 if (validData) {
73 QuantLib::Rate r = *(std::min_element(c->data().begin(), c->data().end()));
74 return r < 0.0 ? r * 2.0 : r / 2.0;
75 }
77 }
const QuantLib::Rate maxInflation

◆ maxValueAfter()

static QuantLib::Rate maxValueAfter ( QuantLib::Size  i,
const C *  c,
bool  validData,
QuantLib::Size   
)
static

Definition at line 79 of file inflationtraits.hpp.

81 {
82 if (validData) {
83 QuantLib::Rate r = *(std::max_element(c->data().begin(), c->data().end()));
84 return r < 0.0 ? r / 2.0 : r * 2.0;
85 }
86 // no constraints.
87 // We choose as max a value very unlikely to be exceeded.
89 }

◆ updateGuess()

static void updateGuess ( std::vector< QuantLib::Rate > &  data,
QuantLib::Rate  level,
QuantLib::Size  i 
)
static

Definition at line 92 of file inflationtraits.hpp.

92 {
93 data[i] = level;
94 }

◆ maxIterations()

static QuantLib::Size maxIterations ( )
static

Definition at line 97 of file inflationtraits.hpp.

97{ return 5; }