Re: Simulating different populations
From: "Gastonguay, Marc"
Subject: Re: [NMusers] Simulating different populations
Date: Wed, 10 Aug 2005 11:56:36 -0400
Max,
If I understand you correctly, it sounds like you want to simulate from the posterior
(or uncertainty) distributions on the population parameters (THETA, OMEGA and SIGMA).
NONMEM is an approximate maximum likelihood method, so you don't get true posteriors but
you could use the var-cov matrix of the estimates as an approximation. Implementation is
not so straightforward. To do this correctly you need to simulate from a multivariate
normal dstribution for THETAs and an Inverse Wishart distribution for OMEGA and SIGMA.
There is an experimental, unsupported and undocumented subroutine in NONMEM, known as
the PRIOR subroutine, which could implement this sort of simulation, but this is not
publicly available and I have no idea if/when it may be included in future versions on
NONMEM. You could also do this by sampling THETAs OMEGAs and SIMGAs from a posterior
distribution generated from a parametric or non-parametric bootstrap - but you'd have
to write your own program to do so. We (and I believe others) have been working on our
own utilities to implement these types of simulations in NONMEM and will share results
with the user community in the near future.
Another option is to move to a full Bayesian MCMC method, such as WinBUGS, which generates
posterior distributions for any parameters and derived quantities you're interested in.
You could then simulate from these distributions.
In the meantime, you could try this bit of code (below) in the NMTRAN control stream, which
allows for a simple simulation from independent posterior distributions for any population
fixed effects parameters (could also be applied to variance terms if you use a log-normal
distribution - but this is a crude approximation). The result is a simulation with inter-trial
uncertainty in the population fixed effects parameters.
Hope this helps.
Marc
=========================
Marc R. Gastonguay, Ph.D.
Metrum Research Group LLC
www.metrumrg.com
;To define inter-trial uncertainty in a parameter,use code similar to this in $PRED or $PK...
; This is from $PRED example where uncertainty in relative bio fraction (FR1) is simulated
IF(IREP.EQ.1.AND.NEWIND.EQ.0) COUNT = 0
IF(ICALL.EQ.4) THEN
IF(IREP.NE.COUNT) THEN ;SHOULD ONLY HAPPEN AT THE START OF EACH SIMULATION REPLICATE
FR1 = -1
DOWHILE(FR1.LE.0)
CALL RANDOM(2,R)
FR1 = THETA(2) + THETA(3)*R
ENDDO
ENDIF COUNT = IREP
;Define model using FR1...
AUCR = THETA(1) + ETA(1)
AUCT = AUCR * FR1 + ETA(2)
Y = AUCR*(1-FLG) + AUCT*FLG + EPS(1)
ENDIF
TRL=IREP ; trial replicate number
$THETA 100 ; TYPICAL REFERENCE AUC
0.8 ; MODE OF POSTERIOR DISTRIBUTION ( POINT ESTIMATE OF FR1)
0.075 ;THETA(3) IS SD OF UNCERTAINTY, OR STANDARD ERROR FROM NONMEM $COV
$OMEGA 100 100
$SIGMA 10 1
$SIMULATION (437565 NEW) (47003 NORMAL) ONLYSIM SUBPROBLEMS=100
$TABLE ID DAY FLG AUCR AUCT F1 TRL DV FILE = SIMUNCERT.tab NOAPPEND NOPRINT NOHEADER