From: Stu Beal
To: NONMEM UsersNet Participants
Subject: Calling Protocol for ERROR
Date: February 11 2004
I would like to call attention to some poor practice related to the use of
PREDPP.
With some event records, a proportional error model is used in the ERROR
routine, e.g.
Y=F+F*ERR(1)
or the data are log transformed, and then
Y=LOG(F)+ERR(1)
is used. It may happen that the value F (the scaled drug amount) can be 0
with a nonobservation event record, as for example, with a dose event
record at time 0 when there is first-order absorption from a drug depot and
the default observation compartment is the central compartment. If the
statistical error (F*ERR(1) in this example) is 0, NONMEM produces an error
message (or if the logarithm of 0 is taken, the operating system produces
an error message), and the run terminates. Some people guard against this
occurrence by using code like
W=F
IF (F.EQ.0) W=F+.0001
Y=F+W*ERR(1)
This code will usually not cause a problem, but on occasion there may be
observation event records where F=0, and this code is masking a problem
about which the user should become aware. Or use of this code may
encourage use of
W=F+.0001
Y=F+W*ERR(1)
reflecting the thinking that the addition of a small number in this way
will not significantly alter the results. However, this will very often
alter the results, especially when during the Estimation Step parameter
values are considered that lead to smaller values of F than might be ima-
gined.
Similarly, the codes
FF=F
IF (F.EQ.0) FF=F+.0001
Y=LOG(FF)+ERR(1)
or
FF=.0001
Y=LOG(FF)+ERR(1)
are sometimes used. In general, when it can be avoided, any use of a fudge
factor (e.g. the .0001) is poor practice.
In the situation described above, a fudge factor can be avoided by using
the calling protocol "OBSERVATION ONLY" with the ERROR routine:
$ERROR (OBSERVATION ONLY)
Y=F+F*ERR(1)
or
$ERROR (OBSERVATION ONLY)
Y=LOG(F)+ERR(1)
Then ERROR is called only with an observation event record.
When the Simulation Step is being implemented, the calling protocol "OBSER-
VATION ONLY" does not apply, and ERROR is called with every event record.
For example, to log transform the data, a simulation block in ERROR can
appear as follows.
IF (ICALL.EQ.4) THEN
IF (F.NE.0) Y=LOG(F)
ENDIF
Here an explicit check concerning F=0 is needed because ERROR will be
called with nonobservation event records. However, as the value of the
DV data item usually is unimportant for such a record,
the logarithm needn't be taken with such a record.
______________________________________________________________________