Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3943
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: random variables |
| Date | 2011-07-24 07:20 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j0gh41$bcs$1@smc.vnet.net> (permalink) |
| References | <201107232352.TAA08648@smc.vnet.net> |
U=ChiSquareDistribution[n-1];
twoU=TransformedDistribution[2*u,u\[Distributed]U];
Through[{Mean,Variance,PDF}@twoU]
{2 (-1+n),8 (-1+n),Function[\[FormalX],\[Piecewise] (2^(1-n)
\[FormalX]^(-1+1/2 (-1+n)) E^(-\[FormalX]/4))/Gamma[1/2
(-1+n)] \[FormalX]>0
0 True
,Listable]}
Bobby
On Sat, 23 Jul 2011 18:52:50 -0500, paulvonhippel at yahoo
<paulvonhippel@yahoo.com> wrote:
> I would like to define a symbol representing a random variable, and
> then use that symbol in other expressions. It's not clear to me how to
> do that. For example, when I type the following input --
>
> U = ChiSquareDistribution[n - 1]
> V = 2*U
> W = 3*U
> Mean[V]
> Mean[W]
>
> -- I do not get the mean of the random variables V and W. I know I can
> get the desired answer by typing:
>
> V = TransformedDistribution[2*U,
> U \[Distributed] ChiSquareDistribution[n - 1]]
> W = TransformedDistribution[3*U,
> U \[Distributed] ChiSquareDistribution[n - 1]]
> Mean[V]
> Mean[W]
>
> But that requires me to redefine the distribution of U every time I
> need it.
>
> Is there a way to define U just once?
>
--
DrMajorBob@yahoo.com
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: random variables DrMajorBob <btreat1@austin.rr.com> - 2011-07-24 07:20 +0000
csiph-web