Simulation problem of normal distributed data
Dear NMuser,
I encountered a strange problem when I used the following code to simulate
normal distributed data. When the data records >797, no result appears with
NONMEM run into an infinite loop . But when the records decreasing to 796
(delete the last row), the results will occurred immediately. Anyone else
met this phenomenon? Any comments and suggestions are appreciated. Thank
you in advance.
$PROBLEM PD
$INPUT ID,CONC,DV
$DATA data.csv IGNORE=@ ;
$PRED
NMEAN=THETA(1)+ETA(1)
SD=THETA(2)
;Simulate count
IF (ICALL.EQ.4) THEN
N=0
PRN=0
CALL RANDOM(2, R)
RL=1-R
DO WHILE (RL .GT. PRN)
LNNOR=LOG(6.283185)+2*LOG(SD)+((N-NMEAN)/SD)**2
PY=EXP(-0.5*LNNOR)
PRN=PRN+PY
IF (PRN .LT. RL) N=N+1
ENDDO
DV=N
ENDIF
$THETA
(30,41.7,60) ;MEAN
(2,14.4,50) ;SD
$OMEGA
0 FIX ;MEAN
$SIMULATION (6446) (7545 UNIFORM) ONLYSIM NOPRED SUB=1
$TABLE ID TIME DV ONEHEADER NOPRINT FILE=npctab1.dta
data.csv like this
ID CONC DV
1 0 .
1 0 .
1 0 .
1 0 .
1 0 .
1 0.01 .
1 0.01 .
1 0.01 .
1 0.01 .
1 0.01 .
.....
Yucheng Sheng
Research Associate
School of Pharmacy, UCL