Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1962 > unrolled thread
| Started by | "Tonja Krueger" <tonja.krueger@web.de> |
|---|---|
| First post | 2011-04-28 10:37 +0000 |
| Last post | 2011-04-29 11:36 +0000 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Expected value of the Geometric distribution "Tonja Krueger" <tonja.krueger@web.de> - 2011-04-28 10:37 +0000
Re: Expected value of the Geometric distribution Gary Wardall <gwardall@gmail.com> - 2011-04-29 11:30 +0000
Re: Expected value of the Geometric distribution Stefan <wutchamacallit27@gmail.com> - 2011-04-29 11:32 +0000
Re: Expected value of the Geometric distribution "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-04-29 11:32 +0000
Re: Expected value of the Geometric distribution Peter Breitfeld <phbrf@t-online.de> - 2011-04-29 11:36 +0000
| From | "Tonja Krueger" <tonja.krueger@web.de> |
|---|---|
| Date | 2011-04-28 10:37 +0000 |
| Subject | Expected value of the Geometric distribution |
| Message-ID | <ipbg1f$ahf$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | Gary Wardall <gwardall@gmail.com> |
|---|---|
| Date | 2011-04-29 11:30 +0000 |
| Message-ID | <ipe7fu$qrl$1@smc.vnet.net> |
| In reply to | #1962 |
On Apr 28, 5:37 am, "Tonja Krueger" <tonja.krue...@web.de> 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
Tonia,
I think the Geometric Distribution is discrete, in which case you
should use the Sum[ command.
Note:
Sum[(1 - p)^k*p*k, {k, 1, Infinity}]
Yields:
(1 - p)/p
Good Luck
Gary Wardall
[toc] | [prev] | [next] | [standalone]
| From | Stefan <wutchamacallit27@gmail.com> |
|---|---|
| Date | 2011-04-29 11:32 +0000 |
| Message-ID | <ipe7ju$qvg$1@smc.vnet.net> |
| In reply to | #1962 |
On Apr 28, 6:37 am, "Tonja Krueger" <tonja.krue...@web.de> 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
Tonja,
Two things to be considered. First you are on the right track
regarding the definition of expected value of a random variable. Note
that the integral though should not be an indefinite integral, but one
over whatever domain the variable takes its values from. In this case,
0 to Infinity. Your second mistake though, was to use an *integral* to
compute the expected value of a *discrete* random variable. The
geometric distribution is discrete and so any expected values should
be computed using sums, in this case from 0 to Infinity. The line
you're looking for is
Sum[(1 - p)^k*p*k, {k, 0, Infinity}]
= (1-p)/p
Hope this helps.
-Stefan S
[toc] | [prev] | [next] | [standalone]
| From | "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> |
|---|---|
| Date | 2011-04-29 11:32 +0000 |
| Message-ID | <ipe7l9$r0l$1@smc.vnet.net> |
| In reply to | #1962 |
Hi Tonja,
The problem is that this is a *discrete* probability distribution.So,
instead of integrating you need to sum the terms:
In[15]:= Sum[(1 - p)^k*p*k, {k, 1, \[Infinity]}]
Out[15]= (1 - p)/p
As of Mathematica 8 Mathematica knows a lot of distribution stuff, so you coul
also say:
In[14]:= Expectation[x, x \[Distributed] GeometricDistribution[p]]
Out[14]= (1 - p)/p
Cheers -- Sjoerd
StackOverflow for fast answers to Mathematica questions
http://stackoverflow.com/questions/tagged/mathematica
On Apr 28, 12:37 pm, "Tonja Krueger" <tonja.krue...@web.de> 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
[toc] | [prev] | [next] | [standalone]
| From | Peter Breitfeld <phbrf@t-online.de> |
|---|---|
| Date | 2011-04-29 11:36 +0000 |
| Message-ID | <ipe7r0$r5d$1@smc.vnet.net> |
| In reply to | #1962 |
"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
>
The Geometric Distribution is discrete, so you must use Sum instead of
Integrate:
Sum[(1-p)^k p k, {k,1,Infinity}]
Out= (1-p)/p
This is also the result of
Mean[GeometricDistribution[p]]
as well as of
ExpectedValue[#&,GeometricDistribution[p]]
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web