RE: Problem with HESSIAN

From: Jeroen Elassaiss-Schaap Date: June 27, 2009 technical Source: mail-archive.com
Hi Jacob, You could try to replace that part with: DEL = 0.01 IPRED= FX W = SQRT(THETA(8)**2*FX**2 + (1-TYP)*THETA(9)**2 + TYP*THETA(10)**2) IRES = DV-IPRED IWRES= IRES/(W+DEL) Reason: 1) as long as theta9/10 combination is not zero, the square root does not need protection. 2) comparing against a floating number is never a good idea, because of the mantra (residual part of a floating number that is not defined). Nonmem/fortran mostly seem to do a good job at it nevertheless. However I do not expect the result to be guaranteed to protect the division. Does this help? Jeroen Jeroen Elassaiss-Schaap, PhD Modeling & Simulation Expert Pharmacokinetics, Pharmacodynamics & Pharmacometrics (P3) Early Clinical Research and Experimental Medicine Schering-Plough Research Institute T: +31 41266 9320
Quoted reply history
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Brogren, Jacob Sent: Thursday, 25 June, 2009 10:12 To: Nmusers (E-mail) Subject: [NMusers] Problem with HESSIAN Hi all, surely a trivial, but still, problem: I get "HESSIAN OF POSTERIOR DENSITY IS NON-POSITIVE-DEFINITE DURING SEARCH" when trying to run the model (model1 below). I managed to run the ADVAN4 version (model2 below) and got successful minimization and plausible estimates, but now when I want to restate the model as defferential equations the problem occurs. What I could find out from nmusers was that this has something to do with predictions being zero (right?). I try to "protect" with the DEL variable (see code). Any suggestions? ========================================================================== Model 1 ========================================================================== $PROB Restate model using $DES $INPUT ID DAT2=DROP TIME EVID AMT DV MDV UVOL CMT DOSE FOOD OCC AGE CREA CLCR TYP $DATA ../data/data5.csv IGNORE=@ $SUBS ADVAN6 TOL=3 $MODEL COMP=DEPOT ; 1. Absorption COMP=CENTRAL ; 2. Central COMP=PERIPH ; 3. Peripheral COMP=URINE ; 4. Urine (output) $PK TVF1 = 1 TVLG = THETA(1) TVKA = THETA(2) TVCL = THETA(3) TCLR = THETA(4) TVV2 = THETA(5) TVQ = THETA(6) TVV3 = THETA(7) ALAG1 = TVLG KA = TVKA F1 = TVF1*EXP(ETA(1)) CL = TVCL CLR = TCLR V2 = TVV2 Q = TVQ V3 = TVV3 S2 = V2 S4 = UVOL $DES K23 = Q/V2 K32 = Q/V3 K24 = CLR/V2 K20 = (CL-CLR)/V2 DADT(1) = - KA*A(1) DADT(2) = KA*A(1) - K23*A(2) + K32*A(3) - K20*A(2) - K24*A(2) DADT(3) = K23*A(2) - K32*A(3) DADT(4) = K24*A(2) $ERROR CP = A(2)/S2 CUR = A(4)/S4 FX = (1-TYP)*CP + TYP*CUR DEL = 0 IF (FX.EQ.0) DEL=1 IPRED= FX W = SQRT(THETA(8)**2*FX**2 + (1-TYP)*THETA(9)**2 + TYP*THETA(10)**2 + DEL) IRES = DV-IPRED IWRES= IRES/W Y = IPRED + ERR(1)*W $THETA (0,...) ; ALAG1 (lag time) (0,...) ; KA (0,...) ; CL (0,...) ; CLR (0,...) ; V2 (0,...) ; Q (0,...) ; V3 (0,...) ; proportional error (0,...) ; additive error (plasma) (0,...) ; additive error (urine) $OMEGA 0.09 $SIGMA 1 FIX $EST PRINT=1 MAXEVAL=9999 METHOD=1 INTER POSTHOC $COV PRINT=E ========================================================================== Model 2 ========================================================================== $PROB Renal data included $INPUT ID DAT2=DROP TIME EVID AMT DV MDV UVOL CMT DOSE FOOD OCC AGE CREA CLCR TYP $DATA ../data/data4.csv IGNORE=@ $SUBS ADVAN4 TRANS4 $PK TVF1 = 1 TVLG = THETA(1) TVKA = THETA(2) TVCL = THETA(3) TCLR = THETA(4) TVV2 = THETA(5) TVQ = THETA(6) TVV3 = THETA(7) ALAG1 = TVLG*EXP(ETA(1)) KA = TVKA F1 = TVF1 CL = TVCL CLR = TCLR V2 = TVV2 Q = TVQ V3 = TVV3 F0 = CLR/CL S2 = V2 S0 = UVOL $ERROR DEL = 0 IF (F.EQ.0) DEL=1 IPRED=F W = SQRT(THETA(8)**2*FX**2 + (1-TYP)*THETA(9)**2 + TYP*THETA(10)**2 + DEL) IRES = DV-IPRED IWRES= IRES/W Y = F + ERR(1)*W $THETA (0,...) ; ALAG1 (lag time) (0,...) ; KA (0,...) ; CL (0,...) ; CLR (0,...) ; V2 (0,...) ; Q (0,...) ; V3 (0,...) ; proportional error (plasma) (0,...) ; additive error (plasma) (0,...) ; additive error (urine) $OMEGA 0.09 $SIGMA 1 FIX $EST PRINT=1 MAXEVAL=9999 METHOD=1 INTER POSTHOC $COV PRINT=E ============================================================================== Data file (data5.csv) for ADVAN6 model. First ID. ([...]=masked data) ============================================================================== ID DAT2 TIME EVID AMT DV MDV UVOL CMT [...] TYP 101 1973-07-10 08:19 2 . . 1 . 4 [...] 1 101 1973-07-10 08:21 0 . . 1 . 2 [...] 0 101 1973-07-10 08:30 1 10000 . 1 . 1 [...] 0 101 1973-07-10 08:46 0 . [...] 0 . 2 [...] 0 101 1973-07-10 09:01 0 . [...] 0 . 2 [...] 0 101 1973-07-10 09:17 0 . [...] 0 . 2 [...] 0 101 1973-07-10 09:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 10:01 0 . [...] 0 . 2 [...] 0 101 1973-07-10 10:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 11:01 0 . [...] 0 . 2 [...] 0 101 1973-07-10 11:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 12:30 0 . [...] 0 . 2 [...] 0 101 1973-07-10 14:14 0 . [...] 0 0.6 4 [...] 1 101 1973-07-10 14:14 2 . . 1 . -4 [...] 1 101 1973-07-10 14:14 2 . . 1 . 4 [...] 1 101 1973-07-10 14:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 17:30 0 . . 1 . 2 [...] 0 101 1973-07-10 20:30 0 . . 1 . 2 [...] 0 101 1973-07-10 20:44 0 . [...] 0 0.8 4 [...] 1 101 1973-07-10 20:44 2 . . 1 . -4 [...] 1 101 1973-07-10 20:44 2 . . 1 . 4 [...] 1 101 1973-07-11 08:31 0 . . 1 . 2 [...] 0 101 1973-07-11 08:51 0 . [...] 0 0.7 4 [...] 1 101 1973-07-11 08:51 2 . . 1 . -4 [...] 1 [...] ============================================================================== Data file (data4.csv) for ADVAN4 model. First ID. ([...]=masked data) ============================================================================== ID DAT2 TIME EVID AMT DV MDV UVOL CMT [...] TYP 101 1973-07-10 08:19 2 . . 1 . 4 [...] 1 101 1973-07-10 08:21 0 . . 1 . 2 [...] 0 101 1973-07-10 08:30 1 10000 . 1 . 1 [...] 0 101 1973-07-10 08:46 0 . [...] 0 . 2 [...] 0 101 1973-07-10 09:01 0 . [...] 0 . 2 [...] 0 101 1973-07-10 09:17 0 . [...] 0 . 2 [...] 0 101 1973-07-10 09:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 10:01 0 . [...] 0 . 2 [...] 0 101 1973-07-10 10:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 11:01 0 . [...] 0 . 2 [...] 0 101 1973-07-10 11:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 12:30 0 . [...] 0 . 2 [...] 0 101 1973-07-10 14:14 0 . [...] 0 0.6 -4 [...] 1 101 1973-07-10 14:14 2 . . 1 . 4 [...] 1 101 1973-07-10 14:31 0 . [...] 0 . 2 [...] 0 101 1973-07-10 17:30 0 . . 1 . 2 [...] 0 101 1973-07-10 20:30 0 . . 1 . 2 [...] 0 101 1973-07-10 20:44 0 . [...] 0 0.5 -4 [...] 1 101 1973-07-10 20:44 2 . . 1 . 4 [...] 1 101 1973-07-11 08:31 0 . . 1 . 2 [...] 0 101 1973-07-11 08:51 0 . [...] 0 0.7 -4 [...] 1 [...] ==================================================================== Best regards Jacob ------------------------------------------------- Jacob Brogren MSc Pharm Senior Research Scientist Pharmacometrics Clinical Pharmacology and DMPK AstraZeneca R&D Södertälje SE-151 85 Södertälje Sweden Tel. +46 8 553 236 33 Fax +46 8 553 274 91 [email protected] www.astrazeneca.com -------------------------------------------------------------------------- Confidentiality Notice: This message is private and may contain confidential and proprietary information. If you have received this message in error, please notify us and remove it from your system and note that you must not copy, distribute or take any action in reliance on it. Any unauthorized use or disclosure of the contents of this message is not permitted and may be unlawful. This message and any attachments are solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use or distribution of the information included in this message is prohibited --- Please immediately and permanently delete.
Jun 25, 2009 Jacob Brogren Problem with HESSIAN
Jun 27, 2009 Jeroen Elassaiss-Schaap RE: Problem with HESSIAN
Jun 27, 2009 Jeroen Elassaiss-Schaap RE: Problem with HESSIAN
Jun 29, 2009 Jacob Brogren RE: Problem with HESSIAN
Jun 29, 2009 Leonid Gibiansky Re: Problem with HESSIAN