Files
pricing/cpp/Statistics.hpp
David Doebel 087a2f0d74 Restructure C++ core into cpp module and package bindings.
Move the pricing engine sources out of src/ into cpp/, add the closed-form engine and pybind wiring, and align tests/build targets with the new project layout.

Made-with: Cursor
2026-04-02 16:30:33 +02:00

34 lines
711 B
C++

/**
* @file Statistics.hpp
* @brief Online sample moments for Monte Carlo diagnostics.
*/
#ifndef QUANTENGINE_STATISTICS_HPP
#define QUANTENGINE_STATISTICS_HPP
#include <vector>
/**
* @brief Accumulates count, mean/variance-related sums, and running min/max.
*/
class Statistics {
public:
Statistics() : moments_({0., 0., 0.}), n(0), max_(0.), min_(0.) {}
void dump(double value);
void clear();
double mean();
double variance();
double standardDeviation();
double skewness();
double max();
double min();
double sum();
double count();
private:
std::vector<double> moments_;
std::size_t n;
double max_, min_;
};
#endif //QUANTENGINE_STATISTICS_HPP