29 ext::shared_ptr<Lattice>
31 ext::shared_ptr<ShortRateDynamics> dyn =
dynamics();
33 ext::shared_ptr<TrinomialTree> tree1(
35 ext::shared_ptr<TrinomialTree> tree2(
38 return ext::shared_ptr<Lattice>(
43 const ext::shared_ptr<TrinomialTree>& tree1,
44 const ext::shared_ptr<TrinomialTree>& tree2,
45 const ext::shared_ptr<ShortRateDynamics>& dynamics)
47 tree1, tree2, dynamics->correlation()),
48 dynamics_(dynamics) {}
50 ext::shared_ptr<StochasticProcess>
53 correlation[0][0] = correlation[1][1] = 1.0;
55 std::vector<ext::shared_ptr<StochasticProcess1D> > processes(2);
56 processes[0] = xProcess_;
57 processes[1] = yProcess_;
58 return ext::shared_ptr<StochasticProcess>(
Matrix used in linear algebra.
Abstract short-rate model class.
Array of correlated 1-D stochastic processes
Two-dimensional tree-based lattice.
Recombining trinomial tree class.
ext::shared_ptr< StochasticProcess > process() const
Joint process of the two variables.
Recombining two-dimensional tree discretizing the state variable.
ShortRateTree(const ext::shared_ptr< TrinomialTree > &tree1, const ext::shared_ptr< TrinomialTree > &tree2, const ext::shared_ptr< ShortRateDynamics > &dynamics)
Plain tree build-up from short-rate dynamics.
Abstract base-class for two-factor models.
ext::shared_ptr< Lattice > tree(const TimeGrid &grid) const override
Returns a two-dimensional trinomial tree.
TwoFactorModel(Size nParams)
virtual ext::shared_ptr< ShortRateDynamics > dynamics() const =0
Returns the short-rate dynamics.
std::size_t Size
size of a container
Array of correlated 1-D stochastic processes.
Abstract two-factor interest rate model class.