31Stats::Stats(std::vector<Real> data) : data_(data), mean_(0.0), std_(0.0), max_(0.0), min_(0.0) {
32 for (Size i = 0; i <
data_.size(); i++) {
44 Distribution dist(bins, std::max(
min_, xmin), std::min(
max_, xmax));
45 for (Size i = 0; i <
data_.size(); i++) {
56void print(Distribution& dist, std::string fileName) {
58 file.open(fileName.c_str());
60 QL_FAIL(
"error opening file " << fileName);
61 file.setf(std::ios::scientific, std::ios::floatfield);
62 file.setf(std::ios::showpoint);
64 for (Size i = 0; i < dist.size(); i++)
65 file << i <<
" " << dist.x(i) <<
" " << dist.density(i) << std::endl;
collateralized bond obligation pricing engine
Distribution histogram(Size bins, Real xmin=-QL_MAX_REAL, Real xmax=QL_MAX_REAL)
Stats(std::vector< Real > data)
std::vector< Real > data_
RandomVariable sqrt(RandomVariable x)
void print(Distribution &dist, std::string fileName)