Skip to content
Back to formatted view

Raw Message

Message-ID: <4E9A465E.1070005@xtra.co.nz>
Date: 2011-10-16T02:50:06Z
From: Rolf Turner
Subject: rpois > 0
In-Reply-To: <19ADBED5-1964-4C87-BE4C-50B973C08F9C@gmail.com>

On 16/10/11 03:45, peter dalgaard wrote:
> On Oct 15, 2011, at 01:44 , Rolf Turner wrote:
>
>> On 15/10/11 10:15, knut-o wrote:
>>> Hello
>>> what is the easiest way to generate rpois(m,lambda) but only values greater
>>> than 0 and length = m.
>>> tanks, knut
>> The rpospois() function from the VGAM package is what you are looking for.
>>
> Or,
>
> qpois(runif(m,dpois(0,lambda),1),lambda)
>
> should do the trick.

Well shut a bruck, as we say in New Zilland!  How bleedin' simple.
And obvious --- once it's been pointed out! :-)

     cheers,

         Rolf