RE: model dynamic data with $DES subroutine
Dear Jing,
Please find below a revised control stream:
You needed some code like this to define your initial condition.
IF (A_0FLG.EQ.1) THEN
A_0(1)=KIN/KOUT
ENDIF
This method of initializing a compartment requires either
an observation or a simulated time event at time zero.
Therefore, I added an EVID=2 event into your dataset
(which I sent you off-line).
Alternatively, you can use the dummy dose at time zero method
which Bill proposed. Both methods should work fine.
If you want to describe disease progression, you may also
want to define the inhibitory or stimulatory effect of DIS
in a time-dependent manner. In your original code, DIS
was a constant which multiplied as (1-DIS) on Kin.
Depending if you initialize A(1) at Kin/Kout or at Kin*(1-DIS)/Kout,
DIS may or may not have any effect in the original code.
As a sample code, you might start with this function:
INH = 1.0D0 - DEXP(-DIS*T)
DADT(1)= KIN*INH - KOUT*A(1)
This may or may not be a good function for your data.
So please feel free to try other functions for INH. It is
important that you use T and not TIME in $DES, since
only T is continuous time, whereas TIME is not.
I also changed the headers of your datafile and
added two new columns. Hope this helps.
Best wishes
Juergen
Model code:
$PROB Demo7 for turn over PD model
$INPUT IDD=DROP ID TIME AMT DV EVID MDV
$DATA demo7.csv IGNORE=#
$ESTIM MAXEVAL0 NOABORT PRINT=1
METHOD=COND INTERACTION SIG=5 MSFO=save.msf
$COV MATRIX=S SLOW
$SUBROUTINE ADVAN6 TOL=5
$MODEL
COMP=(PDK)
$PK
KIN=THETA(1)*EXP(ETA(1))
KOUT=THETA(2)
DIS=THETA(3)
IF (A_0FLG.EQ.1) THEN
A_0(1)=KIN/KOUT
ENDIF
$DES
INH = 1.0D0 - DEXP(-DIS*T)
DADT(1)= KIN*INH - KOUT*A(1)
$ERROR
Y = A(1) + ERR(1)
; Fixed effects
$THETA 174 ; KIN_PDK
$THETA 77 ; KOUT_PDK
$THETA (0,0.05,1) ; AGE_EFFECT_PDK
; Random effects
$OMEGA 0 FIX; BSVKIN_PDK
$OMEGA 0 FIX; BSVDIS_PDK
$SIGMA 0.1
$TABLE ID TIME Y DV
NOPRINT ONEHEADER FILEMO.fit
#ID_real,ID,TIME,AMT,DV,EVID,MDV,CORT,strain,diet
.,1,0,.,.,2,1,.,CON,N
101,1,4,.,1.495201124,0,0,175.1,CON,N
102,1,4,.,1.5808647,0,0,105.37,CON,N
103,1,4,.,3.179360818,0,0,223.91,CON,N
...
Quoted reply history
From: owner-nmusers
Behalf Of Jing Nie
Sent: Thursday, December 03, 2009 9:29 AM
To: nmusers
Subject: [NMusers] model dynamic data with $DES subroutine
Dear NMusers,
I have a question I would like your help. The data I have is only the dynamic data since we didn't give dose to the animal. I am trying to capture the nature of disease progression. And the PD decrease with time. I have seen people model only the PD data use $PRED subroutine but they use the explicit equation.But I want to use a differential equation like dA/dt= kin(1-dis)-kout*A while A0=kin/kout.
When I ran the control stream, the gradient for most of the parameters are 0. And the only parameter estimation I got is the sigma. The output of Y is 0. I guess it's because I don't have dose to compartment(PDK) but I don't know how should I fix the problem.
Any suggestion is appreciated!
The control stream I wrote is:
$PROB Demo for turn over PD model
$INPUT ID TIME AMT PDK=DV EVID
$DATA demo.csv IGNORE=#
$ESTIM MAXEVAL000 NOABORT PRINT=1
METHOD=COND INTERACTION SIG=5 MSFO=save.msf
$COV MATRIX=S SLOW
$SUBROUTINE ADVAN6 TOL=5
$MODEL
COMP=(PDK)
$PK
KIN=THETA(1)*EXP(ETA(1))
KOUT=THETA(2)
DIS=THETA(3)*EXP(ETA(2))
$DES
DADT(1)=KIN*(1-DIS)-KOUT*A(1)
$ERROR
Y = F + ERR(1)
; Fixed effects
$THETA 174 FIX ; KIN
$THETA 77 FIX ; KOUT
$THETA (0,0.28,1) ; AGE_EFFECT_PDK
; Random effects
$OMEGA 0 FIX; BSVKIN_PDK
$OMEGA 0 FIX; BSVDIS_PDK
$SIGMA 0.1
$TABLE ID TIME PDK Y
NOPRINT ONEHEADER FILEMO.fit
And my data looks like:
#ID TIME AMT PDK EVID
101 4 . 1.49 0
102 4 . 1.58 0
61 8 . 0.57 0
62 8 . 2.03 0
63 8 . 1.58 0
64 8 . 1.52 0
109 12 . 0.71 0
110 12 . 1.18 0
21 12 . 1.25 0
-Jing
This e-mail and any files transmitted with it, are intended solely for the use of the individual or entity to whom they are addressed.?If you have received this e-mail in error, please reply to this message and let the sender know.
________________________________
Chat with Messenger straight from your Hotmail inbox. Check it http://www.microsoft.com/windows/windowslive/hotmail_bl1/hotmail_bl1.aspx?ocid=PID23879::T:WLMTAGL:ON:WL:en-ww:WM_IMHM_4:092009