28 class OneFactorModel::ShortRateTree::Helper {
31 Real discountBondPrice,
32 ext::shared_ptr<TermStructureFittingParameter::NumericalImpl>
theta,
43 value -= statePrices_[j]*tree_.discount(i_,j);
50 const Array& statePrices_;
51 Real discountBondPrice_;
52 ext::shared_ptr<TermStructureFittingParameter::NumericalImpl>
theta_;
57 const ext::shared_ptr<TrinomialTree>& tree,
58 ext::shared_ptr<ShortRateDynamics> dynamics,
59 const ext::shared_ptr<TermStructureFittingParameter::NumericalImpl>&
theta,
62 dynamics_(
std::move(dynamics)), spread_(0.0) {
69 Real discountBond =
theta->termStructure()->discount(
t_[i+1]);
70 Helper finder(i, discountBond,
theta, *
this);
81 ext::shared_ptr<ShortRateDynamics>
dynamics,
89 ext::shared_ptr<Lattice>
91 ext::shared_ptr<TrinomialTree> trinomial(
93 return ext::shared_ptr<Lattice>(
Real value(const Array ¶ms, const std::vector< ext::shared_ptr< CalibrationHelper > > &)
const TimeGrid & timeGrid() const
Real discountBond(Time now, Time maturity, Array factors) const override
DiscountFactor discount(Time t) const override
Implied discount curve.
Recombining trinomial tree discretizing the state variable.
ShortRateTree(const ext::shared_ptr< TrinomialTree > &tree, ext::shared_ptr< ShortRateDynamics > dynamics, const TimeGrid &timeGrid)
Plain tree build-up from short-rate dynamics.
Single-factor short-rate model abstract class.
OneFactorModel(Size nArguments)
ext::shared_ptr< Lattice > tree(const TimeGrid &grid) const override
Return by default a trinomial recombining tree.
virtual ext::shared_ptr< ShortRateDynamics > dynamics() const =0
returns the short-rate dynamics
Abstract short-rate model class.
void setMaxEvaluations(Size evaluations)
Real solve(const F &f, Real accuracy, Real guess, Real step) const
One-dimensional tree-based lattice.
const Array & statePrices(Size i) const
Recombining trinomial tree class.
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
std::size_t Size
size of a container
Abstract one-factor interest rate model class.