From 0f49366f10bd41b291f56385e6e0972662cb7326 Mon Sep 17 00:00:00 2001 From: Evelina Gabasova Date: Fri, 5 Sep 2014 20:26:24 +0100 Subject: [PATCH] MatrixNormal density computation switched row and column covariance --- src/Numerics/Distributions/MatrixNormal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Numerics/Distributions/MatrixNormal.cs b/src/Numerics/Distributions/MatrixNormal.cs index efbcaf3d..0884d611 100644 --- a/src/Numerics/Distributions/MatrixNormal.cs +++ b/src/Numerics/Distributions/MatrixNormal.cs @@ -205,7 +205,7 @@ namespace MathNet.Numerics.Distributions var cholV = _v.Cholesky(); var cholK = _k.Cholesky(); - return Math.Exp(-0.5*cholV.Solve(a.Transpose()*cholK.Solve(a)).Trace()) + return Math.Exp(-0.5*cholK.Solve(a.Transpose()*cholV.Solve(a)).Trace()) /Math.Pow(2.0*Constants.Pi, x.RowCount*x.ColumnCount/2.0) /Math.Pow(cholV.Determinant, x.RowCount/2.0) /Math.Pow(cholK.Determinant, x.ColumnCount/2.0);