本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}