Example #1
0
        public static double GetEmpericalFunctionValue(double x, VariationRow variationRow)
        {
            double empericalValue = 0;
            var    variants       = variationRow.Variants;

            if (x > variants[variants.Count - 1].Value)
            {
                empericalValue = 1;
            }
            else
            {
                for (int i = 0; i < variants.Count; i++)
                {
                    if (x <= variants[i].Value) // X <= Xi
                    {
                        for (int j = 0; j < i; j++)
                        {
                            empericalValue += variants[j].Frequency;
                        }
                        empericalValue /= variationRow.DataCount;
                        break;
                    }
                }
            }

            return(empericalValue);
        }
Example #2
0
        public static double GetStep(VariationRow variationRow, int intervalsNumber)
        {
            var maxValue = variationRow.Variants.OrderByDescending(variant => variant.Value).First().Value;
            var minValue = variationRow.Variants.OrderBy(variant => variant.Value).First().Value;

            return((maxValue - minValue) / intervalsNumber); // Размах вариации / количество классов (интервалов)
        }
Example #3
0
        private void FillVariationTable(VariationRow variationRow)
        {
            gvVariationRow.Rows.Clear();

            for (int i = 0; i < variationRow.Variants.Count; i++)
            {
                var rowIndex = gvVariationRow.Rows.Add();
                var variant  = variationRow.Variants[i];

                gvVariationRow.Rows[rowIndex].HeaderCell.Value                    = String.Format("{0}", rowIndex + 1);
                gvVariationRow.Rows[rowIndex].Cells["Value"].Value                = variant.Value;
                gvVariationRow.Rows[rowIndex].Cells["Frequency"].Value            = variant.Frequency;
                gvVariationRow.Rows[rowIndex].Cells["RelativeFrequency"].Value    = String.Format("{0:0.###}", variant.RelativeFrequency);
                gvVariationRow.Rows[rowIndex].Cells["cumFreq"].Value              = String.Format("{0:0.###}", variant.CummulatedFrequency);
                gvVariationRow.Rows[rowIndex].Cells["DistributionFunction"].Value = String.Format("{0:0.###}", variant.EmpericalFunction);
            }
        }
Example #4
0
        private void FillAllData(List <double> dataItems)
        {
            variationRow = new VariationRow(dataItems);

            FillVariationTable(variationRow);
            DrawEmpericalChart(variationRow.Variants);

            lblStegesClassesCount.Text = Formulas.GetNumberOfClasses(dataItems.Count).ToString();
            nudIntervalsCount.Value    = Formulas.GetNumberOfClasses(variationRow.DataCount);

            iVariationRow = new IntervalVariationRow(variationRow, (int)nudIntervalsCount.Value);

            FillIntervalVariationTable(iVariationRow);
            DrawHistogram(iVariationRow, dataItems);

            FillCharacteristicsGrid(dataItems, dgvCharacteristics);
        }