Piecewise Constant Helper 1.
More...
#include <qle/models/piecewiseconstanthelper.hpp>
|
| PiecewiseConstantHelper1 (const Array &t, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &constraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >()) |
|
| PiecewiseConstantHelper1 (const std::vector< Date > &dates, const Handle< YieldTermStructure > &yts, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &constraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >()) |
|
const Array & | t () const |
|
const QuantLib::ext::shared_ptr< Parameter > | p () const |
|
void | update () const |
|
Real | y (const Time t) const |
|
Real | int_y_sqr (const Time t) const |
| int_0^t y^2(s) ds More...
|
|
Real | direct (const Real x) const |
|
Real | inverse (const Real y) const |
|
Piecewise Constant Helper 1.
Definition at line 40 of file piecewiseconstanthelper.hpp.
◆ PiecewiseConstantHelper1() [1/2]
PiecewiseConstantHelper1 |
( |
const Array & |
t, |
|
|
const QuantLib::ext::shared_ptr< QuantLib::Constraint > & |
constraint = QuantLib::ext::make_shared< QuantLib::NoConstraint >() |
|
) |
| |
◆ PiecewiseConstantHelper1() [2/2]
PiecewiseConstantHelper1 |
( |
const std::vector< Date > & |
dates, |
|
|
const Handle< YieldTermStructure > & |
yts, |
|
|
const QuantLib::ext::shared_ptr< QuantLib::Constraint > & |
constraint = QuantLib::ext::make_shared< QuantLib::NoConstraint >() |
|
) |
| |
◆ t()
const Array & t |
( |
| ) |
const |
◆ p()
const QuantLib::ext::shared_ptr< Parameter > p |
( |
| ) |
const |
◆ update()
Definition at line 180 of file piecewiseconstanthelper.hpp.
180 {
182 b_.resize(
t_.size());
183 for (Size i = 0; i <
t_.size(); ++i) {
186 }
187}
Real direct(const Real x) const
Real sum(const Cash &c, const Cash &d)
◆ y()
Real y |
( |
const Time |
t | ) |
const |
◆ int_y_sqr()
Real int_y_sqr |
( |
const Time |
t | ) |
const |
int_0^t y^2(s) ds
Definition at line 288 of file piecewiseconstanthelper.hpp.
288 {
290 return 0.0;
291 Size i = std::upper_bound(
t_.begin(),
t_.end(),
t) -
t_.begin();
292 Real res = 0.0;
293 if (i >= 1)
294 res +=
b_[std::min(i - 1,
b_.size() - 1)];
295 Real a =
direct(
y_->params()[std::min(i,
y_->size() - 1)]);
296 res += a * a * (
t - (i == 0 ? 0.0 :
t_[i - 1]));
297 return res;
298}
◆ direct()
Real direct |
( |
const Real |
x | ) |
const |
◆ inverse()
Real inverse |
( |
const Real |
y | ) |
const |
◆ t_
◆ y_
◆ b_