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
IterativeBootstrap< Curve > Class Template Reference

Universal piecewise-term-structure boostrapper. More...

#include <iterativebootstrap.hpp>

+ Inheritance diagram for IterativeBootstrap< Curve >:
+ Collaboration diagram for IterativeBootstrap< Curve >:

Public Member Functions

 IterativeBootstrap (Real accuracy=Null< Real >(), Real minValue=Null< Real >(), Real maxValue=Null< Real >(), Size maxAttempts=1, Real maxFactor=2.0, Real minFactor=2.0, bool dontThrow=false, Size dontThrowSteps=10, Size maxEvaluations=MAX_FUNCTION_EVALUATIONS)
 
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

Real accuracy_
 
Real minValue_
 
Real maxValue_
 
Size maxAttempts_
 
Real maxFactor_
 
Real minFactor_
 
bool dontThrow_
 
Size dontThrowSteps_
 
Curve * ts_
 
Size n_ = 0
 
Brent firstSolver_
 
FiniteDifferenceNewtonSafe solver_
 
bool initialized_ = false
 
bool validCurve_ = false
 
bool loopRequired_
 
Size firstAliveHelper_ = 0
 
Size alive_ = 0
 
std::vector< RealpreviousData_
 
std::vector< ext::shared_ptr< BootstrapError< Curve > > > errors_
 

Detailed Description

template<class Curve>
class QuantLib::IterativeBootstrap< Curve >

Universal piecewise-term-structure boostrapper.

Definition at line 78 of file iterativebootstrap.hpp.

Member Typedef Documentation

◆ Traits

typedef Curve::traits_type Traits
private

Definition at line 79 of file iterativebootstrap.hpp.

◆ Interpolator

typedef Curve::interpolator_type Interpolator
private

Definition at line 80 of file iterativebootstrap.hpp.

Constructor & Destructor Documentation

◆ IterativeBootstrap()

IterativeBootstrap ( Real  accuracy = Null<Real>(),
Real  minValue = Null<Real>(),
Real  maxValue = Null<Real>(),
Size  maxAttempts = 1,
Real  maxFactor = 2.0,
Real  minFactor = 2.0,
bool  dontThrow = false,
Size  dontThrowSteps = 10,
Size  maxEvaluations = MAX_FUNCTION_EVALUATIONS 
)

Constructor

Parameters
accuracyAccuracy for the bootstrap stopping criterion. If it is set to Null<Real>(), its value is taken from the termstructure's accuracy.
minValueAllow to override the initial minimum value coming from traits.
maxValueAllow to override the initial maximum value coming from traits.
maxAttemptsNumber of attempts on each iteration. A number greater than 1 implies retries.
maxFactorFactor for max value retry on each iteration if there is a failure.
minFactorFactor for min value retry on each iteration if there is a failure.
dontThrowIf set to true, the bootstrap doesn't throw and returns a fall back result.
dontThrowStepsIf dontThrow is true, this gives the number of steps to use when searching for a fallback curve pillar value that gives the minimum bootstrap helper error.

Definition at line 129 of file iterativebootstrap.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ setup()

void setup ( Curve *  ts)

Definition at line 148 of file iterativebootstrap.hpp.

◆ calculate()

void calculate

Definition at line 233 of file iterativebootstrap.hpp.

+ Here is the call graph for this function:

◆ initialize()

void initialize
private

Definition at line 160 of file iterativebootstrap.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ accuracy_

Real accuracy_
private

Definition at line 108 of file iterativebootstrap.hpp.

◆ minValue_

Real minValue_
private

Definition at line 109 of file iterativebootstrap.hpp.

◆ maxValue_

Real maxValue_
private

Definition at line 109 of file iterativebootstrap.hpp.

◆ maxAttempts_

Size maxAttempts_
private

Definition at line 110 of file iterativebootstrap.hpp.

◆ maxFactor_

Real maxFactor_
private

Definition at line 111 of file iterativebootstrap.hpp.

◆ minFactor_

Real minFactor_
private

Definition at line 112 of file iterativebootstrap.hpp.

◆ dontThrow_

bool dontThrow_
private

Definition at line 113 of file iterativebootstrap.hpp.

◆ dontThrowSteps_

Size dontThrowSteps_
private

Definition at line 114 of file iterativebootstrap.hpp.

◆ ts_

Curve* ts_
private

Definition at line 115 of file iterativebootstrap.hpp.

◆ n_

Size n_ = 0
private

Definition at line 116 of file iterativebootstrap.hpp.

◆ firstSolver_

Brent firstSolver_
private

Definition at line 117 of file iterativebootstrap.hpp.

◆ solver_

FiniteDifferenceNewtonSafe solver_
private

Definition at line 118 of file iterativebootstrap.hpp.

◆ initialized_

bool initialized_ = false
mutableprivate

Definition at line 119 of file iterativebootstrap.hpp.

◆ validCurve_

bool validCurve_ = false
private

Definition at line 119 of file iterativebootstrap.hpp.

◆ loopRequired_

bool loopRequired_
private

Definition at line 119 of file iterativebootstrap.hpp.

◆ firstAliveHelper_

Size firstAliveHelper_ = 0
mutableprivate

Definition at line 120 of file iterativebootstrap.hpp.

◆ alive_

Size alive_ = 0
private

Definition at line 120 of file iterativebootstrap.hpp.

◆ previousData_

std::vector<Real> previousData_
mutableprivate

Definition at line 121 of file iterativebootstrap.hpp.

◆ errors_

std::vector<ext::shared_ptr<BootstrapError<Curve> > > errors_
mutableprivate

Definition at line 122 of file iterativebootstrap.hpp.