I was trying to find the bayes optimal error of a data set with multidimensional gaussian distribution. Someone told me that there is no closed form solution like the error function(erfc) for this generalization. And all we could do is a numerical approximation.

My question is that since the distributions are known we should be able to calculate this analytically. Then getting to the mathematics I quickly realized that there exists no closed form solution for the integral of the general K dimensional Gaussian...

So how might one evaluate this numerically?

asked Aug 18 '10 at 18:34

kpx's gravatar image

kpx
541182636

edited Aug 20 '10 at 00:18


One Answer:

You could use an existing numerical integration package. Here's example of numerically integrating p(x)||x|| in Mathematica, where p(x) is d-dimensional Gaussian.

Needs["MultivariateStatistics`"]
(*Compute E[||X||] for d-dimensional Gaussian*)

ev[d_] := 
  Module[{ndist, params, pdf, intlimits, norm}, 
   ndist = MultinormalDistribution[Table[0, {d}], IdentityMatrix[d]];
   params = (Subscript[x, #1] &) /@ Table[i, {i, 1, d}];
   pdf = PDF[ndist, params];
   intlimits = 
    Sequence @@ ({Subscript[x, #1], -Infinity, Infinity} &) /@ 
      Table[i, {i, 1, d}];
   norm = Sqrt[Plus @@ (#1^2 &) /@ params];
   NIntegrate[norm*pdf, Evaluate[intlimits], Method -> LocalAdaptive]];
ev[3]

For Bayes optimal error, you'll probably need to integrate over a region defined implicitly, here's how to do that

answered Aug 20 '10 at 00:58

Yaroslav%20Bulatov's gravatar image

Yaroslav Bulatov
2333214365

edited Aug 20 '10 at 01:00

Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.