Rounding (error=134) or obj. func. is infinite (error=136)

2 messages 2 people Latest: Apr 25, 2016
Hi, I would not be worried by rounding errors. Its more important to consider whether the parameter estimates are plausible and to evaluate the predictions using VPC. If the parameters are plausible and the VPC looks good then you can have some trust in your model. I see you are doing a joint model of tumour size and hazard. Did you satisfy yourself that the tumour size model was good before trying to estimate the hazard parameters? I would always analyse this kind of data in a sequential fashion by fitting the tumour size first then fixing the tumour size parameters then fitting the hazard with the full data (tumour and event) (see Zhang et al. 2003). Once you have got some plausible hazard estimates you can then try doing a simultaneous fit. There is usually very little point in doing a simultaneous fit. Best wishes, Nick Zhang L, Beal SL, Sheiner LB. Simultaneous vs. sequential analysis for population PK/PD data I: best-case performance. J Pharmacokinet Pharmacodyn. 2003;30(6):387-404.
Quoted reply history
On 23-Apr-16 01:37, Mai, Tu [MED] wrote: > > Dear NMUsers, > > Our model keeps having the rounding error (error4). I tried to fix > it using the following methods or their combinations, however, > sometimes I then got the message error6 instead of error4. But > minimization still unsuccessful. Can you please help pointing out how > I can solve this problem? I really appreciate it! > > Thank you > > 1) Use the estimates for THETA that are ~10% deviated from the > estimates provided after scm run. > > 2) Set TOL=9, NSIG=2, SIGL=6 > > I attached here the code: > > $PROBLEM IRM code > > $INPUT ID TIME EX DV DVID ECOG AGE HT WT RACE SITE DIAG=DROP HEM > > ALK ALB LAC TES STUDY DRUG PRIORDOC > > $DATA survival.csv > > $SUBROUTINE ADVAN13 TOL=9 > > $MODEL NCOMP=1 COMP(HAZ) > > $PK > > ;;; DECECOG-DEFINITION START > > IF(ECOG.EQ.1) DECECOG = 1 ; Most common > > IF(ECOG.EQ.0) DECECOG = ( 1 + THETA(27)) > > IF(ECOG.EQ.2) DECECOG = ( 1 + THETA(28)) > > ;;; DECECOG-DEFINITION END > > ;;; GROPRIORDOC-DEFINITION START > > IF(PRIORDOC.EQ.0) GROPRIORDOC = 1 ; Most common > > IF(PRIORDOC.EQ.1) GROPRIORDOC = ( 1 + THETA(26)) > > ;;; GROPRIORDOC-DEFINITION END > > ;;; GROECOG-DEFINITION START > > IF(ECOG.EQ.1) GROECOG = 1 ; Most common > > IF(ECOG.EQ.0) GROECOG = ( 1 + THETA(24)) > > IF(ECOG.EQ.2) GROECOG = ( 1 + THETA(25)) > > ;;; GROECOG-DEFINITION END > > ;;; GROALK-DEFINITION START > > IF(ALK.EQ.-99) THEN > > GROALK = 1 > > ELSE > > GROALK = ( 1 + THETA(23)*(ALK - 94.00)) > > ENDIF > > ;;; GROALK-DEFINITION END > > ;;; GRO-RELATION START > > GROCOV=GROALK*GROECOG*GROPRIORDOC > > ;;; GRO-RELATION END > > ;;; DECDRUG-DEFINITION START > > IF(DRUG.EQ.3) DECDRUG = 1 ; Most common > > IF(DRUG.EQ.2) DECDRUG = ( 1 + THETA(21)) > > IF(DRUG.EQ.1) DECDRUG = ( 1 + THETA(22)) > > ;;; DECDRUG-DEFINITION END > > ;;; DECAGE-DEFINITION START > > DECAGE = ( 1 + THETA(20)*(AGE - 64.00)) > > ;;; DECAGE-DEFINITION END > > ;;; DEC-RELATION START > > DECCOVCAGE*DECDRUG*DECECOG > > ;;; DEC-RELATION END > > ;;; BSLHEM-DEFINITION START > > IF(HEM.LE.124.00) BSLHEM = ( 1 + THETA(18)*(HEM - 124.00)) > > IF(HEM.GT.124.00) BSLHEM = ( 1 + THETA(19)*(HEM - 124.00)) > > IF(HEM.EQ.-99) BSLHEM = 1 > > ;;; BSLHEM-DEFINITION END > > ;;; BSLECOG-DEFINITION START > > IF(ECOG.EQ.1) BSLECOG = 1 ; Most common > > IF(ECOG.EQ.0) BSLECOG = ( 1 + THETA(16)) > > IF(ECOG.EQ.2) BSLECOG = ( 1 + THETA(17)) > > ;;; BSLECOG-DEFINITION END > > ;;; BSLALK-DEFINITION START > > IF(ALK.EQ.-99) THEN > > BSLALK = 1 > > ELSE > > BSLALK = ( 1 + THETA(15)*(ALK - 94.00)) > > ENDIF > > ;;; BSLALK-DEFINITION END > > ;;; BSL-RELATION START > > BSLCOV=BSLALK*BSLECOG*BSLHEM > > ;;; BSL-RELATION END > > ;;; BSHZPRIORDOC-DEFINITION START > > IF(PRIORDOC.EQ.0) BSHZPRIORDOC = 1 ; Most common > > IF(PRIORDOC.EQ.1) BSHZPRIORDOC = ( 1 + THETA(14)) > > ;;; BSHZPRIORDOC-DEFINITION END > > ;;; BSHZALK-DEFINITION START > > IF(ALK.EQ.-99) THEN > > BSHZALK = 1 > > ELSE > > BSHZALK = ( 1 + THETA(13)*(ALK - 94.00)) > > ENDIF > > ;;; BSHZALK-DEFINITION END > > ;;; BSHZ-RELATION START > > BSHZCOV=BSHZALK*BSHZPRIORDOC > > ;;; BSHZ-RELATION END > > ;;; BETAHEM-DEFINITION START > > IF(HEM.EQ.-99) THEN > > BETAHEM = 1 > > ELSE > > BETAHEM = ( 1 + THETA(12)*(HEM - 124.00)) > > ENDIF > > ;;; BETAHEM-DEFINITION END > > ;;; BETAECOG-DEFINITION START > > IF(ECOG.EQ.1) BETAECOG = 1 ; Most common > > IF(ECOG.EQ.0) BETAECOG = ( 1 + THETA(10)) > > IF(ECOG.EQ.2) BETAECOG = ( 1 + THETA(11)) > > ;;; BETAECOG-DEFINITION END > > ;;; BETADRUG-DEFINITION START > > IF(DRUG.EQ.3) BETADRUG = 1 ; Most common > > IF(DRUG.EQ.2) BETADRUG = ( 1 + THETA(8)) > > IF(DRUG.EQ.1) BETADRUG = ( 1 + THETA(9)) > > ;;; BETADRUG-DEFINITION END > > ;;; BETAAGE-DEFINITION START > > BETAAGE = ( 1 + THETA(7)*(AGE - 64.00)) > > ;;; BETAAGE-DEFINITION END > > ;;; BETA-RELATION START > > BETACOVTAAGE*BETADRUG*BETAECOG*BETAHEM > > ;;; BETA-RELATION END > > IF (NEWIND.LE.1) THEN > > SRVZ=1 ; Survivor function at TIME=0 > > ENDIF > > ;-----------BASELINE PSA-------------- > > TVBSL = THETA(1) > > TVBSL = BSLCOV*TVBSL > > BSL = TVBSL*EXP(ETA(1)) > > ;-----------PSA PARAMETERS-------------- > > TVGRO = THETA(2) > > TVGRO = GROCOV*TVGRO > > TVDEC = THETA(3) > > TVDEC = DECCOV*TVDEC > > GRO = TVGRO*EXP(ETA(2)) > > DEC = TVDEC*EXP(ETA(3)) > > ;-----------SURVIVAl MODEL PARAMETERS-------------- > > TVBSHZ = THETA(5) ; Baseline Hazard > > TVBSHZ = BSHZCOV*TVBSHZ > > BSHZ = TVBSHZ > > TVBETA = THETA(6) ; Parameter relating dropout hazard to PSA estimate > > TVBETA = BETACOV*TVBETA > > BETA = TVBETA > > $DES > > DSIZE = LOG(BSL*(EXP(-DEC*TIME) + EXP(GRO*TIME) - 1)+1) > > TEMP = BETA*DSIZE > > DADT(1) = BSHZ*EXP(TEMP) > > $ERROR > > IF (DVID.EQ.1) THEN > > F_FLAG=0 ; If continuous type data > > SIZE = LOG(BSL*(EXP(-DEC*TIME) + EXP(GRO*TIME) - 1)+1) > > IPRED = SIZE > > ADD = THETA(4) > > SDSIZE = SQRT(ADD*ADD) > > Y = SIZE + SDSIZE*EPS(1) > > W = Y > > IRES = DV-IPRED > > IWRES = IRES/(W) > > ENDIF > > ;-----------HAZARD PREDICTION-------------- > > CMHZ = A(1) > > SRVT = EXP(-CMHZ) > > IF (DVID.EQ.2.AND.DV.EQ.0) THEN > > F_FLAG=1 > > Y = SRVT > > ENDIF > > IF (DVID.EQ.2.AND.DV.EQ.1) THEN > > F_FLAG=1 > > Y = SRVZ-SRVT > > ENDIF > > $THETA (50,85,150) ; POP_BSL > > (0,0.0004,0.1) ; POP_GRO > > (0,0.02,0.1) ; POP_DEC > > (0,0.3,0.35) ; ADD_SD > > (0,0.0009,0.0014) ; BSHZ > > (0.1,0.3,0.7) ; BETA > > $THETA (-0.038,-0.003,0.016) ; BETAAGE1 > > $THETA (-1,0.3,5) ; BETADRUG1 > > (-1,0.1,5) ; BETADRUG2 > > $THETA (-1,-0.2,5) ; BETAECOG1 > > (-1,0.3,5) ; BETAECOG2 > > $THETA (-0.023,-0.01,0.016) ; BETAHEM1 > > $THETA (0,0.001,0.010) ; BSHZALK1 > > $THETA (-1,-0.4,5) ; BSHZPRIORDOC1 > > $THETA (0,0.002,0.010) ; BSLALK1 > > $THETA (-1,-0.3,5) ; BSLECOG1 > > (-1,0.2,5) ; BSLECOG2 > > $THETA (-1000000,-0.05,0.016) ; BSLHEM1 > > (-0.023,-0.0002,100) ; BSLHEM2 > > $THETA (-0.038,-0.0009,0.016) ; DECAGE1 > > $THETA (-1,-0.6,5) ; DECDRUG1 > > (-1,-0.8,5) ; DECDRUG2 > > $THETA (0,98E-006,0.010) ; GROALK1 > > $THETA (-1,-0.02,5) ; GROECOG1 > > (-1,0.5,5) ; GROECOG2 > > $THETA (-1,5,7) ; GROPRIORDOC1 > > $THETA (-1,0.0004,5) ; DECECOG1 > > (-1,-0.2,5) ; DECECOG2 > > $OMEGA 2.5 ; PPV_BSL > > 2 ; PPV_GRO > > 1.5 ; PPV_DEC > > ;------------------------- > > $SIGMA 1. FIX > > ;------------------------- > > $ESTIMATION METHOD=COND INTER NUMERICAL LAPLACE SLOW MAX99 NSIG=2 > > SIGL=6 NOABORT PRINT=5 > > $COVARIANCE > > $TABLE ID TIME IPRED BSL GRO DEC STUDY DRUG WRES CWRES ETA1 ETA2 > > ETA3 ONEHEADER NOPRINT > > FILE=C:\Users\fulldata.tab > > $TABLE ID TIME PRED RES WRES ONEHEADER NOPRINT > > FILE=C:\Users\original.tab > > ******************************************************************************** > This e-mail is intended only for the use of the individual or entity > to which > it is addressed and may contain information that is privileged and > confidential. > If the reader of this e-mail message is not the intended recipient, > you are > hereby notified that any dissemination, distribution or copying of this > communication is prohibited. If you have received this e-mail in > error, please > notify the sender and destroy all copies of the transmittal. > > Thank you > University of Chicago Medicine and Biological Sciences > ******************************************************************************** -- 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 office:+64(9)923-6730 mobile:NZ+64(21)46 23 53 FR+33(6)62 32 46 72 email: n.holford_at_auckland.ac.nz http://holford.fmhs.auckland.ac.nz/ "Declarative languages are a form of dementia -- they have no memory of events" Holford SD, Allegaert K, Anderson BJ, Kukanich B, Sousa AB, Steinman A, Pypendop, B., Mehvar, R., Giorgi, M., Holford,N.H.G. Parent-metabolite pharmacokinetic models - tests of assumptions and predictions. Journal of Pharmacology & Clinical Toxicology. 2014;2(2):1023-34. Holford N. Clinical pharmacology = disease progression + drug action. Br J Clin Pharmacol. 2015;79(1):18-27.
Dear Leonid and Nick, Thank you very much for your inputs! We will work on our model with your suggestions. Thank you! Tu Sent from my iOS device
Quoted reply history
On Apr 22, 2016, at 9:14 PM, Leonid Gibiansky <lgibiansky_at_quantpharm.com<mailto:lgibiansky_at_quantpharm.com>> wrote: In $DES block I this expression DSIZE = LOG(BSL*(EXP(-DEC*TIME) + EXP(GRO*TIME) - 1)+1) I would use T rather than TIME You may also try tol nsig=4 sign Leonid On Apr 22, 2016, at 1:37 PM, Mai, Tu [MED] <tmai1_at_medicine.bsd.uchicago.edu<mailto:tmai1_at_medicine.bsd.uchicago.edu>> wrote: Dear NMUsers, Our model keeps having the rounding error (error4). I tried to fix it using the following methods or their combinations, however, sometimes I then got the message error6 instead of error4. But minimization still unsuccessful. Can you please help pointing out how I can solve this problem? I really appreciate it! Thank you 1) Use the estimates for THETA that are ~10% deviated from the estimates provided after scm run. 2) Set TOL=9, NSIG=2, SIGL=6 I attached here the code: $PROBLEM IRM code $INPUT ID TIME EX DV DVID ECOG AGE HT WT RACE SITE DIAG=DROP HEM ALK ALB LAC TES STUDY DRUG PRIORDOC $DATA survival.csv $SUBROUTINE ADVAN13 TOL=9 $MODEL NCOMP=1 COMP(HAZ) $PK ;;; DECECOG-DEFINITION START IF(ECOG.EQ.1) DECECOG = 1 ; Most common IF(ECOG.EQ.0) DECECOG = ( 1 + THETA(27)) IF(ECOG.EQ.2) DECECOG = ( 1 + THETA(28)) ;;; DECECOG-DEFINITION END ;;; GROPRIORDOC-DEFINITION START IF(PRIORDOC.EQ.0) GROPRIORDOC = 1 ; Most common IF(PRIORDOC.EQ.1) GROPRIORDOC = ( 1 + THETA(26)) ;;; GROPRIORDOC-DEFINITION END ;;; GROECOG-DEFINITION START IF(ECOG.EQ.1) GROECOG = 1 ; Most common IF(ECOG.EQ.0) GROECOG = ( 1 + THETA(24)) IF(ECOG.EQ.2) GROECOG = ( 1 + THETA(25)) ;;; GROECOG-DEFINITION END ;;; GROALK-DEFINITION START IF(ALK.EQ.-99) THEN GROALK = 1 ELSE GROALK = ( 1 + THETA(23)*(ALK - 94.00)) ENDIF ;;; GROALK-DEFINITION END ;;; GRO-RELATION START GROCOV=GROALK*GROECOG*GROPRIORDOC ;;; GRO-RELATION END ;;; DECDRUG-DEFINITION START IF(DRUG.EQ.3) DECDRUG = 1 ; Most common IF(DRUG.EQ.2) DECDRUG = ( 1 + THETA(21)) IF(DRUG.EQ.1) DECDRUG = ( 1 + THETA(22)) ;;; DECDRUG-DEFINITION END ;;; DECAGE-DEFINITION START DECAGE = ( 1 + THETA(20)*(AGE - 64.00)) ;;; DECAGE-DEFINITION END ;;; DEC-RELATION START DECCOVCAGE*DECDRUG*DECECOG ;;; DEC-RELATION END ;;; BSLHEM-DEFINITION START IF(HEM.LE.124.00) BSLHEM = ( 1 + THETA(18)*(HEM - 124.00)) IF(HEM.GT.124.00) BSLHEM = ( 1 + THETA(19)*(HEM - 124.00)) IF(HEM.EQ.-99) BSLHEM = 1 ;;; BSLHEM-DEFINITION END ;;; BSLECOG-DEFINITION START IF(ECOG.EQ.1) BSLECOG = 1 ; Most common IF(ECOG.EQ.0) BSLECOG = ( 1 + THETA(16)) IF(ECOG.EQ.2) BSLECOG = ( 1 + THETA(17)) ;;; BSLECOG-DEFINITION END ;;; BSLALK-DEFINITION START IF(ALK.EQ.-99) THEN BSLALK = 1 ELSE BSLALK = ( 1 + THETA(15)*(ALK - 94.00)) ENDIF ;;; BSLALK-DEFINITION END ;;; BSL-RELATION START BSLCOV=BSLALK*BSLECOG*BSLHEM ;;; BSL-RELATION END ;;; BSHZPRIORDOC-DEFINITION START IF(PRIORDOC.EQ.0) BSHZPRIORDOC = 1 ; Most common IF(PRIORDOC.EQ.1) BSHZPRIORDOC = ( 1 + THETA(14)) ;;; BSHZPRIORDOC-DEFINITION END ;;; BSHZALK-DEFINITION START IF(ALK.EQ.-99) THEN BSHZALK = 1 ELSE BSHZALK = ( 1 + THETA(13)*(ALK - 94.00)) ENDIF ;;; BSHZALK-DEFINITION END ;;; BSHZ-RELATION START BSHZCOV=BSHZALK*BSHZPRIORDOC ;;; BSHZ-RELATION END ;;; BETAHEM-DEFINITION START IF(HEM.EQ.-99) THEN BETAHEM = 1 ELSE BETAHEM = ( 1 + THETA(12)*(HEM - 124.00)) ENDIF ;;; BETAHEM-DEFINITION END ;;; BETAECOG-DEFINITION START IF(ECOG.EQ.1) BETAECOG = 1 ; Most common IF(ECOG.EQ.0) BETAECOG = ( 1 + THETA(10)) IF(ECOG.EQ.2) BETAECOG = ( 1 + THETA(11)) ;;; BETAECOG-DEFINITION END ;;; BETADRUG-DEFINITION START IF(DRUG.EQ.3) BETADRUG = 1 ; Most common IF(DRUG.EQ.2) BETADRUG = ( 1 + THETA(8)) IF(DRUG.EQ.1) BETADRUG = ( 1 + THETA(9)) ;;; BETADRUG-DEFINITION END ;;; BETAAGE-DEFINITION START BETAAGE = ( 1 + THETA(7)*(AGE - 64.00)) ;;; BETAAGE-DEFINITION END ;;; BETA-RELATION START BETACOVTAAGE*BETADRUG*BETAECOG*BETAHEM ;;; BETA-RELATION END IF (NEWIND.LE.1) THEN SRVZ=1 ; Survivor function at TIME=0 ENDIF ;-----------BASELINE PSA-------------- TVBSL = THETA(1) TVBSL = BSLCOV*TVBSL BSL = TVBSL*EXP(ETA(1)) ;-----------PSA PARAMETERS-------------- TVGRO = THETA(2) TVGRO = GROCOV*TVGRO TVDEC = THETA(3) TVDEC = DECCOV*TVDEC GRO = TVGRO*EXP(ETA(2)) DEC = TVDEC*EXP(ETA(3)) ;-----------SURVIVAl MODEL PARAMETERS-------------- TVBSHZ = THETA(5) ; Baseline Hazard TVBSHZ = BSHZCOV*TVBSHZ BSHZ = TVBSHZ TVBETA = THETA(6) ; Parameter relating dropout hazard to PSA estimate TVBETA = BETACOV*TVBETA BETA = TVBETA $DES DSIZE = LOG(BSL*(EXP(-DEC*TIME) + EXP(GRO*TIME) - 1)+1) TEMP = BETA*DSIZE DADT(1) = BSHZ*EXP(TEMP) $ERROR IF (DVID.EQ.1) THEN F_FLAG=0 ; If continuous type data SIZE = LOG(BSL*(EXP(-DEC*TIME) + EXP(GRO*TIME) - 1)+1) IPRED = SIZE ADD = THETA(4) SDSIZE = SQRT(ADD*ADD) Y = SIZE + SDSIZE*EPS(1) W = Y IRES = DV-IPRED IWRES = IRES/(W) ENDIF ;-----------HAZARD PREDICTION-------------- CMHZ = A(1) SRVT = EXP(-CMHZ) IF (DVID.EQ.2.AND.DV.EQ.0) THEN F_FLAG=1 Y = SRVT ENDIF IF (DVID.EQ.2.AND.DV.EQ.1) THEN F_FLAG=1 Y = SRVZ-SRVT ENDIF $THETA (50,85,150) ; POP_BSL (0,0.0004,0.1) ; POP_GRO (0,0.02,0.1) ; POP_DEC (0,0.3,0.35) ; ADD_SD (0,0.0009,0.0014) ; BSHZ (0.1,0.3,0.7) ; BETA $THETA (-0.038,-0.003,0.016) ; BETAAGE1 $THETA (-1,0.3,5) ; BETADRUG1 (-1,0.1,5) ; BETADRUG2 $THETA (-1,-0.2,5) ; BETAECOG1 (-1,0.3,5) ; BETAECOG2 $THETA (-0.023,-0.01,0.016) ; BETAHEM1 $THETA (0,0.001,0.010) ; BSHZALK1 $THETA (-1,-0.4,5) ; BSHZPRIORDOC1 $THETA (0,0.002,0.010) ; BSLALK1 $THETA (-1,-0.3,5) ; BSLECOG1 (-1,0.2,5) ; BSLECOG2 $THETA (-1000000,-0.05,0.016) ; BSLHEM1 (-0.023,-0.0002,100) ; BSLHEM2 $THETA (-0.038,-0.0009,0.016) ; DECAGE1 $THETA (-1,-0.6,5) ; DECDRUG1 (-1,-0.8,5) ; DECDRUG2 $THETA (0,98E-006,0.010) ; GROALK1 $THETA (-1,-0.02,5) ; GROECOG1 (-1,0.5,5) ; GROECOG2 $THETA (-1,5,7) ; GROPRIORDOC1 $THETA (-1,0.0004,5) ; DECECOG1 (-1,-0.2,5) ; DECECOG2 $OMEGA 2.5 ; PPV_BSL 2 ; PPV_GRO 1.5 ; PPV_DEC ;------------------------- $SIGMA 1. FIX ;------------------------- $ESTIMATION METHOD=COND INTER NUMERICAL LAPLACE SLOW MAX99 NSIG=2 SIGL=6 NOABORT PRINT=5 $COVARIANCE $TABLE ID TIME IPRED BSL GRO DEC STUDY DRUG WRES CWRES ETA1 ETA2 ETA3 ONEHEADER NOPRINT FILE=C:\Users\fulldata.tab $TABLE ID TIME PRED RES WRES ONEHEADER NOPRINT FILE=C:\Users\original.tab ******************************************************************************** This e-mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged and confidential. If the reader of this e-mail message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is prohibited. If you have received this e-mail in error, please notify the sender and destroy all copies of the transmittal. Thank you University of Chicago Medicine and Biological Sciences ******************************************************************************** ******************************************************************************** This e-mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged and confidential. If the reader of this e-mail message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is prohibited. If you have received this e-mail in error, please notify the sender and destroy all copies of the transmittal. Thank you University of Chicago Medicine and Biological Sciences ********************************************************************************