+--------------------------------------------------------------------+
 |                                                                    |
 |            OBJECTIVE FUNCTION VALUE INDIVIDUAL EXAMPLE             |
 |                                                                    |
 +--------------------------------------------------------------------+

 Note:  With NONMEM 7, the additional output file root.phi contains the
 same information.
 (See additional_output_file).

 This example illustrates how individual contributions to the objective
 function may be obtained.
 (See Objective Function Value Individual).

 This  example  is a modification of CONTROL4 from the NONMEM distribu-
 tion media.  It is for NONMEM VI 2.0 and later.

 $PROB  THEOPHYLLINE   POPULATION DATA
 $INPUT      ID DOSE TIME CP=DV WT
 $DATA       THEO
 $PRED
 ;THETA(1)=MEAN ABSORPTION RATE CONSTANT (1/HR)
 ;THETA(2)=MEAN ELIMINATION RATE CONSTANT (1/HR)
 ;THETA(3)=SLOPE OF CLEARANCE VS WEIGHT RELATIONSHIP (LITERS/HR/KG)
 ;DOSE=WT-ADJUSTED DOSE (MG/KG)
 ;DS=NON-WT-ADJUSTED DOSE (MG)
    IF (DOSE.NE.0) THEN
       DS=DOSE*WT
       W=WT
    ENDIF
    KA=THETA(1)+ETA(1)
    KE=THETA(2)+ETA(2)
    CL=THETA(3)*W+ETA(3)
    D=EXP(-KE*TIME)-EXP(-KA*TIME)
    E=CL*(KA-KE)
    F=DS*KE*KA/E*D
    Y=F+EPS(1)
    IF (ICALL.EQ.3) THEN
    WRITE (70,*) IIDX,CNTID
    ENDIF
 $THETA  (.1,3,5) (.008,.08,.5) (.004,.04,.9)
 $OMEGA BLOCK(3)  6 .005 .0002 .3 .006 .4
 $SIGMA  .4
 $EST     MAXEVAL=450  PRINT=5

 Pairs of values are written, one pair per  line,  one  pair  for  each
 individual  record.   Each pair contains the ID data item and the con-
 tribution the objective function.

  1.000000000000000E+00  1.328986294492194E+01
  2.000000000000000E+00  2.071754196741930E+01
  ...

 They may also be displayed in a table, using
 $ABBR COMRES=2

 and code such as the following in the $ERROR or $PK block:

 IF (COMACT.EQ.1) THEN
   COM(1)=IIDX(NIREC)                                                   |
   COM(2)=CNTID(NIREC)                                                  |
 ENDIF

 The following, for example,  will produced a separate  table  for  the
 values:

 $TABLE IID=COM(1) CNT=COM(2) FILE=comvals NOAPPEND NOPRINT FIRSTONLY

 Note: With earlier versions than NONMEM 7.3, verbatim code is needed:  |
 "  COM(1)=IIDX(NIREC)                                                  |
 "  COM(2)=CNTID(NIREC)                                                 |

 REFERENCES: None.


  
Go to main index.
  
Created by nmhelp2html v. 1.0 written by Niclas Jonsson (Modified by AJB 5/2006,11/2007,10/2012)