Example #1
0
 // Token: 0x060004D8 RID: 1240 RVA: 0x0001E8C0 File Offset: 0x0001CAC0
 private static StatisticalDataHistogram[] CreateBucketsAndHistogram(StatisticalData[] data, TimeFrame[] timeFrames, int intervalsCount, ThresholdMinMaxValue minMax)
 {
     Bucket[] array = new Bucketizer().CreateBuckets(intervalsCount, minMax);
     StatisticalDataHistogram[] histograms = HistogramCalculator.CreateHistogramForTimeFrames(timeFrames, array.Length);
     histograms = HistogramCalculator.CreateHistogramsPointsFromBuckets(histograms, array);
     return(HistogramCalculator.CalculatePointsFrequencyFromStatistics(data, histograms));
 }
        public StatisticalDataHistogram[] CreateHistogram(
            StatisticalData[] data,
            TimeFrame[] timeFrames,
            int intervalsCount)
        {
            ThresholdMinMaxValue minMax = new MinMaxCalculator().Calculate(data);

            return(HistogramCalculator.CreateBucketsAndHistogram(data, timeFrames, intervalsCount, minMax));
        }
Example #3
0
 // Token: 0x060004D9 RID: 1241 RVA: 0x0001E8F8 File Offset: 0x0001CAF8
 private static StatisticalDataHistogram[] CalculatePointsFrequencyFromStatistics(StatisticalData[] values, StatisticalDataHistogram[] histograms)
 {
     foreach (StatisticalData statisticalData in values)
     {
         for (int j = 0; j < histograms.Length; j++)
         {
             if (histograms[j].TimeFrame.IsInTimeFrame(statisticalData.Date))
             {
                 HistogramCalculator.IncrementPointFrequency(histograms[j], statisticalData.Value);
             }
         }
     }
     return(histograms);
 }
Example #4
0
        // Token: 0x060004D7 RID: 1239 RVA: 0x0001E864 File Offset: 0x0001CA64
        public StatisticalDataHistogram[] CreateHistogramWithScaledInterval(StatisticalData[] data, TimeFrame[] timeFrames, int intervalsCount, Type dataType)
        {
            ThresholdMinMaxValue thresholdMinMaxValue = new MinMaxCalculator().Calculate(data);

            if (dataType != null && dataType == typeof(int))
            {
                int num = (int)(thresholdMinMaxValue.Max - thresholdMinMaxValue.Min);
                if (num == 0)
                {
                    num = 1;
                }
                intervalsCount = Math.Min(num, intervalsCount);
            }
            return(HistogramCalculator.CreateBucketsAndHistogram(data, timeFrames, intervalsCount, thresholdMinMaxValue));
        }
 private static StatisticalDataHistogram[] CalculatePointsFrequencyFromStatistics(
     StatisticalData[] values,
     StatisticalDataHistogram[] histograms)
 {
     for (int index1 = 0; index1 < values.Length; ++index1)
     {
         StatisticalData statisticalData = values[index1];
         for (int index2 = 0; index2 < histograms.Length; ++index2)
         {
             if (histograms[index2].get_TimeFrame().IsInTimeFrame((DateTime)statisticalData.Date))
             {
                 HistogramCalculator.IncrementPointFrequency(histograms[index2], (double)statisticalData.Value);
             }
         }
     }
     return(histograms);
 }
        public StatisticalDataHistogram[] CreateHistogramWithScaledInterval(
            StatisticalData[] data,
            TimeFrame[] timeFrames,
            int intervalsCount,
            Type dataType)
        {
            ThresholdMinMaxValue minMax = new MinMaxCalculator().Calculate(data);

            if (dataType != (Type)null && dataType == typeof(int))
            {
                int val1 = (int)(minMax.get_Max() - minMax.get_Min());
                if (val1 == 0)
                {
                    val1 = 1;
                }
                intervalsCount = Math.Min(val1, intervalsCount);
            }
            return(HistogramCalculator.CreateBucketsAndHistogram(data, timeFrames, intervalsCount, minMax));
        }