Histogram Struct Reference

This structure is a visual aid to study the distributions of data set variables. More...

#include <statistics.h>

Public Member Functions

 Histogram ()
 Default constructor. More...
 
 Histogram (const Index &)
 Bins number constructor. More...
 
 Histogram (const Tensor< type, 1 > &, const Tensor< Index, 1 > &)
 Values constructor. More...
 
 Histogram (const Tensor< type, 1 > &, const Index &)
 Data constructor. More...
 
 Histogram (const Tensor< type, 1 > &)
 Probabillities constructor. More...
 
virtual ~Histogram ()
 Destructor. More...
 
Index get_bins_number () const
 Returns the number of bins in the histogram. More...
 
Index count_empty_bins () const
 Returns the number of bins with zero variates. More...
 
Index calculate_minimum_frequency () const
 Returns the number of variates in the less populated bin. More...
 
Index calculate_maximum_frequency () const
 Returns the number of variates in the most populated bin. More...
 
Index calculate_most_populated_bin () const
 Retuns the index of the most populated bin. More...
 
Tensor< type, 1 > calculate_minimal_centers () const
 Returns a vector with the centers of the less populated bins. More...
 
Tensor< type, 1 > calculate_maximal_centers () const
 Returns a vector with the centers of the most populated bins. More...
 
Index calculate_bin (const type &) const
 
Index calculate_frequency (const type &) const
 
void save (const string &) const
 

Public Attributes

Tensor< type, 1 > centers
 Positions of the bins in the histogram. More...
 
Tensor< type, 1 > minimums
 Minimum positions of the bins in the histogram. More...
 
Tensor< type, 1 > maximums
 Maximum positions of the bins in the histogram. More...
 
Tensor< Index, 1 > frequencies
 Population of the bins in the histogram. More...
 

Detailed Description

This structure is a visual aid to study the distributions of data set variables.

This structure contains the essentials for making histograms and obtain the data generated by the histogram :

  • Minimum.
  • Maximum.
  • Centers.
  • Frequencies.

Definition at line 149 of file statistics.h.

Constructor & Destructor Documentation

◆ Histogram() [1/5]

Histogram ( )
explicit

Default constructor.

Definition at line 210 of file statistics.cpp.

◆ Histogram() [2/5]

Histogram ( const Index &  bins_number)
explicit

Bins number constructor.

Bins number constructor.

Parameters
bins_numberNumber of bins in the histogram.

Definition at line 221 of file statistics.cpp.

◆ Histogram() [3/5]

Histogram ( const Tensor< type, 1 > &  new_centers,
const Tensor< Index, 1 > &  new_frequencies 
)
explicit

Values constructor.

Values constructor.

Parameters
new_centersCenter values for the bins.
new_frequenciesNumber of variates in each bin.

Definition at line 232 of file statistics.cpp.

◆ Histogram() [4/5]

Histogram ( const Tensor< type, 1 > &  data,
const Index &  number_of_bins 
)
explicit

Data constructor.

Data constructor

Parameters
dataNumerical data.
number_of_binsNumber of bins.

Definition at line 244 of file statistics.cpp.

◆ Histogram() [5/5]

Histogram ( const Tensor< type, 1 > &  probability_data)
explicit

Probabillities constructor.

Probabilities constructor

Parameters
probability_dataNumerical probabilities data.

Definition at line 280 of file statistics.cpp.

◆ ~Histogram()

~Histogram ( )
virtual

Destructor.

Definition at line 215 of file statistics.cpp.

Member Function Documentation

◆ calculate_bin()

Index calculate_bin ( const type &  value) const

Returns the number of the bin to which a given value belongs to.

Parameters
valueValue for which we want to get the bin.

Definition at line 464 of file statistics.cpp.

◆ calculate_frequency()

Index calculate_frequency ( const type &  value) const

Returns the frequency of the bin to which a given value belongs to.

Parameters
valueValue for which we want to get the frequency.

Definition at line 508 of file statistics.cpp.

◆ calculate_maximal_centers()

Tensor< type, 1 > calculate_maximal_centers ( ) const

Returns a vector with the centers of the most populated bins.

Definition at line 422 of file statistics.cpp.

◆ calculate_maximum_frequency()

Index calculate_maximum_frequency ( ) const

Returns the number of variates in the most populated bin.

Definition at line 358 of file statistics.cpp.

◆ calculate_minimal_centers()

Tensor< type, 1 > calculate_minimal_centers ( ) const

Returns a vector with the centers of the less populated bins.

Definition at line 381 of file statistics.cpp.

◆ calculate_minimum_frequency()

Index calculate_minimum_frequency ( ) const

Returns the number of variates in the less populated bin.

Definition at line 350 of file statistics.cpp.

◆ calculate_most_populated_bin()

Index calculate_most_populated_bin ( ) const

Retuns the index of the most populated bin.

Definition at line 366 of file statistics.cpp.

◆ count_empty_bins()

Index count_empty_bins ( ) const

Returns the number of bins with zero variates.

Definition at line 333 of file statistics.cpp.

◆ get_bins_number()

Index get_bins_number ( ) const

Returns the number of bins in the histogram.

Definition at line 325 of file statistics.cpp.

◆ save()

void save ( const string &  histogram_file_name) const

Definition at line 522 of file statistics.cpp.

Member Data Documentation

◆ centers

Tensor<type, 1> centers

Positions of the bins in the histogram.

Definition at line 199 of file statistics.h.

◆ frequencies

Tensor<Index, 1> frequencies

Population of the bins in the histogram.

Definition at line 211 of file statistics.h.

◆ maximums

Tensor<type, 1> maximums

Maximum positions of the bins in the histogram.

Definition at line 207 of file statistics.h.

◆ minimums

Tensor<type, 1> minimums

Minimum positions of the bins in the histogram.

Definition at line 203 of file statistics.h.


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