QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Two-dimensional tree-based lattice. More...
#include <lattice2d.hpp>
Public Member Functions | |
TreeLattice2D (const ext::shared_ptr< T > &tree1, ext::shared_ptr< T > tree2, Real correlation) | |
Size | size (Size i) const |
Size | descendant (Size i, Size index, Size branch) const |
Real | probability (Size i, Size index, Size branch) 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 Array & | statePrices (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 TimeGrid & | timeGrid () const |
Protected Member Functions | |
Array | grid (Time) const override |
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 | |
ext::shared_ptr< T > | tree1_ |
ext::shared_ptr< T > | tree2_ |
Protected Attributes inherited from TreeLattice< Impl > | |
std::vector< Array > | statePrices_ |
Protected Attributes inherited from Lattice | |
TimeGrid | t_ |
Private Attributes | |
Matrix | m_ |
Real | rho_ |
Two-dimensional tree-based lattice.
This lattice is based on two trinomial trees and primarily used for the G2 short-rate model.
Definition at line 42 of file lattice2d.hpp.
TreeLattice2D | ( | const ext::shared_ptr< T > & | tree1, |
ext::shared_ptr< T > | tree2, | ||
Real | correlation | ||
) |
Definition at line 71 of file lattice2d.hpp.
Definition at line 63 of file lattice2d.hpp.
Definition at line 103 of file lattice2d.hpp.
Definition at line 118 of file lattice2d.hpp.
Implements Lattice.
Definition at line 52 of file lattice2d.hpp.
|
protected |
Definition at line 50 of file lattice2d.hpp.
|
protected |
Definition at line 50 of file lattice2d.hpp.
|
private |
Definition at line 55 of file lattice2d.hpp.
|
private |
Definition at line 56 of file lattice2d.hpp.