mathnet/mathnet-numerics — pull request #248 by evelinag (2014-09-05 19:37:44+00:00)
Title: MatrixNormal density computation switched row and column covariance

There was a bug in density of MatrixNormal distribution. It showed only when number of rows was different from number of columns. For example:

let m = [|[|1.0; 1.0|]|] |> DenseMatrix.ofColumnArrays
let v = Double.DenseMatrix.CreateIdentity 2
let k = Double.DenseMatrix.CreateIdentity 1
let dist = MatrixNormal(m, v, k)
let sample = dist.Sample() // sampling from the distribution works
dist.Density(sample) // crashes

In the implementation, row covariance and column covariance matrices were switched.