[R] discrete probability distribution

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Thu 23 Feb 2006 - 19:09:55 EST


Hi

I want to sample from a discrete random variable X, defined on the non-negative integers, with

prob(X=0) = (1-p)
prob(X=1) = (1-p)*p
...

prob(X=i)=(1-p)*p^i
...

Before reinventing the wheel,
is there a ready-made R function to give me such a thing?

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Feb 23 19:22:26 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:39 EST