Skip to content
Prev 87078 / 398506 Next

discrete probability distribution

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