예제 #1
0
        public void PopulateDescriptiveStatistics(PlottableProperty plottableProperty)
        {
            var plottableValues = Array.ConvertAll(SampleInstances[plottableProperty.PropertyName].ToArray(), input => Convert.ToDouble(input));

            if (plottableValues.Count() != 0)
            {
                PopulateBins(plottableValues, _numberBins, plottableProperty.PropertyName);
                Descriptive descriptiveStats = new Descriptive(plottableValues);
                descriptiveStats.Analyze();
                Statistics     = descriptiveStats.Result;
                StatisticsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(descriptiveStats.Result));
            }
        }
예제 #2
0
        private double CalculateWindowThreshold(double[] list, double parameterOmega)
        {
            //lstDHG.DHGs.Select(x => x.HeartbeatScore).ToArray<double>()
            if (list.Length == 1)
            {
                return(list[0]);
            }

            Descriptive desp = new Descriptive(list);

            desp.Analyze();

            return(desp.Result.Mean + parameterOmega * desp.Result.StdDev);
        }
        public void PopulateDescriptiveStatistics(PlottableProperty plottableProperty)
        {
            var plottableValues = SampleInstances.Select(i => new PlottableValue <T> {
                X = SampleInstances.IndexOf(i), Value = i
            }).ToList();
            var plottablePoints = PlottingUtilities.ToPlottable <T>(plottableValues, plottableProperty).Select(p => p.Y).ToArray();

            if (plottablePoints.Count() != 0)
            {
                PopulateBins(plottablePoints, _numberBins, plottableProperty.PropertyName);
                Descriptive descriptiveStats = new Descriptive(plottablePoints);
                descriptiveStats.Analyze();
                Statistics     = descriptiveStats.Result;
                StatisticsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(descriptiveStats.Result));
            }
        }
예제 #4
0
        protected void FillEstadisticas(int[] l,double[] li  )
        {
            try
            {
                statistics s = new statistics();
                s.list = l;
                TxtMediana.Text = s.mediana().ToString();
                TxtMediaAcot.Text = s.mean().ToString();
                TxtPromedio.Text = s.mean().ToString();
                Descriptive d = new Descriptive(li);
                d.Analyze();
                DescriptiveResult res = d.Result;
                TxtDesviacionEs.Text = res.StdDev.ToString("0,0.00", CultureInfo.InvariantCulture);

                if (res.StdDev <= 30)
                {
                    TxtVarianza.Text = "7";
                }
                else if (res.StdDev <= 60)
                {
                    TxtVarianza.Text = "6";
                }
                else if (res.StdDev <= 120)
                {
                    TxtVarianza.Text = "5";
                }
                else if (res.StdDev <= 500)
                {
                    TxtVarianza.Text = "4";
                }
                else if (res.StdDev <= 1000)
                {
                    TxtVarianza.Text = "3";
                }
                else if (res.StdDev <= 2000)
                {
                    TxtVarianza.Text = "2";
                }
                else
                {
                    TxtVarianza.Text = "1";
                }
                //SI(E5<=30;7;SI(E5<=60;6;SI(E5<=120;5;SI(E5<=500;4;SI(E5<=1000;3;SI(E5<=2000;2;1))))))
            }
            catch (Exception ex)
            {
                Log.EscribirError(ex);
                Log.EscribirTraza("Error al calcular estadisticas del acta" + Session["acta"].ToString());
            }
        }