Discrete Distribution. More...
#include <qle/math/discretedistribution.hpp>
Public Member Functions | |
DiscreteDistribution (const vector< Distributionpair > &) | |
DiscreteDistribution () | |
Default constructor with probability 1.0 at 0.0. More... | |
DiscreteDistribution (const vector< Real > &dataPoints, const vector< Real > &probabilities) | |
Construct a discrete probability distribution by giving the points and probabilities. More... | |
virtual Size | size () const |
virtual vector< Distributionpair > | get () const |
virtual Distributionpair | get (Size i) const |
Real | probability (Size i) const |
Return probability for data at index i . More... | |
Real | data (Size i) const |
Return data at index i . More... | |
virtual | ~DiscreteDistribution () |
Protected Attributes | |
vector< Distributionpair > | data_ |
Friends | |
class | MDD |
Discrete Distribution.
This class implements a one-dimensional distribution in terms of a vector of Distributionpairs.
Definition at line 61 of file discretedistribution.hpp.
DiscreteDistribution | ( | const vector< Distributionpair > & | data | ) |
Definition at line 30 of file discretedistribution.cpp.
Default constructor with probability 1.0 at 0.0.
Definition at line 34 of file discretedistribution.cpp.
DiscreteDistribution | ( | const vector< Real > & | dataPoints, |
const vector< Real > & | probabilities | ||
) |
Construct a discrete probability distribution by giving the points and probabilities.
Definition at line 36 of file discretedistribution.cpp.
|
virtual |
Definition at line 77 of file discretedistribution.hpp.
|
virtual |
|
virtual |
|
virtual |
Definition at line 48 of file discretedistribution.cpp.
Real probability | ( | Size | i | ) | const |
Return probability for data at index i
.
Definition at line 53 of file discretedistribution.cpp.
Real data | ( | Size | i | ) | const |
Return data at index i
.
Definition at line 59 of file discretedistribution.cpp.
|
friend |
Definition at line 79 of file discretedistribution.hpp.
|
protected |
Definition at line 82 of file discretedistribution.hpp.