Histogram Struct Reference

#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

The Histograms is a visual aid to study the distributions of data_set variables.

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

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

Definition at line 148 of file statistics.h.

Constructor & Destructor Documentation

◆ Histogram() [1/5]

Histogram ( )
explicit

Default constructor.

Definition at line 209 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 220 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 231 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 243 of file statistics.cpp.

◆ Histogram() [5/5]

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

Probabillities constructor.

Probabilities constructor

Parameters
dataNumerical probabilities data.

Definition at line 279 of file statistics.cpp.

◆ ~Histogram()

~Histogram ( )
virtual

Destructor.

Definition at line 214 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 463 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 507 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 421 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 357 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 380 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 349 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 365 of file statistics.cpp.

◆ count_empty_bins()

Index count_empty_bins ( ) const

Returns the number of bins with zero variates.

Definition at line 332 of file statistics.cpp.

◆ get_bins_number()

Index get_bins_number ( ) const

Returns the number of bins in the histogram.

Definition at line 324 of file statistics.cpp.

◆ save()

void save ( const string &  histogram_file_name) const

Definition at line 521 of file statistics.cpp.

Member Data Documentation

◆ centers

Tensor<type, 1> centers

Positions of the bins in the histogram.

Definition at line 198 of file statistics.h.

◆ frequencies

Tensor<Index, 1> frequencies

Population of the bins in the histogram.

Definition at line 210 of file statistics.h.

◆ maximums

Tensor<type, 1> maximums

Maximum positions of the bins in the histogram.

Definition at line 206 of file statistics.h.

◆ minimums

Tensor<type, 1> minimums

Minimum positions of the bins in the histogram.

Definition at line 202 of file statistics.h.


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