Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to find the characteristic function of a sum of "named" distributions, though I am interested in how to use Mathematica to find the characteristic function of $$f(X_1,\ldots, X_n),$$ where $X_i$ are some given random variables.

A toy problem is finding the characteristic function of $X+Y$, where $X$ and $Y$ are iid $\mathcal{N}(0,1)$. The following code:

\[ScriptCapitalD] =  TransformedDistribution[x + y, {x, y} \[Distributed] NormalDistribution[]]
CharacteristicFunction[\[ScriptCapitalD], \[Lambda]]

Produces the output

CharacteristicFunction[TransformedDistribution[\[FormalX]1 + \[FormalX]2, {\[FormalX]1, \[FormalX]2} \[Distributed] NormalDistribution[0, 1]], \[Lambda]]

which is obviously not what's desired.

It seems that CharacteristicFunction only works with named distributions that ship with Mathematica. Is this correct? If not, how can I make it work with a transformed distribution?

(I know that there are other ways to find the characteristic function of $X+Y$ above; it was only used for illustration purposes.)

share|improve this question
    
What answer do you expect in the example you gave? –  RunnyKine Oct 27 '13 at 1:00
    
The characteristic function should be $e^{-\lambda^2}$ if I am not mistaken. –  user12677 Oct 27 '13 at 2:43
add comment

2 Answers

up vote 2 down vote accepted

Here's a way to get the characteristic function. First, get the transformed distribution (in this case the sum) and then take the Characteristic function.

maxD = TransformedDistribution[x + y, {x \[Distributed] NormalDistribution[0, 5], 
                                       y \[Distributed] NormalDistribution[0, 3]}];
CharacteristicFunction[maxD, t]

E^(-17 t^2)

You can supply symbolic values instead of the fixed values, and it also works fine. For example:

CharacteristicFunction[TransformedDistribution[x + y, 
      {x \[Distributed] NormalDistribution[m1, s1], 
       y \[Distributed] NormalDistribution[m2, s2]}], t]

E^(I (m1 + m2) t - 1/2 (s1^2 + s2^2) t^2)

It also works for some (simple) functions. Both (x+y)^2 and x y work fine, but I gave up waiting for (x+y)^n.

share|improve this answer
    
Thanks for the help! –  user12677 Oct 27 '13 at 19:55
add comment

The problem relates to the specfiication of the transformed distribution. {x,y}[Distributed]NormalDisribution[] is incorrect. NormalDistribution[] is a univariate distribution. Assuming X and Y are iid you could either use the syntax of bill s:

maxD = TransformedDistribution[x + y, {x \[Distributed] NormalDistribution[0, 5], 
                                       y \[Distributed] NormalDistribution[0, 3]}];

Or for this specific example binormal distribution with zero correlation:

d = BinormalDistribution[{0, 0}, {1, 1}, 0];
t = TransformedDistribution[x + y, {x, y} \[Distributed] d];
CharacteristicFunction[t, \[Lambda]]

This yields:

E^-\[Lambda]^2

i.e.$e^{\lambda^2}$

share|improve this answer
    
Ah I see; should have read the documentation more closely. –  user12677 Oct 27 '13 at 19:55
    
It's ok. I have made same or similar mistakes in past... –  ubpdqn Oct 28 '13 at 1:48
add comment

Your Answer

 
discard

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.