当前位置: 首页>>代码示例>>C#>>正文


C# IContinuousDistribution.Density方法代码示例

本文整理汇总了C#中IContinuousDistribution.Density方法的典型用法代码示例。如果您正苦于以下问题:C# IContinuousDistribution.Density方法的具体用法?C# IContinuousDistribution.Density怎么用?C# IContinuousDistribution.Density使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IContinuousDistribution的用法示例。


在下文中一共展示了IContinuousDistribution.Density方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculateBayesRiskUniformDistribution

        public static double CalculateBayesRiskUniformDistribution(IContinuousDistribution generator1, IContinuousDistribution generator2, double P1, double P2)
        {
            double dens1 = generator1.Density(generator1.Mean);
            double dens2 = generator2.Density(generator2.Mean);

            if (dens1 > dens2)
            {
                double range = generator1.Maximum - generator2.Minimum;
                if (range > 0.0)
                {
                    return range * dens2  * 100;
                }

            }
            else if (dens2 > dens1)
            {
                double range = generator2.Maximum - generator1.Minimum;
                if (range > 0.0)
                {
                    return range * dens1 * 100;
                }
            }
            else
            {
                double range1 = generator2.Maximum - generator1.Minimum;
                double range2 = generator1.Maximum - generator2.Minimum;

                if (range1 > 0.0)
                {
                    return range1 * dens1*100;
                }

                if (range2 > 0.0)
                {
                    return range2 * dens1 * 100;
                }
            }

            return 0.0;
        }
开发者ID:michal-franc,项目名称:ImageClassification,代码行数:40,代码来源:NaiveBayes.cs

示例2: CreateDistributionSerie

        private Series CreateDistributionSerie(IContinuousDistribution distributionn)
        {
            Series createdSerie = new Series();
            createdSerie.ChartType = SeriesChartType.SplineArea;

            for (double i = distributionn.Mean - (8 * distributionn.StdDev); i < distributionn.Mean + (8 * distributionn.StdDev); i += 0.5)
            {
                if (distributionn is ContinuousUniform)
                {
                    createdSerie.Points.Add(new DataPoint((int)i, distributionn.Density(i)));
                }
                else
                {
                    createdSerie.Points.Add(new DataPoint(i, distributionn.Density(i)));

                }
            }

            return createdSerie;
        }
开发者ID:michal-franc,项目名称:ImageClassification,代码行数:20,代码来源:Form1.cs

示例3: CalculateIntegral1

 private static double CalculateIntegral1(IContinuousDistribution dist1, IContinuousDistribution dist2, double commonPoint, double p1, double p2)
 {
     double sum = 0.0;
     double sum1 = 0.0;
     for (double i = dist1.Mean - (8 * dist1.StdDev); i < dist1.Mean + (8 * dist1.StdDev); i += 0.0001)
     {
         double d1 = p1*dist1.Density(i);
         double d2 = p2*dist2.Density(i);
             if (d1 <= d2)
             {
                 sum += 0.0001 * d1;
             }
             else
             {
                 sum += 0.0001 * d2;
             }
     }
     return sum;
 }
开发者ID:michal-franc,项目名称:ImageClassification,代码行数:19,代码来源:NaiveBayes.cs

示例4: FindCommonPointNormalDistribution

        /// <summary>
        /// Find the common point beetwen 2 distributions
        /// </summary>
        /// <param name="dist1">First Distribution</param>
        /// <param name="dist2">Second Distribution</param>
        /// <param name="commonPoint"></param>
        /// <returns></returns>
        public static bool FindCommonPointNormalDistribution(IContinuousDistribution dist1,IContinuousDistribution dist2,ref double commonPoint)
        {
            bool found = false;
            double step = 0.0;
            if (dist2.Mean > dist1.Mean)
                step = 0.001;
            else
                step = -0.001;

                for (double i = dist1.Mean; i < dist2.Mean; i += 0.001)
                {
                    if (Math.Abs(dist1.Density(i) - dist2.Density(i)) < 0.00001)
                    {
                        commonPoint = i;
                        found = true;
                        break;
                    }
                }

            return found;
        }
开发者ID:michal-franc,项目名称:ImageClassification,代码行数:28,代码来源:NaiveBayes.cs


注:本文中的IContinuousDistribution.Density方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。