Mats,
Thanks for pointing out that R and 1-R are equivalent when R is a
uniform 0-1 random deviate.
There is an NM-TRAN example using 1-R in this paper:
Frame B, Miller R, Lalonde RL. Evaluation of Mixture Modeling with Count
Data
using NONMEM. Journal of Pharmacokinetics and Pharmacodynamics.
2003;30(3):167-83.
I have to admit to having cut and pasted this example and used it to
show others how to simulate count data so it may have propogated that
way too.
Do you know of a clear explanation of why this simple algorithm produces
Poisson distribution samples?
Nick
Mats Karlsson wrote:
Dear both,
You have both simulated count data using the code below (or very
similar). My question is why do you use LOG(1-R) rather than the
simpler LOG(R)? If you’ve done it because you inherited the code,
where did you get the code.
*IF (ICALL.EQ.4) THEN*
* T=0*
* N=0*
* DO WHILE (T.LT.1)*
* CALL RANDOM (2,R)*
* T=T-LOG(1-R)/LAMB*
* IF (T.LT.1) N=N+1*
* END DO*
* DV=N*
*ENDIF*
Best regards,
Mats
Mats Karlsson, PhD
Professor of Pharmacometrics
Dept of Pharmaceutical Biosciences
Uppsala University
Box 591
751 24 Uppsala Sweden
phone: +46 18 4714105
fax: +46 18 471 4003
--
Nick Holford, Professor Clinical Pharmacology
Dept Pharmacology & Clinical Pharmacology
University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand
n.holf...@auckland.ac.nz tel:+64(9)923-6730 fax:+64(9)373-7090
mobile: +64 21 46 23 53
http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford