QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
GlobalBootstrap< Curve > Class Template Reference

Global boostrapper, with additional restrictions. More...

#include <globalbootstrap.hpp>

+ Collaboration diagram for GlobalBootstrap< Curve >:

Public Member Functions

 GlobalBootstrap (Real accuracy=Null< Real >())
 
 GlobalBootstrap (std::vector< ext::shared_ptr< typename Traits::helper > > additionalHelpers, ext::function< std::vector< Date >()> additionalDates, ext::function< Array()> additionalErrors, Real accuracy=Null< Real >())
 
void setup (Curve *ts)
 
void calculate () const
 

Private Types

typedef Curve::traits_type Traits
 
typedef Curve::interpolator_type Interpolator
 

Private Member Functions

void initialize () const
 

Private Attributes

Curve * ts_
 
Real accuracy_
 
std::vector< ext::shared_ptr< typename Traits::helper > > additionalHelpers_
 
ext::function< std::vector< Date >()> additionalDates_
 
ext::function< Array()> additionalErrors_
 
bool initialized_ = false
 
bool validCurve_ = false
 
Size firstHelper_
 
Size numberHelpers_
 
Size firstAdditionalHelper_
 
Size numberAdditionalHelpers_
 

Detailed Description

template<class Curve>
class QuantLib::GlobalBootstrap< Curve >

Global boostrapper, with additional restrictions.

Definition at line 39 of file globalbootstrap.hpp.

Member Typedef Documentation

◆ Traits

typedef Curve::traits_type Traits
private

Definition at line 40 of file globalbootstrap.hpp.

◆ Interpolator

typedef Curve::interpolator_type Interpolator
private

Definition at line 41 of file globalbootstrap.hpp.

Constructor & Destructor Documentation

◆ GlobalBootstrap() [1/2]

GlobalBootstrap ( Real  accuracy = Null<Real>())

Definition at line 83 of file globalbootstrap.hpp.

◆ GlobalBootstrap() [2/2]

GlobalBootstrap ( std::vector< ext::shared_ptr< typename Traits::helper > >  additionalHelpers,
ext::function< std::vector< Date >()>  additionalDates,
ext::function< Array()>  additionalErrors,
Real  accuracy = Null<Real>() 
)

The set of (alive) additional dates is added to the interpolation grid. The set of additional dates must only depend on the current global evaluation date. The additionalErrors functor must yield at least as many values such that

number of (usual, alive) rate helpers + number of (alive) additional values >= number of data points - 1

(note that the data points contain t=0). These values are treated as additional error terms in the optimization, the usual rate helpers return marketQuote - impliedQuote here. All error terms are equally weighted in the optimisation.

The additional helpers are treated like the usual rate helpers, but no standard pillar dates are added for them.

WARNING: This class is known to work with Traits Discount, ZeroYield, Forward (i.e. the usual traits for IR curves in QL), it might fail for other traits - check the usage of Traits::updateGuess(), Traits::guess(), Traits::minValueAfter(), Traits::maxValueAfter() in this class against them.

Definition at line 86 of file globalbootstrap.hpp.

Member Function Documentation

◆ setup()

void setup ( Curve *  ts)

Definition at line 94 of file globalbootstrap.hpp.

◆ calculate()

void calculate

Definition at line 184 of file globalbootstrap.hpp.

+ Here is the call graph for this function:

◆ initialize()

void initialize
private

Definition at line 105 of file globalbootstrap.hpp.

Member Data Documentation

◆ ts_

Curve* ts_
private

Definition at line 70 of file globalbootstrap.hpp.

◆ accuracy_

Real accuracy_
private

Definition at line 71 of file globalbootstrap.hpp.

◆ additionalHelpers_

std::vector<ext::shared_ptr<typename Traits::helper> > additionalHelpers_
mutableprivate

Definition at line 72 of file globalbootstrap.hpp.

◆ additionalDates_

ext::function<std::vector<Date>()> additionalDates_
private

Definition at line 73 of file globalbootstrap.hpp.

◆ additionalErrors_

ext::function<Array()> additionalErrors_
private

Definition at line 74 of file globalbootstrap.hpp.

◆ initialized_

bool initialized_ = false
mutableprivate

Definition at line 75 of file globalbootstrap.hpp.

◆ validCurve_

bool validCurve_ = false
private

Definition at line 75 of file globalbootstrap.hpp.

◆ firstHelper_

Size firstHelper_
mutableprivate

Definition at line 76 of file globalbootstrap.hpp.

◆ numberHelpers_

Size numberHelpers_
private

Definition at line 76 of file globalbootstrap.hpp.

◆ firstAdditionalHelper_

Size firstAdditionalHelper_
mutableprivate

Definition at line 77 of file globalbootstrap.hpp.

◆ numberAdditionalHelpers_

Size numberAdditionalHelpers_
private

Definition at line 77 of file globalbootstrap.hpp.