SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Private Attributes
OptimalBinning Class Reference

Computes the Optimal Binning density estimator of a set of points. More...

#include <OptimalBinning.hh>

Public Member Functions

 OptimalBinning ()
 Default constructor, initilizes everything to 0. More...
 
 OptimalBinning (const std::vector< std::vector< double >> &points, const std::string algo="scott", const bool interp=true, const bool ex=true)
 Cloud constructor, sets vector of points and their mapping for a point cloud. More...
 
 OptimalBinning (const OptimalBinning &ob)
 Copy constructor. More...
 
OptimalBinning & operator= (const OptimalBinning &ob)
 Equality operator. More...
 
double operator() (const std::vector< double > &v) const
 Overloaded function operator, calls Evaluate. More...
 
double operator() (const double &v) const
 Overloaded function operator, calls Evaluate. More...
 
double operator() (const double *v) const
 Overloaded function operator, calls Evaluate. More...
 
 ~OptimalBinning ()
 Destructor. More...
 
void Initialize (const std::vector< std::vector< double >> &points, const std::string &algo)
 Initializes the histogram with the optimal binning. More...
 
double Evaluate (const std::vector< double > &v) const
 Performs the density estimation at an n-point v. More...
 
double Evaluate (const double &v) const
 Performs the density estimation at an n-point v. More...
 
double Evaluate (const double *v) const
 Performs the density estimation at an n-point v. More...
 
const std::vector< double > & GetLowerBoundArray () const
 Returns the array of lower bounds in each dimension. More...
 
const double & GetLowerBound (const size_t i=0) const
 Returns the lower bound in dimension i. More...
 
const std::vector< double > & GetUpperBoundArray () const
 Returns the array of upper bounds in each dimension. More...
 
const double & GetUpperBound (const size_t i=0) const
 Returns the upper bound in dimension i. More...
 
size_t GetNbins (const size_t i=0) const
 Returns the amount of bins in one projection. More...
 
std::vector< TPolyLine * > Meshing () const
 Returns the meshing, used to build the interpolation, as polygons. More...
 

Private Attributes

size_t _dim
 Dimension of the space the estimator lives in. More...
 
Histogram _hist
 Optimal histogram for density estimation. More...
 
Interpolator _int
 Grid interpolator. More...
 
bool _interp
 Apply grid interpolation if true. More...
 
bool _ex
 Extrapolate if true. More...
 

Detailed Description

Computes the Optimal Binning density estimator of a set of points.

This method finds the optimal binning of the space by an array of different methods. The amount of data points in each bin is directly related to the density in the bin.

Constructor & Destructor Documentation

OptimalBinning::OptimalBinning ( )

Default constructor, initilizes everything to 0.

OptimalBinning::OptimalBinning ( const std::vector< std::vector< double >> &  points,
const std::string  algo = "scott",
const bool  interp = true,
const bool  ex = true 
)

Cloud constructor, sets vector of points and their mapping for a point cloud.

Parameters
pointsN points in a _dim dimensional space
algoAlgorithm to be used for binning optimization
interpPerform an interpolation on the histogram if requested
exExtrapolate outside the outmost points if requested
OptimalBinning::OptimalBinning ( const OptimalBinning &  ob)

Copy constructor.

OptimalBinning::~OptimalBinning ( )

Destructor.

Member Function Documentation

double OptimalBinning::Evaluate ( const std::vector< double > &  v) const

Performs the density estimation at an n-point v.

Parameters
vVector of coordinates of the n-point
double OptimalBinning::Evaluate ( const double &  v) const

Performs the density estimation at an n-point v.

Parameters
vOne dimensional value of the point
double OptimalBinning::Evaluate ( const double *  v) const

Performs the density estimation at an n-point v.

Parameters
vPointer to an array of coordinates of the n-point
const double& OptimalBinning::GetLowerBound ( const size_t  i = 0) const
inline

Returns the lower bound in dimension i.

const std::vector<double>& OptimalBinning::GetLowerBoundArray ( ) const
inline

Returns the array of lower bounds in each dimension.

size_t OptimalBinning::GetNbins ( const size_t  i = 0) const
inline

Returns the amount of bins in one projection.

const double& OptimalBinning::GetUpperBound ( const size_t  i = 0) const
inline

Returns the upper bound in dimension i.

const std::vector<double>& OptimalBinning::GetUpperBoundArray ( ) const
inline

Returns the array of upper bounds in each dimension.

void OptimalBinning::Initialize ( const std::vector< std::vector< double >> &  points,
const std::string &  algo 
)

Initializes the histogram with the optimal binning.

Parameters
points$N_1\times...\times N_n$ vector of points of n dimensions
algoAlgorithm to be used for binning optimization
std::vector< TPolyLine * > OptimalBinning::Meshing ( ) const

Returns the meshing, used to build the interpolation, as polygons.

double OptimalBinning::operator() ( const std::vector< double > &  v) const
inline

Overloaded function operator, calls Evaluate.

Parameters
vVector of coordinates
double OptimalBinning::operator() ( const double &  v) const
inline

Overloaded function operator, calls Evaluate.

Parameters
vOne dimensional value
double OptimalBinning::operator() ( const double *  v) const
inline

Overloaded function operator, calls Evaluate.

Parameters
vPointer to an array of coordinates
OptimalBinning & OptimalBinning::operator= ( const OptimalBinning &  ob)

Equality operator.

Field Documentation

size_t OptimalBinning::_dim
private

Dimension of the space the estimator lives in.

bool OptimalBinning::_ex
private

Extrapolate if true.

Histogram OptimalBinning::_hist
private

Optimal histogram for density estimation.

Interpolator OptimalBinning::_int
private

Grid interpolator.

bool OptimalBinning::_interp
private

Apply grid interpolation if true.


The documentation for this class was generated from the following files: