Re: Expected value of the Geometric distribution
- To: mathgroup at smc.vnet.net
- Subject: [mg118457] Re: Expected value of the Geometric distribution
- From: Andy Ross <andyr at wolfram.com>
- Date: Fri, 29 Apr 2011 07:28:56 -0400 (EDT)
On 4/28/2011 5:37 AM, Tonja Krueger wrote: > Hi all, > I want to calculate expected value of diverse distributions like the Geometric distribution (for example). > As I understand this, the expected value is the integral of the density function *x. > But when I try to calculate this: > Integrate[(1-p)^k*p*k,k] > I get this as the answer: > ((1 - p)^k p (-1 + k Log[1 - p]))/Log[1 - p]^2 > Instead of: (1-p)/p. > I would be so grateful if someone could explain to me what I'm doing wrong. > Tonja > ___________________________________________________________ > Empfehlen Sie WEB.DE DSL Ihren Freunden und Bekannten und wir > belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.web.de > Well, the biggest issue you are having is that Geometric distribution is a discrete distribution and so expectations are defined as summations. Once we set up the sum we need to make sure that we are summing over the correct region. In this case, k can only take on integer values greater than or equal to zero. Setting all of this up we get... In[21]:= Sum[k (1 - p)^k p, {k, 0, \[Infinity]}] Out[21]= (1 - p)/p This particular problem is exactly the reason for functions like Expectation in Mathematica 8. Expectation knows all of the various properties of these distributions so it sets things up correctly for you.. In[23]:= Expectation[k,Distributed[k,GeometricDistribution[p]]] Out[23]= (1-p)/p If you are always just wanting the mean you can just as well use Mean. In[25]:= Mean[GeometricDistribution[p]] //Together Out[25]= (1-p)/p -Andy