```From: Pavel Kovalenko musor000@optonline.net
Subject: [NMusers] Simulations: Can subject specific initial values be used?
Date: Sunday, March 28, 2004 12:15 PM

Dear, Nonmem users,

I wrote a simulatin code for a problem similar to problem #45 descibed by
Gabrielson and Weiner.  The code works, but it is obvious that if a problem
is more complex or sandard deviations of ETAs are large, then the approach
will not work.

There are the following problems:
1.  NONMEM generates few negative dependent variables.  It here a way to
make them equal to zero (IF (CP.LT.0) CP=0) without changing the \$SIGMA
record?

2.  For some subjects/simulations optimization procedure may not converge
well.  Is there a way to provide subject specific initial values of THETA
(or initial estimates of ETAs)?  Ideally, subject specific initial estimates
should be taken from simulation problem and used in the estimation problem.

The code and data are below.

Kind regards,
Pavel Kovalenko

\$PROB  0. DUMMY SIMULATION (SINGLE SUBJECT, TWO DOSES)
;This problem is only here to allow the use of the seed (-1) later on.
;THIS PROBLEM MUST BE OUTSIDE OF THE SUPERPROBLEM;  OTHERWISE,
;THE SEED OF -1 CANNOT BE USED
\$INPUT     EVID  TIME CP=DV DOSE=AMT MDV ID
\$DATA       PK45DIF3.DA IGNORE #
\$SUBROUTINES  ADVAN6  TOL=5    ;TOL - THE NUMBER OF ACCURATE DIGITS
\$MODEL COMP=(DEPOT,DEFDOSE) COMP=(CENTRAL,DEFOBS,NOOFF)
\$THETA  (.04,4,40) (.1,10,100) (.001,0.33,10)
\$OMEGA DIAGONAL(3)   0.8   2   0.066            ;VARIANCE OF ETA
\$SIGMA 1
;\$EST     MAXEVAL=9990 SIG=5 PRINT=5
\$PK
K1=THETA(1)+ETA(1)
V2=THETA(2)+ETA(2)
K2=THETA(3)+ETA(3)
S2=V2
CL2=K2*V2
\$DES

\$ERROR
CONC=F
Y=CONC+ERR(1)
ER=ERR(1)
;IPRED=CONC      ;  individual-specific prediction
;IRES=DV-IPRED   ;  individual-specific residual
;IWRES=IRES/CONC ;  individual-specific weighted residual

\$SIMULATION (73010) ONLY SUBPROBLEMS=1;

;*********************************************************************;
\$SUPER     SCOPE=2 ITERATIONS=10
\$PROB  1. SIMULATION -- SINGLE SUBJECT -- SUPERPROBLEM
;THIS PROBLEM SHOULD NOT INCLUDE PK AND DES STATEMENTS.
;OTHERWISE, NONMEM REQUESTS \$SUBROUTINE LIBRARY.
;IF \$SUBROUTINE LIBRARY IS ADDED, G77 GENERATES ERROR:
;G77.EXE: FSUBS.FOR NO SUCH FILE OR DIRECTORY.
\$INPUT     EVID  TIME CP=DV DOSE=AMT MDV ID
\$DATA       PK45DIF3.DA REWIND

\$THETA  (.4,4,30) (1,10,50) (.03,0.33,5)
\$OMEGA DIAGONAL(3)  0.64 4 0.00436   ;SIGMAS OF THETA = 0.8 2 0.066
\$SIGMA 1

\$SIMULATION (-1) ONLY;

\$TABLE ID K1 K2 V2 CL2 ETA1 ETA2 ETA3 ;NOAPPEND
;\$TABLE ID K V KA ETA1 ETA2 ETA3  NOAPPEND FIRSTONLY

;********************************************************************;
\$PROB  2. ESTIMATION
;IT IS NOT CLEAR WHAT CAN BE DONE WHEN AN INITIAL ESTIMATE
;FOR ONE SUBJECT IS NOT GOOD.  UNFORTUNATELY, INITIAL ESTIMATES ARE NOT
;SUBJECT SPECIFIC.
\$INPUT EVID TIME CP=DV DOSE=AMT MDV ID
\$THETA  (.04,4,40) (.1,10,100) (.001,0.33,10) NOABORT

\$OMEGA DIAGONAL(3)   0.8   2   0.066
\$SIGMA 1
\$EST     MAXEVAL=9990 SIG=5 PRINT=5  MSFO=msf POSTHOC NOABORT
\$TABLE ID MDV TIME DOSE CP ETA1 ETA2 ETA3
\$TABLE ID K1 K2 V2 CL2 ETA1 ETA2 ETA3  NOAPPEND FIRSTONLY
;\$TABLE ID TIME K1 K2 V2 CL2 ETA1 ETA2 ETA3   NOAPPEND FIRSTONLY

4        0.00      .        400        1 1
0        0.00      0.74      .         0 1
0        0.25      2.84      .         0 1
0        0.57      6.57      .         0 1
0        1.12      10.50     .         0 1
0        2.02      9.66      .         0 1
0        3.82      8.58      .         0 1
0        5.10      8.36      .         0 1
0        7.03      7.47      .         0 1
0        9.05      6.89      .         0 1
0        12.12     5.94      .         0 1
0        24.37     3.28      .         0 1
0        25         .        .         1 1
4        0.00      .        400        1 2
0        0.00      0.74      .         0 2
0        0.25      2.84      .         0 2
0        0.57      6.57      .         0 2
0        1.12      10.50     .         0 2
0        2.02      9.66      .         0 2
0        3.82      8.58      .         0 2
0        5.10      8.36      .         0 2
0        7.03      7.47      .         0 2
0        9.05      6.89      .         0 2
0        12.12     5.94      .         0 2
0        24.37     3.28      .         0 2
0        25         .        .         1 2
4        0.00      .        400        1 3
0        0.00      0.74      .         0 3
0        0.25      2.84      .         0 3
0        0.57      6.57      .         0 3
0        1.12      10.50     .         0 3
0        2.02      9.66      .         0 3
0        3.82      8.58      .         0 3
0        5.10      8.36      .         0 3
0        7.03      7.47      .         0 3
0        9.05      6.89      .         0 3
0        12.12     5.94      .         0 3
0        24.37     3.28      .         0 3
0        25         .        .         1 3
4        0.00      .        400        1 4
0        0.00      0.74      .         0 4
0        0.25      2.84      .         0 4
0        0.57      6.57      .         0 4
0        1.12      10.50     .         0 4
0        2.02      9.66      .         0 4
0        3.82      8.58      .         0 4
0        5.10      8.36      .         0 4
0        7.03      7.47      .         0 4
0        9.05      6.89      .         0 4
0        12.12     5.94      .         0 4
0        24.37     3.28      .         0 4
0        25         .        .         1 4
4        0.00      .        400        1 5
0        0.00      0.74      .         0 5
0        0.25      2.84      .         0 5
0        0.57      6.57      .         0 5
0        1.12      10.50     .         0 5
0        2.02      9.66      .         0 5
0        3.82      8.58      .         0 5
0        5.10      8.36      .         0 5
0        7.03      7.47      .         0 5
0        9.05      6.89      .         0 5
0        12.12     5.94      .         0 5
0        24.37     3.28      .         0 5
0        25         .        .         1 5
4        0.00      .        400        1 6
0        0.00      0.74      .         0 6
0        0.25      2.84      .         0 6
0        0.57      6.57      .         0 6
0        1.12      10.50     .         0 6
0        2.02      9.66      .         0 6
0        3.82      8.58      .         0 6
0        5.10      8.36      .         0 6
0        7.03      7.47      .         0 6
0        9.05      6.89      .         0 6
0        12.12     5.94      .         0 6
0        24.37     3.28      .         0 6
0        25         .        .         1 6
4        0.00      .        400        1 7
0        0.00      0.74      .         0 7
0        0.25      2.84      .         0 7
0        0.57      6.57      .         0 7
0        1.12      10.50     .         0 7
0        2.02      9.66      .         0 7
0        3.82      8.58      .         0 7
0        5.10      8.36      .         0 7
0        7.03      7.47      .         0 7
0        9.05      6.89      .         0 7
0        12.12     5.94      .         0 7
0        24.37     3.28      .         0 7
0        25         .        .         1 7
#

_______________________________________________________

From: Bachman, William (MYD) bachmanw@iconus.com
Subject: RE: [NMusers] Simulations: Can subject specific initial values be used?
Date: Tue, March 30, 2004 9:37 am

Pavel,

On your first question, your problems stem from the use of inappropriate
models for interindividual error (which in turn generates negative parameter
values).  The choice of interindividual error models should be a function of
the known or expected distribution of the parameter being modeled.  Most PK
parameters are log-normally distributed, hence an exponential error model
would be appropriate, particularly for CL and V.  This has the added benefit
of avoiding the negative parameters you get in your simulations.  Not all
parameters are log-normally distributed. e.g., you may find lags are better
modeled with an additive error model.  When an exponential error model is
not appropriate, reparameterize the model to avoid negative parameters if
possible.

On your second point, you probably won't need this if you implement the
above suggeestions.  Also, this is not a good way to approach this problem
in my opinion.  It seems like a "kludge" solution that could be avoided by