Example #1
0
/* Requires: Analyzed mean & stddev
 */
inline extended_sample_data_t::value_t covariance( const extended_sample_data_t& x, const extended_sample_data_t& y )
{
    if ( x.simple || y.simple )
        return 0;

    return statistics::calculate_correlation_coefficient( x.data().begin(), x.data().end(), x.mean(), x.std_dev, y.data().begin(), y.data().end(), y.mean(), y.std_dev );
}
Example #2
0
 /* Create Histogram from extended sample data, using min/max from sd data
  */
 void create_histogram( const extended_sample_data_t& sd, size_t num_buckets )
 {
   if ( sd.simple || sd.data().empty() )
     return;
   double min = *std::min_element( sd.data().begin(), sd.data().end() );
   double max = *std::max_element( sd.data().begin(), sd.data().end() );
   create_histogram( sd, num_buckets, min, max );
 }
Example #3
0
 /* Create Histogram from extended sample data, with given min/max
  */
 void create_histogram( const extended_sample_data_t& sd, size_t num_buckets, double min, double max )
 {
   if ( sd.simple || sd.data().empty() )
     return;
   clear();
   _min = min; _max = max;
   _data = statistics::create_histogram( sd.data().begin(), sd.data().end(), num_buckets, _min, _max );
   calculate_num_entries();
 }