本文整理汇总了C#中Gamma.EvaluateLn方法的典型用法代码示例。如果您正苦于以下问题:C# Gamma.EvaluateLn方法的具体用法?C# Gamma.EvaluateLn怎么用?C# Gamma.EvaluateLn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gamma
的用法示例。
在下文中一共展示了Gamma.EvaluateLn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuadratureNodesAndWeights
/// <summary>
/// Quadrature nodes for Gamma expectations
/// </summary>
/// <param name="precision">'precision' message</param>
/// <param name="nodes">Place to put the nodes</param>
/// <param name="weights">Place to put the weights</param>
public static void QuadratureNodesAndWeights(Gamma precision, double[] nodes, double[] weights)
{
#if KeepLastMessage
if (LastPrecisionMessage != null) {
Gamma PrecisionPosterior = precision * LastPrecisionMessage;
Quadrature.GammaNodesAndWeights(PrecisionPosterior.Precision, PrecisionPosterior.PrecisionOverMean, nodes, weights);
// modify the weights to include q(prec)/Ga(prec;a,b)
for (int i = 0; i < weights.Length; i++) {
weights[i] *= Math.Exp(precision.EvaluateLn(nodes[i]) - Gamma.EvaluateLn(nodes[i], PrecisionPosterior.Precision, PrecisionPosterior.PrecisionOverMean));
}
return;
}
#endif
Quadrature.GammaNodesAndWeights(precision.Shape - 1, precision.Rate, nodes, weights);
}