Implements k-split, an adaptive histogram-like density estimation algorithm. More...
#include <cksplit.h>
Classes | |
struct | Grid |
Supporting struct for cKSplit. More... | |
class | Iterator |
Walks along cells of the distribution stored in a cKSplit object. More... | |
Public Types | |
enum | |
typedef int(* | CritFunc )(const cKSplit &, cKSplit::Grid &, int, double *) |
typedef double(* | DivFunc )(const cKSplit &, cKSplit::Grid &, double, double *) |
Public Member Functions | |
Constructors, destructor, assignment. | |
cKSplit (const cKSplit &r) | |
cKSplit (const char *name=NULL) | |
virtual | ~cKSplit () |
cKSplit & | operator= (const cKSplit &res) |
Redefined cObject member functions. | |
virtual cKSplit * | dup () const |
virtual std::string | detailedInfo () const |
virtual void | parsimPack (cCommBuffer *buffer) |
virtual void | parsimUnpack (cCommBuffer *buffer) |
Redefined member functions from cStatistic and its subclasses. | |
virtual void | transform () |
virtual int | getNumCells () const |
virtual double | getBasepoint (int k) const |
virtual double | getCellValue (int k) const |
virtual double | getPDF (double x) const |
virtual double | getCDF (double x) const |
virtual void | merge (const cStatistic *other) |
virtual double | random () const |
virtual void | saveToFile (FILE *) const |
virtual void | loadFromFile (FILE *) |
Configuring the k-split algorithm. | |
void | setCritFunc (CritFunc _critfunc, double *_critdata) |
void | setDivFunc (DivFunc _divfunc, double *_divdata) |
void | rangeExtension (bool enabled) |
Querying the k-split data structure. | |
int | getTreeDepth () const |
int | getTreeDepth (Grid &grid) const |
double | getRealCellValue (Grid &grid, int cell) const |
void | printGrids () const |
Grid & | getGrid (int k) const |
Grid & | getRootGrid () const |
Protected Member Functions | |
virtual void | collectTransformed (double val) |
Implements k-split, an adaptive histogram-like density estimation algorithm.
anonymous enum |
K is the grid size of the algorithm.
It must be 2, or a >=3 odd number.
virtual std::string cKSplit::detailedInfo | ( | ) | const [virtual] |
Produces a multi-line description of the object's contents.
See cObject for more details.
Reimplemented from cDensityEstBase.
virtual cKSplit* cKSplit::dup | ( | ) | const [inline, virtual] |
double cKSplit::getRealCellValue | ( | Grid & | grid, | |
int | cell | |||
) | const |
Returns the actual amount of observations in cell 'cell' of 'grid'.
This is not necessarily an integer value because of previous cell splits.
virtual void cKSplit::merge | ( | const cStatistic * | other | ) | [virtual] |
Merging is not supported by this class.
This method throws an error.
Reimplemented from cDensityEstBase.
Assignment operator.
The name member is not copied; see cNamedObject's operator=() for more details.
virtual void cKSplit::parsimPack | ( | cCommBuffer * | buffer | ) | [virtual] |
Serializes the object into an MPI send buffer.
Used by the simulation kernel for parallel execution. See cObject for more details.
Reimplemented from cDensityEstBase.
virtual void cKSplit::parsimUnpack | ( | cCommBuffer * | buffer | ) | [virtual] |
Deserializes the object from an MPI receive buffer.
Used by the simulation kernel for parallel execution. See cObject for more details.
Reimplemented from cDensityEstBase.
virtual double cKSplit::random | ( | ) | const [virtual] |
void cKSplit::rangeExtension | ( | bool | enabled | ) |
Enables/disables range extension.
If range extension is enabled, a new observation that falls outside the k-split range (ie. outside the root grid) will cause the range to be expanded (i.e. new root getGrid(s) to be placed above the current root grid). If range extension is disabled, such observations will simply be counted as underflows or overflows.