I am interested in a tool that calculates the total variation distance between two multivariate Normal distributions. Any help will be much appreciated as I am a complete beginner.(So far, I have searched for this tool in any programming language I know and to my surprise I haven't found anything. I am also not so sure that the tool that I have built is accurate.)

  • 1
    $\begingroup$ Do you have Mathematica? Am I right in saying the total variation distance is the maximum of the absolute difference between the CDFs of the distributions? In which case it would be NMaximize[Abs[CDF[d1, x] - CDF[d2, x]], x] in Mathematica for given distributions d1, d2 $\endgroup$ – flinty Sep 16 at 15:27
  • $\begingroup$ You got me. I don't actually have it. (I hope that doesn't mean that I can't post the question). I am looking where I can implement it first before installing a bunch of programs that may end up useless. Can you explain what $x$ is in your type? $\endgroup$ – cgss Sep 16 at 18:11
  • $\begingroup$ x is just the variable that appears in the cumulative density functions of your normal distributions. Since Mathematica is not free you may want to look into R instead which has a package distrEx and this rdocumentation.org/packages/distrEx/versions/2.8.0/topics/… . $\endgroup$ – flinty Sep 16 at 22:01
  • $\begingroup$ ^ oh yeah that's 1D only and you asked about multivariate. In Mathematica for 2D that would be NMaximize[Abs[CDF[d1, {x,y}] - CDF[d2, {x,y}]], {x,y}] and d1 and d2 would be MultinormalDistributions, assuming that's the correct definition for TVD. $\endgroup$ – flinty Sep 16 at 22:08
  • $\begingroup$ To be honest I am not sure that's correct. It may be it's just that I don't know about it. $\endgroup$ – cgss Sep 17 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.