RE: Mixture model simulation

From: Robert Bauer Date: January 26, 2013 technical Source: mail-archive.com
I have studied the code and here is what I have found, and is based on the ICALL value: ICALL=2 (Estimation) MIXNUM is sequentially set by NONMEM during optimization, so the user's model may be called with each of the sub-population possibilities, so NONMEM may calculate objective function values for each sub-population model, for each subject. At this stage, NONMEM does not yet know which sub-population model fits this subject best, so MIXEST is not set yet, and not valid, and will have nothing to do with wthe final table output's MIXEST. Basically, MIXEST is undefined at this stage. ICALL=3 (Estimation is completed, and Table contents are constructed) MIXEST is set to the most likely sub-population that the subject belongs to, based on the one with the smallest objective function (actually, based on greatest mixp*exp(-OBJ), where mixp=the sub-population proportion modeled in $MIX). It is also the MIXEST that is used for table output. ICALL=4 (Simulation) MIXNUM is set to the sub-population that the simulater has chosen (randomly) for a given subject. So, MIXNUM is an input controlled by NONMEM. And MIXEST is an output (result) or consequence from the estimation. I am not sure making MIXEST equal to MIXNUM would be a good idea under all circumstances. But I will look into synchronizing these two variables where it makes sense to do so. One possibility is to set MIXEST=MIXNUM during simulation (ICALL=4), set MIXEST=-1 to indicate it is unavailable during estimation (ICALL=2). Robert J. Bauer, Ph.D. Vice President, Pharmacometrics, R&D ICON Development Solutions 7740 Milestone Parkway Suite 150 Hanover, MD 21076 Tel: (215) 616-6428 Mob: (925) 286-0769 Email: [email protected] Web: www.iconplc.com
Quoted reply history
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Nick Holford Sent: Friday, January 25, 2013 4:00 PM To: nmusers Subject: Re: [NMusers] Mixture model simulation Tom (and others), Thanks for your replies and suggestions. I've looked at the behaviour of both MIXNUM and MIXEST. As Tom stated it seems that MIXNUM describes the individual mixture subpopulation. Each simulated individual has an apparently randomly chosen value of MIXNUM. MIXEST has always the same value for each subproblem but varies apparently randomly across subproblems(i.e. replicates described by IREP). With a seed of 1 the distribution of MIXNUM when P(1)=0.1 has a simulated frequency across 100,000 individuals of 0.09761. However MIXEST is only approximate with a frequency across 100 subproblems of 0.08. The results were similar using a random number seed of 20130126 (see example code below). The MIXNUM frequency was 0.10039 and MIXEST frequency was 0.12. What MIXEST is doing seems rather strange. If it was set to be the same as MIXNUM when doing simulations it would make more sense to me because then it would have exactly the same meaning as it does for estimation i.e. it is the value of MIXNUM used to make the predictions that appear in $TABLE. Suggestion for the next version of NONMEM - change the behaviour of MIXEST when doing simulation and document the behaviour of MIXNUM and MIXEST more clearly. Best wishes, Nick $PROB mixtest $DATA mixtest.csv $INPUT ID DV $THETA 0.1 $OMEGA 0 FIX $SIGMA 1 FIX $PRED IF (NEWIND.LE.1) THEN MIXE=99 MIXN=999 ENDIF IF (ICALL.EQ.4) THEN MIXE=MIXEST MIXN=MIXNUM ENDIF REP=IREP Y=THETA(1)+ETA(1)+EPS(1) $MIX NSPOP=2 P(1)=THETA(1) P(2)=1-THETA(1) $TABLE REP ID MIXE MIXN NOAPPEND ONEHEADER NOPRINT FILE=mixtest.fit $SIM (20130126) ONLYSIM NSUB=100 On 26/01/2013 1:41 a.m., Ludden, Thomas wrote: > Hi Nick, > > NONMEM chooses a random MIXNUM for simulating a given subject based on the > MIXP values describing the whole population. As I recall, when doing only > simulation, one needs to output MIXNUM, i.e. MIXE=MIXNUM, to obtain the > subpopulation for a given individual. I did not varify this but if you find > this to be correct please post to nmusers. Since there is no estimation, I > am not certain what value MIXEST will have for each individual. > > Best wishes, > > Tom Ludden > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of Nick Holford > Sent: Friday, January 25, 2013 2:51 AM > To: nmusers > Subject: [NMusers] Mixture model simulation > > Hi, > > I've been puzzled by the behaviour of NONMEM when trying to simulate > with a mixture model. > The data file has 1000 subjects. I simulate 100 times (see control > stream below). > The overall number of subjects with MIXEST of 1 is 45%. There are no > simulated values of 99. All values are either 1 or 2. > I would expect about 50% of subjects to have MIXEST=1 in each replication. > There are many replications of 1000 subjects which do not have MIXEST=2. > This occurs with NONMEM 7.2.0 and both Intel and gfortran compilers. > What is the expected behaviour of MIXEST when ICALL.EQ.4? > > Nick > > -------mixtest.ctl--------- > $PROB mixbug > $DATA mixtest.csv > $INPUT ID DV > $THETA > 0.5 > $OMEGA 0 FIX > $SIGMA 1 FIX > $PRED > IF (NEWIND.LE.1) MIXE=99 > IF (ICALL.EQ.4) MIXE=MIXEST > REP=IREP > Y=THETA(1)+ETA(1)+EPS(1) > $MIX > NSPOP=2 > P(1)=THETA(1) > P(2)=1-THETA(1) > $TABLE REP ID MIXE > NOAPPEND ONEHEADER NOPRINT FILE=mixbug.fit > $SIM (1) ONLYSIM NSUB=100 > -----mixtest.csv---- > > #ID, DV > 1,. > 2,. > ... > 1000,. > -- Nick Holford, Professor Clinical Pharmacology Dept Pharmacology & Clinical Pharmacology, Bldg 503 Room 302A University of Auckland,85 Park Rd,Private Bag 92019,Auckland,New Zealand tel:+64(9)923-6730 fax:+64(9)373-7090 mobile:+64(21)46 23 53 email: [email protected] http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford
Jan 25, 2013 Nick Holford Mixture model simulation
Jan 25, 2013 Erik Olofsen RE: Mixture model simulation
Jan 26, 2013 Robert Bauer RE: Mixture model simulation