From p.dalgaard at biostat.ku.dk  Tue Aug 16 21:53:26 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 16 Aug 2005 21:53:26 +0200
Subject: [Rd] quirky behavior from rbinom (PR#8071)
In-Reply-To: <20050816191151.1F50B18B97@slim.kubism.ku.dk>
References: <20050816191151.1F50B18B97@slim.kubism.ku.dk>
Message-ID: <x2oe7xr749.fsf@turmalin.kubism.ku.dk>

cpaulse at aecom.yu.edu writes:

> Full_Name: Chris Paulse
> Version: 2.1.1
> OS: WinXP
> Submission from: (NULL) (129.98.60.134)
> 
> 
> This seems strange.  I have a small block of code that repeatedly calls rbinom. 
> I put a break in there in case it returns NaN, as I've been having problems with
> this.  Here is a transcript from the debug session:
> 
> Browse[1]> theP
> [1] 1
> Browse[1]> yleft[dataIndex]
> [1] 3
> Browse[1]> rbinom(1,3,1)
> [1] 3
> Browse[1]> rbinom(1,yleft[dataIndex], theP)
> [1] NaN
> 
> Strange, huh?

What is "theP - 1"?

> rbinom(1,3,1+1e-10)
[1] NaN
> 1+1e-10
[1] 1



-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] quirky behavior from rbinom (PR#8071)
Peter Dalgaard