本文整理汇总了C#中PositiveDefiniteMatrix.Inverse方法的典型用法代码示例。如果您正苦于以下问题:C# PositiveDefiniteMatrix.Inverse方法的具体用法?C# PositiveDefiniteMatrix.Inverse怎么用?C# PositiveDefiniteMatrix.Inverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PositiveDefiniteMatrix
的用法示例。
在下文中一共展示了PositiveDefiniteMatrix.Inverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogAverageFactor
/// <summary>
/// Evidence message for EP
/// </summary>
/// <param name="Sample">Constant value for 'sample'.</param>
/// <param name="MeanMean">Buffer 'MeanMean'.</param>
/// <param name="MeanVariance">Buffer 'MeanVariance'.</param>
/// <param name="Precision">Constant value for 'precision'.</param>
/// <returns>Logarithm of the factor's average value across the given argument distributions</returns>
/// <remarks><para>
/// The formula for the result is <c>log(factor(sample,mean,precision))</c>.
/// </para></remarks>
public static double LogAverageFactor(Vector Sample,
[Fresh] Vector MeanMean,
[Fresh] PositiveDefiniteMatrix MeanVariance,
PositiveDefiniteMatrix Precision)
{
return VectorGaussian.GetLogProb(Sample, MeanMean, Precision.Inverse() + MeanVariance);
}
示例2: Recalculate
/// <summary>
/// Function to recalulate KBB and InvKBB
/// </summary>
protected void Recalculate()
{
int numBas = NumberBasisPoints;
int numFeat = NumberFeatures;
if (prior == null || numBas <= 0 || numFeat <= 0) {
ClearCachedValues();
} else {
kBB = prior.Covariance(basis);
invKBB = kBB.Inverse();
//invKBB = new PositiveDefiniteMatrix(NumberBasisPoints, NumberBasisPoints);
//LowerTriangularMatrix lt = new LowerTriangularMatrix(NumberBasisPoints, NumberBasisPoints);
//lt.SetToCholesky(kBB);
//invKBB.SetToIdentity();
//invKBB.PredivideBy(lt);
//invKBB.PredivideByTranspose(lt);
}
}