27#ifndef quantlib_gaussian1dmodel_hpp
28#define quantlib_gaussian1dmodel_hpp
42#ifdef GAUSS1D_ENABLE_NTL
43#include <boost/math/bindings/rr.hpp>
46#if BOOST_VERSION < 106700
47#include <boost/functional/hash.hpp>
49#include <boost/container_hash/hash.hpp>
52#include <unordered_map>
74 ext::shared_ptr<StochasticProcess1D>
stateProcess()
const;
96 const Date& valueDate,
103 Size yGridPoints = 64,
104 bool extrapolatePayoff =
true,
105 bool flatPayoffExtrapolation =
false)
const;
111 const ext::shared_ptr<IborIndex>& iborIdx = ext::shared_ptr<IborIndex>())
const;
117 const ext::shared_ptr<SwapIndex>& swapIdx = ext::shared_ptr<SwapIndex>())
const;
124 const ext::shared_ptr<SwapIndex>& swapIdx = ext::shared_ptr<SwapIndex>())
const;
157 const ext::shared_ptr<SwapIndex>
index;
168 std::size_t seed = 0;
169 boost::hash_combine(seed, x.
index->name());
204 ext::shared_ptr<VanillaSwap>
206 const Date &expiry,
const Period &tenor)
const {
211 ext::shared_ptr<VanillaSwap> underlying =
212 index->clone(tenor)->underlyingSwap(expiry);
213 swapCache_.insert(std::make_pair(k, underlying));
1-D array used in linear algebra.
Date::serial_type serialNumber() const
void performCalculations() const override
static Real gaussianPolynomialIntegral(Real a, Real b, Real c, Real d, Real e, Real x0, Real x1)
static Real gaussianShiftedPolynomialIntegral(Real a, Real b, Real c, Real d, Real e, Real h, Real x0, Real x1)
ext::shared_ptr< VanillaSwap > underlyingSwap(const ext::shared_ptr< SwapIndex > &index, const Date &expiry, const Period &tenor) const
virtual Real zerobondImpl(Time T, Time t, Real y, const Handle< YieldTermStructure > &yts) const =0
Real numeraire(Time t, Real y=0.0, const Handle< YieldTermStructure > &yts=Handle< YieldTermStructure >()) const
virtual Real numeraireImpl(Time t, Real y, const Handle< YieldTermStructure > &yts) const =0
Real swapRate(const Date &fixing, const Period &tenor, const Date &referenceDate=Null< Date >(), Real y=0.0, const ext::shared_ptr< SwapIndex > &swapIdx=ext::shared_ptr< SwapIndex >()) const
Array yGrid(Real yStdDevs, int gridPoints, Real T=1.0, Real t=0, Real y=0) const
std::unordered_map< CachedSwapKey, ext::shared_ptr< VanillaSwap >, CachedSwapKeyHasher > swapCache_
Real forwardRate(const Date &fixing, const Date &referenceDate=Null< Date >(), Real y=0.0, const ext::shared_ptr< IborIndex > &iborIdx=ext::shared_ptr< IborIndex >()) const
bool enforcesTodaysHistoricFixings_
Real zerobond(Time T, Time t=0.0, Real y=0.0, const Handle< YieldTermStructure > &yts=Handle< YieldTermStructure >()) const
ext::shared_ptr< StochasticProcess1D > stateProcess() const
Real zerobondOption(const Option::Type &type, const Date &expiry, const Date &valueDate, const Date &maturity, Rate strike, const Date &referenceDate=Null< Date >(), Real y=0.0, const Handle< YieldTermStructure > &yts=Handle< YieldTermStructure >(), Real yStdDevs=7.0, Size yGridPoints=64, bool extrapolatePayoff=true, bool flatPayoffExtrapolation=false) const
Real swapAnnuity(const Date &fixing, const Period &tenor, const Date &referenceDate=Null< Date >(), Real y=0.0, const ext::shared_ptr< SwapIndex > &swapIdx=ext::shared_ptr< SwapIndex >()) const
Gaussian1dModel(const Handle< YieldTermStructure > &yieldTermStructure)
ext::shared_ptr< StochasticProcess1D > stateProcess_
Shared handle to an observable.
Framework for calculation on demand and result caching.
virtual void calculate() const
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
DateProxy & evaluationDate()
the date at which pricing is to be performed.
bool & enforcesTodaysHistoricFixings()
static Settings & instance()
access to the unique instance
Term-structure consistent model class.
const Handle< YieldTermStructure > & termStructure() const
date- and time-related classes, typedefs and enumerations
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
base class for Inter-Bank-Offered-Rate indexes
framework for calculation on demand and result caching
Abstract interest rate model class.
period- and frequency-related classes and enumerations
std::size_t operator()(CachedSwapKey const &x) const
const ext::shared_ptr< SwapIndex > index
bool operator==(const CachedSwapKey &o) const
Simple fixed-rate vs Libor swap.
Interest-rate term structure.