Skip to content
Back to formatted view

Raw Message

Message-ID: <1BDB3E41-0FC6-4B26-A610-080CCB8E0E5F@soc.soton.ac.uk>
Date: 2006-02-23T08:09:55Z
From: robin hankin
Subject: 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