Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3769

Re: Expectation function

From Darren Glosemeyer <darreng@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Expectation function
Date 2011-07-16 09:51 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ivrmu9$88d$1@smc.vnet.net> (permalink)
References <201107150119.VAA23653@smc.vnet.net>

Show all headers | View raw


On 7/14/2011 8:19 PM, paulvonhippel at yahoo wrote:
> I'm having a little trouble with the Expectation function in
> Mathematica. I'd like to calculate the expectation of the product of
> two independent variables. One has a standard normal distribution, the
> other is distributed F. It's obvious that the expectation is zero, but
> when I put the problem to Mathematica, all it does is echo the input.
> Here's the simplest way I've put the question:
>
>   Expectation[Z* F, F \[Distributed] FRatioDistribution[df, df], Z \
> [Distributed] NormalDistribution[0, 1]]
>
> Mathematica just echoes the input. I try adding some assumptions to
> ensure that the variance of the F distribution is defined.
>
>   Assuming[{df>= 3, df \[Element] Integers}, %]
>
> And Mathematica just echoes the input again.
>
> The other way to do this is to use TransformedDistribution and then
> use Mean. I get the same result that way.
>
> The problem I actually want to solve is more complicated, of course,
> but today I'll settle for solving the easier version. Many thanks for
> any pointers.
>

The \[Distributed] statements need to be given in a list. With that 
modification, you'll get a correct result:

In[1]:= Expectation[Z*F, {F \[Distributed] FRatioDistribution[df, df], Z 
\[Distributed] NormalDistribution[0, 1]}]

Out[1]= 0


Darren Glosemeyer
Wolfram Research

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Expectation function Darren Glosemeyer <darreng@wolfram.com> - 2011-07-16 09:51 +0000

csiph-web