QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OneFactorModel::ShortRateTree Class Reference

Recombining trinomial tree discretizing the state variable. More...

#include <ql/models/shortrate/onefactormodel.hpp>

+ Inheritance diagram for OneFactorModel::ShortRateTree:
+ Collaboration diagram for OneFactorModel::ShortRateTree:

Public Member Functions

 ShortRateTree (const ext::shared_ptr< TrinomialTree > &tree, ext::shared_ptr< ShortRateDynamics > dynamics, const TimeGrid &timeGrid)
 Plain tree build-up from short-rate dynamics. More...
 
 ShortRateTree (const ext::shared_ptr< TrinomialTree > &tree, ext::shared_ptr< ShortRateDynamics > dynamics, const ext::shared_ptr< TermStructureFittingParameter::NumericalImpl > &phi, const TimeGrid &timeGrid)
 Tree build-up + numerical fitting to term-structure. More...
 
Size size (Size i) const
 
DiscountFactor discount (Size i, Size index) const
 
Real underlying (Size i, Size index) const
 
Size descendant (Size i, Size index, Size branch) const
 
Real probability (Size i, Size index, Size branch) const
 
void setSpread (Spread spread)
 
- Public Member Functions inherited from TreeLattice1D< OneFactorModel::ShortRateTree >
 TreeLattice1D (const TimeGrid &timeGrid, Size n)
 
Array grid (Time t) const override
 
Real underlying (Size i, Size index) const
 
- Public Member Functions inherited from TreeLattice< Impl >
 TreeLattice (const TimeGrid &timeGrid, Size n)
 
void initialize (DiscretizedAsset &, Time t) const override
 initialize an asset at the given time. More...
 
void rollback (DiscretizedAsset &, Time to) const override
 
void partialRollback (DiscretizedAsset &, Time to) const override
 
Real presentValue (DiscretizedAsset &) const override
 Computes the present value of an asset using Arrow-Debrew prices. More...
 
const ArraystatePrices (Size i) const
 
void stepback (Size i, const Array &values, Array &newValues) const
 
- Public Member Functions inherited from Lattice
 Lattice (TimeGrid timeGrid)
 
virtual ~Lattice ()=default
 
const TimeGridtimeGrid () const
 

Private Attributes

ext::shared_ptr< TrinomialTreetree_
 
ext::shared_ptr< ShortRateDynamicsdynamics_
 
Spread spread_
 

Additional Inherited Members

- Protected Member Functions inherited from TreeLattice< Impl >
void computeStatePrices (Size until) const
 
- Protected Member Functions inherited from CuriouslyRecurringTemplate< Impl >
 CuriouslyRecurringTemplate ()=default
 
 ~CuriouslyRecurringTemplate ()=default
 
Impl & impl ()
 
const Impl & impl () const
 
- Protected Attributes inherited from TreeLattice< Impl >
std::vector< ArraystatePrices_
 
- Protected Attributes inherited from Lattice
TimeGrid t_
 

Detailed Description

Recombining trinomial tree discretizing the state variable.

Definition at line 75 of file onefactormodel.hpp.

Constructor & Destructor Documentation

◆ ShortRateTree() [1/2]

ShortRateTree ( const ext::shared_ptr< TrinomialTree > &  tree,
ext::shared_ptr< ShortRateDynamics dynamics,
const TimeGrid timeGrid 
)

Plain tree build-up from short-rate dynamics.

Definition at line 80 of file onefactormodel.cpp.

◆ ShortRateTree() [2/2]

ShortRateTree ( const ext::shared_ptr< TrinomialTree > &  tree,
ext::shared_ptr< ShortRateDynamics dynamics,
const ext::shared_ptr< TermStructureFittingParameter::NumericalImpl > &  phi,
const TimeGrid timeGrid 
)

Tree build-up + numerical fitting to term-structure.

Definition at line 56 of file onefactormodel.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ size()

Size size ( Size  i) const

Definition at line 88 of file onefactormodel.hpp.

◆ discount()

DiscountFactor discount ( Size  i,
Size  index 
) const

Definition at line 91 of file onefactormodel.hpp.

+ Here is the call graph for this function:

◆ underlying()

Real underlying ( Size  i,
Size  index 
) const

Definition at line 96 of file onefactormodel.hpp.

◆ descendant()

Size descendant ( Size  i,
Size  index,
Size  branch 
) const

Definition at line 99 of file onefactormodel.hpp.

◆ probability()

Real probability ( Size  i,
Size  index,
Size  branch 
) const

Definition at line 102 of file onefactormodel.hpp.

◆ setSpread()

void setSpread ( Spread  spread)

Definition at line 105 of file onefactormodel.hpp.

Member Data Documentation

◆ tree_

ext::shared_ptr<TrinomialTree> tree_
private

Definition at line 110 of file onefactormodel.hpp.

◆ dynamics_

ext::shared_ptr<ShortRateDynamics> dynamics_
private

Definition at line 111 of file onefactormodel.hpp.

◆ spread_

Spread spread_
private

Definition at line 113 of file onefactormodel.hpp.