Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, I'll explain the problem first. I have two populations that have values for two different channels (c1,c2). I've modeled these using MultinormalDistribution[]. I would like to add some noise to these distributions, which also exists in channels (c1,c2). I've tried doing this using TransformedDistribution[]:

hiDist = MultinormalDistribution[\[Mu]HiErr, \[CapitalSigma]];
loDist = MultinormalDistribution[\[Mu]LoErr, \[CapitalSigma]];
noiseDist = MultinormalDistribution[\[Mu]Noise, \[CapitalSigma]];

hiNDist = 
   h + n, {h \[Distributed] hiDist, n \[Distributed] noiseDist}];
loNDist = 
   l + n, {l \[Distributed] loDist, n \[Distributed] noiseDist}];

This works with regular Normal distributions, but fails when I use it with the Multinormal primitives. Any elegant way to do this?

EDIT 1 Changed a typo.

"Failure" results when I try to call the thing. In place, the TransformedDistribution[] call will just output something like:

    TransformedDistribution[\[FormalX]1 + \[FormalX]2, {\[FormalX]1 \
     20000}, {{1000000, 0}, {0, 
      1000000}}], \[FormalX]2 \[Distributed] 
     2000}, {{1000000, 0}, {0, 1000000}}]}]

However, when I try to use the distribution, e.g.


Mathematica will throw the error:

RandomReal::udist: "The specification TransformedDistribution[[FormalX]> 1+[FormalX]2, {[FormalX]1[Distributed]MultinormalDistribution[{5000,20000},{{1000000,0},{0,1000000}}],[FormalX]2[Distributed]MultinormalDistribution[{2000,2000},{{1000000,0},{0,1000000}}]}] is not a random distribution recognized by the system"

While the code

n1 = NormalDistribution[5000, \[Sigma]];
n2  = NormalDistribution[10000, \[Sigma]];
n3 = TransformedDistribution[
  x + y, {x \[Distributed] n1, y \[Distributed] n2}]

Gives the expected

NormalDistribution[15000, 1000 Sqrt[2]]
share|improve this question
Could you detail "fails" as used here? Also providing the code of what you actually tried would be helpful. BTW I assume hiDist should be loDist in the second line, otherwise both distributions are identical. – Sjoerd C. de Vries Mar 14 '14 at 16:34
Updated my question. And yep, that was a typo. – Ted C Mar 14 '14 at 21:30
up vote 3 down vote accepted

Try, e.g. (I just plugged in values from mu and sigma from your error text:

dist = MultinormalDistribution[{5000, 20000}, {{1000000, 0}, {0, 1000000}}]
noise = MultinormalDistribution[{2000, 2000}, {{1000000, 0}, {0, 1000000}}]

transformed = 
 TransformedDistribution[{a + c, b + d}, {{a, b} \[Distributed] dist,
                                          {c, d} \[Distributed] noise}]


share|improve this answer
I see! So you have to explicitly describe each component of the output? – Ted C Apr 7 '14 at 18:05
@ted: It appears that way. Some of the more esoteric corners of the Mathematica probability functionality sometimes need manual "tweaking". When I have to do such, I always spot-check it against expected values... – ciao Apr 7 '14 at 21:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.