MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot PDF of a Discrete Random Variable

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63775] Re: [mg63761] Plot PDF of a Discrete Random Variable
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 14 Jan 2006 02:32:16 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Needs["Statistics`"];

{n=9, p=Random[]/2+1/4}

dist=BinomialDistribution[n, p];

v=Table[{k, PDF[dist, k]}, {k, 0, n}];

{Total[v[[All, 2]]], Mean[dist], StandardDeviation[dist]}

Show[Graphics[{Red, AbsoluteThickness[2],
        Line[{#, {1, 0}#}]&/@v}], Axes->True];


Bob Hanlon

> 
> From: Thomas Madden <thomas.madden at sbcglobal.net>
To: mathgroup at smc.vnet.net
> Subject: [mg63775] [mg63761] Plot PDF of a Discrete Random Variable
> 
> What is the best way, or the typical way, to plot the PDF of a discrete
> random variable? Binomial for example.
> 
> Thanks for any help.
> 
> 


  • Prev by Date: Re: How to create {{x1,y1}, ..., {xn,yn}} data from {x1,...,xn} and {y1, ..., yn}
  • Next by Date: Re: How to create {{x1,y1}, ..., {xn,yn}} data from {x1,...,xn} and {y1, ..., yn}
  • Previous by thread: Re: Plot PDF of a Discrete Random Variable
  • Next by thread: Re: Plot PDF of a Discrete Random Variable