___________________________________________________________________
 |                                                                 |
 |                                  PK                             |
 |_________________________________________________________________|

 MEANING: PK subroutine
 CONTEXT: User-supplied subroutine; for use with PREDPP

 USAGE:
 SUBROUTINE PK (ICALL,IDEF,THETA,IREV,EVTREC,NVNT,INDXS,IRGG,GG,NETAS)
 INTEGER ICALL,IDEF,IREV,INDXS,IRGG,NVNT
 DIMENSION IDEF(7,*),THETA(*),EVTREC(IREV,*),INDXS(*),GG(IRGG,LVR+1,*)
 (If double precision is to be used):
 DOUBLE PRECISION THETA,GG
 (If single precision is to be used):
 REAL THETA,GG
 The value of LVR must  be  the  same  as  that  found  in  file  SIZES
 (See sizes).

 DISCUSSION:
 The PK subroutine is called by PREDPP to obtain values for  basic  and
 additional  pharmacokinetic parameters.  Basic PK parameters are typi-
 cally the rate constants ("micro-constants") for use in kinetic formu-
 las.   PK can compute instead parameters such as clearance and volume,
 and a translator ("TRANS") subroutine can be used to convert these  to
 rate  constants.   Additional  PK parameters include compartment scale
 parameters, which PREDPP uses to convert compartment amounts  to  con-
 centrations,  and  dose-related  parameters  such  as modeled infusion
 rates.

 Input argument:

  ICALL
      ICALL=1: PK has been called for initialization at  the  beginning
      of  a NONMEM problem; one such call per problem.  EVTREC contains
      the first event record.  THETA contains  the  initial  estimates.
      PK  must return values in IDEF, which inform PREDPP what tasks it
      will perform at later calls.  It may also set GG  (k,1,1)  to  1,
      indicating  that the kth PK parameter will be modeled as a log (a
      feature which cannot be specified using abbreviated code).

      ICALL=2: PK has been called to obtain parameter values;  multiple
      calls  occur.  PK should call GETETA to obtain ETA values for the
      individual. PK should compute all relevant portions of GG.

      ICALL=4: PK has been called during the Simulation Step;  multiple
      calls  occur.   PK  should  call  SIMETA  to obtain simulated ETA
      values for the individual. PK should compute  individual-specific
      parameters for column 1 of GG.

      ICALL=5: PK has been called during the  computation  of  expecta-
      tions; multiple calls occur.  Such calls occurs when the marginal
      (MRG_) data item is defined in the  data  set  and  has  non-zero
      values  for  some records.  If the MRG_ data item has the value 1
      or 2, the values of PK-defined items contribute to  the  expecta-
      tions computed for these items.

  THETA
      The NONMEM THETA vector.

  EVTREC
      The PREDPP event record.

  INDXS
      The values specified in the $INDEX record of the NM-TRAN  control
      stream.  (This is the NONMEM Index array starting at position 12,
      the first position beyond those positions used by PREDPP itself).

  NETAS
      The number of population etas in the problem.

 Output argument:

  IDEF
      PK should store values in IDEF only when ICALL=1.
      Values may be stored in the following elements:
      IDEF(1,1)=-9  (required)
      IDEF(1,2) is the call limiting element (compare $PK's CALLFL).
      Values are:
        -2: call with every event record and at additional  and  lagged
        dose times.
        -1: call with every event record (default)
         0: call with first event record and new TIME values
         1: call once per individual record

      Compartment  initialization  may  be  performed  by  routine  PK;
      (See PRDPK3, PROCMC).
      An initial steady state may be requested by routine PK;            |
      (See PRDPK4, i_ss, initial_condition).                             |
      The value in IDEF(1,3) describes whether PK performs  compartment
      initialization,  i.e.,  whether or not PK initializes elements of
      the initial state vector A_0(n).  Values are:
        -1: PK may initialize A_0.
         0: PK does not initialize A_0.
         1: PK does initialize A_0.
      The default used by PREDPP is IDEF(1,3)=-1.  However,  when  com-
      partment  initialization is not implemented, then if IDEF(1,3) is
      set to  0,  PREDPP  can  avoid  some  time-consuming  processing.
      Indeed,  when  $PK  abbreviated or verbatim code is supplied, and
      there is  no  reference  to  compartment  initialization  amounts
      A_0(n)  in  either the abbreviated or verbatim code, then NM-TRAN
      sets IDEF(1,3)=0.

      Compartment amounts may be used by routine PK; (See PROCM4).  The
      value  in IDEF(1,4) describes whether PK uses derivatives of com-
      partment amounts (e.g. compartment amounts themselves are used as
      random variables in arithmetic statements in PK).  Values are:
        -1: PK may use derivatives of compartment amounts.
         0: PK does not use derivatives of compartment amounts.
         1: PK uses derivatives of compartment amounts.
      The default used by PREDPP is IDEF(1,4)=-1. However, when deriva-
      tives  of  compartment amounts are not used, then if IDEF(1,4) is
      set to  0,  PREDPP  can  avoid  some  time-consuming  processing.
      Indeed,  when  $PK  abbreviated or verbatim code is supplied, and
      there is no reference to A(n) (as a random variable in an  arith-
      metic  statement)  in  the abbreviated code (or to derivatives of
      A(n) in the verbatim code), then NM-TRAN sets IDEF(1,4)=0.

      Remaining elements contain row numbers in GG:
      IDEF(2,1): row number of F0 (output fraction)
      IDEF(2,2): row number of XSCALE (Time Scale)
      IDEF(3,n): row number of Sn (Scale for comp. n)
      IDEF(4,n): row number of Fn (bioavailability fraction for comp. n)
      IDEF(5,n): row number of Rn (modeled rate for comp. n)
      IDEF(6,n): row number of Dn (modeled duration for comp. n)
      IDEF(7,n): row number of ALAGn (absorption lag for comp. n)

  GG  The array of PK parameters and their eta derivatives.   The  max-
      imum  number of rows in GG is given by IRGG, which is the same as
      constant PG found in file SIZES (See sizes).
      At ICALL = 2:
      GG(k,1,1) contains the value of the kth parameter.
      GG(k,i+1,1) contains its derivative with respect to the ith eta.
      GG(k,i+1,j+1) contains its second derivative with respect to  the
      ith eta and the jth eta (lower-triangular; j=1, ..., i).  (Second
      derivatives are only needed  with  estimation  by  the  Laplacian
      method.)
      At ICALL = 4:
      GG(k,1,1) contains  the  individual-specific  value  of  the  kth
      parameter.  Other columns of GG need not be computed.

 Also see NONMEM read-only commons (of  the  form  ROCMn),  NONMEM-PRED
 commons  (of  the  form  NMPRDn), and PREDPP read-only commons (of the
 form PROCMn).

REFERENCES: Guide IV Section V.C.5
REFERENCES: Guide V Section 7
REFERENCES: Guide VI Section III


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