#include <qle/models/hullwhitebucketing.hpp>
|
template<class I > |
| Bucketing (I bucketsBegin, I bucketsEnd) |
|
| Bucketing (const Real lowerBound, const Real upperBound, const Size n) |
|
const std::vector< Real > & | upperBucketBound () const |
|
Size | index (const Real x) const |
|
Size | buckets () const |
|
Definition at line 33 of file hullwhitebucketing.hpp.
◆ Bucketing() [1/2]
buckets are (-QL_MAX_REAL, b1), [b1, b2), [b2,b3), ... , [b_{n-1}, b_n), [b_n, +QL_MAX_REAL)
Definition at line 77 of file hullwhitebucketing.hpp.
77 :
buckets_(bucketsBegin, bucketsEnd) {
79}
std::vector< Real > buckets_
◆ Bucketing() [2/2]
Bucketing |
( |
const Real |
lowerBound, |
|
|
const Real |
upperBound, |
|
|
const Size |
n |
|
) |
| |
there are n+2 buckets constructed, lb = lower bound, ub = upper bound, h = (ub - lb) / n buckets are (-QL_MAX_REAL, lb), [lb, lb+h), [lb+h, lb+2h), ... , [lb+(n-1)h, ub), [ub,+QL_MAX_REAL)
Definition at line 28 of file hullwhitebucketing.cpp.
28 {
30 Real h = (upperBound - lowerBound) / static_cast<Real>(n);
31 for (Size i = 0; i <= n; ++i)
32 buckets_[i] = lowerBound +
static_cast<Real
>(i) * h;
38}
◆ upperBucketBound()
const std::vector< Real > & upperBucketBound |
( |
| ) |
const |
◆ index()
Size index |
( |
const Real |
x | ) |
const |
◆ buckets()
◆ initBuckets()
Definition at line 49 of file hullwhitebucketing.cpp.
49 {
50 QL_REQUIRE(!
buckets_.empty(),
"Bucketing::initBuckets() no buckets given");
51 QL_REQUIRE(std::is_sorted(
buckets_.begin(),
buckets_.end()),
"buckets must be sorted");
54 }
55}
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
◆ buckets_
std::vector<Real> buckets_ |
|
protected |
◆ uniformBuckets_
bool uniformBuckets_ = false |
|
protected |
◆ lowerBound_
◆ upperBound_
◆ h_