Re: TransformedDistribution
- To: mathgroup at smc.vnet.net
- Subject: [mg121165] Re: TransformedDistribution
- From: sashap <pavlyk at gmail.com>
- Date: Thu, 1 Sep 2011 06:04:33 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j3l1b9$bus$1@smc.vnet.net>
The result returned by Mathematica is correct for fractional values of n1 and n2, but contains removable singularities as n1 and n2 approach integers. It is possible to work this out manually and arrive at rather concise answer in terms of MeijerG function: In[472]:= Table[{(-(( 2^(1/2 (-5 + n1 + 3 n2)) n1^(1/2 + n2) n2^-n2)/(\[Pi]^2 Gamma[n1/2] Gamma[n2/2]))) MeijerG[{{1, 5/4 + n2/2, 3/4 + n2/2}, {}}, {{(n2/ 2), (1/2 + n2/2), (1/4 + n1/4 + n2/2), (3/4 + n1/4 + n2/ 2)}, {}}, n2^2/(8 n1^2)], NExpectation[x, x \[Distributed] TransformedDistribution[ Sqrt[\[FormalX]2 n2 + \[FormalX]1 n1], {\[FormalX]1 \ \[Distributed] ChiSquareDistribution[n1], \[FormalX]2 \[Distributed] ChiDistribution[n2]}]]}, {n1, 3}, {n2, 3}] // N Out[472]= {{{1.23773, 1.23773}, {1.80421, 1.80421}, {2.35035, 2.35035}}, {{2.02296, 2.02296}, {2.43425, 2.43425}, {2.87683, 2.87683}}, {{2.92792, 2.92792}, {3.23227, 3.23227}, {3.58573, 3.58573}}} The MeijerG representation can be expanded to simpler functions: In[477]:= (-(( 2^(1/2 (-5 + n1 + 3 n2)) n1^(1/2 + n2) n2^-n2)/(\[Pi]^2 Gamma[n1/2] Gamma[n2/2]))) MeijerG[{{1, 5/4 + n2/2, 3/4 + n2/2}, {}}, {{(n2/ 2), (1/2 + n2/2), (1/4 + n1/4 + n2/2), (3/4 + n1/4 + n2/ 2)}, {}}, n2^2/(8 n1^2)] /. {n1 -> 2, n2 -> 1} // FunctionExpand // FullSimplify Out[477]= (E^( 1/32) (-2 \[Pi] Erfc[1/(4 Sqrt[2])] + Sqrt[2] (Gamma[1/4] Gamma[3/4, 1/32] - Gamma[-(1/4)] Gamma[5/4, 1/32])))/(2 Sqrt[\[Pi]]) On Aug 31, 5:10 am, paulvonhippel at yahoo <paulvonhip... at yahoo.com> wrote: > I am seeking the mean of a variable which includes the weighted sum of > two chi-square variables. When I ask the question the obvious way > (below), Mathematica takes a long time to return an unwieldy answer > that is undefined for most values of n1 & n2. I'd be grateful if > someone could suggest a more tractable way to pose the problem. > > Here's a simplified version of the problem: > > Mean[ > TransformedDistribution[ > Sqrt[\[FormalX]2 n2 + \[FormalX]1 n1 ], {\[FormalX]1 \[Distributed] > ChiSquareDistribution[n1], \[FormalX]2 \[Distributed] > ChiDistribution[n2]}]] > > And whatI really want to do is a little more complicated: > > TransformedDistribution[\[FormalX]2 Sqrt[((\[FormalX]3 + > den) n + \[FormalX]1 Subscript[n, obs])/( > den (-1 + n) n)] \[Sigma], {\[FormalX]1 \[Distributed] > ChiSquareDistribution[1], \[FormalX]2 \[Distributed] > ChiDistribution[-1 + Subscript[n, > obs]], \[FormalX]3 \[Distributed] > ChiSquareDistribution[-1 + Subscript[n, mis]]}]