T in $DES

6 messages 5 people Latest: Jul 11, 2021

Fwd: T in $DES

From: Matts Kågedal Date: July 06, 2021 technical
Hi all, I have a question regaring T in $DES. I have a time-varying covariate that is derived based on an explicit equation and then use in a differential equation. I got some funny results in the output table and investigated a bit further. I therefore derived T_DAY=T in $DES as below and output it in $TABLE. Why is T_DAY at TIME=0 equal to the time of the last observation for the patient? I was expecting it to be Zero (same as Time). Seems to be the same for all IDs in the dataset. Below is the output created in $TABLE including the "derived" variable T_DAY. Any advice would be appreciated. Matts Kågedal [image: image.png] [image: image.png]

Re: Fwd: T in $DES

From: Jakob Ribbing Date: July 06, 2021 technical
Dear Matts, Did you get funny results in the way that using T_DAY did now work as intended? If you are unsure you could set up a simple test where you have the analytical solution to the output, as an initial confirmation. Otherwise, for models integrating forward in time, a covariate value at time zero (or subjects first time point) would not have an impact on the model fit or parameter value, as nonmem would look forward towards the next record in time. $DES isspecial since the solver may move back and forth and time is updated in-between data records, but what you try to do may still work fine. The output in the table at time zero would be the subject’s last value because it has not yet entered $DES at time zero, but integrating forward that should not impact the fit (I believe). Best regards Jakob
Quoted reply history
> On 6 Jul 2021, at 14:44, Matts Kågedal <[email protected]> wrote: > > Hi all, > I have a question regaring T in $DES. > I have a time-varying covariate that is derived based on an explicit equation > and then use in a differential equation. > I got some funny results in the output table and investigated a bit further. > > I therefore derived T_DAY=T in $DES as below and output it in $TABLE. > Why is T_DAY at TIME=0 equal to the time of the last observation for the > patient? I was expecting it to be Zero (same as Time). Seems to be the same > for all IDs in the dataset. > Below is the output created in $TABLE including the "derived" variable T_DAY. > Any advice would be appreciated. > Matts Kågedal > > <image.png> > > <image.png> -- *This communication is confidential and is only intended for the use of the individual or entity to which it is directed. It may contain information that is privileged and exempt from disclosure under applicable law. If you are not the intended recipient please notify us immediately. Please do not copy it or disclose its contents to any other person.* *Any personal data will be processed in accordance with Pharmetheus' privacy notice, available here https://pharmetheus.com/privacy-policy/.** *

Re: T in $DES

From: Dennis Fisher Date: July 06, 2021 technical
Matts I believe that the issue that you encountered is addressed in the NONMEM output. Look for this text: (WARNING 48) DES−DEFINED ITEMS ARE COMPUTED ONLY WHEN EVENT TIME INCREASES. E.G., DISPLAYED VALUES ASSOCIATED WITH THE FIRST EVENT RECORD OF AN INDIVIDUAL RECORD ARE COMPUTED WITH (THE LAST ADVANCE TO) AN EVENT TIME OF THE PRIOR INDIVIDUAL RECORD. The wording is arcane but the basic message is that, for each subject, the first values for DES computed entries are not what you expect. Despite this, NONMEM is "doing the right thing". I defer to Alison Boeckmann to explain the inner workings. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com
Quoted reply history
> On Jul 6, 2021, at 5:44 AM, Matts Kågedal <[email protected]> wrote: > > Hi all, > I have a question regaring T in $DES. > I have a time-varying covariate that is derived based on an explicit equation > and then use in a differential equation. > I got some funny results in the output table and investigated a bit further. > > I therefore derived T_DAY=T in $DES as below and output it in $TABLE. > Why is T_DAY at TIME=0 equal to the time of the last observation for the > patient? I was expecting it to be Zero (same as Time). Seems to be the same > for all IDs in the dataset. > Below is the output created in $TABLE including the "derived" variable T_DAY. > Any advice would be appreciated. > Matts Kågedal > > <image.png> > > <image.png>

Re: Fwd: T in $DES

From: Alex Zheng Date: July 08, 2021 technical
Hi Jakob, My guess is that the differential equations are solved in the numeric ODE solver, so that the variable T is updated in each iteration of the estimation step. For time zero, the variable T is not updated because the value is supposed to be the initial value, which probably results in getting the value computed in the last iteration. This is just my theory. Best wishes, Han Zheng MD, PhD Shanghai BioGuider Medical Technology Co., Ltd.
Quoted reply history
On 6 July 2021 at 10:54:45 pm, Matts Kågedal (mattskagedal wrote: Thanks Jakob and Dennis for helpful comments! I think the model is doing what it should. My problem is that I don't get an accurate output of the covariate prediction at time zero when computed inside $DES based on T_DAY (where T_DAY=T). As a workaround I now also derive the predicted covariate value in $PK based on TIME (from the dataset) just for output in $TABLE. This seems to be working. Thanks, Matts On Tue, Jul 6, 2021 at 3:15 PM Jakob Ribbing <jakob.ribbing > wrote: > Dear Matts, > > Did you get funny results in the way that using T_DAY did now work as > intended? > If you are unsure you could set up a simple test where you have the > analytical solution to the output, as an initial confirmation. > > Otherwise, for models integrating forward in time, a covariate value at > time zero (or subjects first time point) would not have an impact on the > model fit or parameter value, as nonmem would look forward towards the ne xt > record in time. > $DES isspecial since the solver may move back and forth and time is > updated in-between data records, but what you try to do may still work fi ne. > The output in the table at time zero would be the subject’s last value > because it has not yet entered $DES at time zero, but integrating forward > that should not impact the fit (I believe). > > Best regards > > Jakob > > > > > On 6 Jul 2021, at 14:44, Matts Kågedal <mattskagedal e: > > Hi all, > I have a question regaring T in $DES. > I have a time-varying covariate that is derived based on an explicit > equation and then use in a differential equation. > I got some funny results in the output table and investigated a bit > further. > > I therefore derived T_DAY=T in $DES as below and output it in $TABLE. > Why is T_DAY at TIME=0 equal to the time of the last observation for th e > patient? I was expecting it to be Zero (same as Time). Seems to be the sa me > for all IDs in the dataset. > Below is the output created in $TABLE including the "derived" variable > T_DAY. > Any advice would be appreciated. > Matts Kågedal > > <image.png> > > <image.png> > > > > *This communication is confidential and is only intended for the use of > the individual or entity to which it is directed. It may contain > information that is privileged and exempt from disclosure under applicabl e > law. If you are not the intended recipient please notify us immediately. > Please do not copy it or disclose its contents to any other person.* > *Any personal data will be processed in accordance with Pharmetheus' > privacy notice, available here https://pharmetheus.com/privacy-policy/. * >

Re: Fwd: T in $DES

From: Alex Zheng Date: July 09, 2021 technical
Hi Jakob, My guess is that the differential equations are solved in the numeric ODE solver, so that the variable T is updated in each iteration of the estimation step. For time zero, the variable T is not updated because the value is supposed to be the initial value, which probably results in getting the value computed in the last iteration. This is just my theory. Best wishes, Han Zheng MD, PhD Shanghai BioGuider Medical Technology Co., Ltd.
Quoted reply history
On 6 July 2021 at 10:54:45 pm, Matts Kågedal ([email protected]) wrote: Thanks Jakob and Dennis for helpful comments! I think the model is doing what it should. My problem is that I don't get an accurate output of the covariate prediction at time zero when computed inside $DES based on T_DAY (where T_DAY=T). As a workaround I now also derive the predicted covariate value in $PK based on TIME (from the dataset) just for output in $TABLE. This seems to be working. Thanks, Matts On Tue, Jul 6, 2021 at 3:15 PM Jakob Ribbing <[email protected]> wrote: > Dear Matts, > > Did you get funny results in the way that using T_DAY did now work as > intended? > If you are unsure you could set up a simple test where you have the > analytical solution to the output, as an initial confirmation. > > Otherwise, for models integrating forward in time, a covariate value at > time zero (or subjects first time point) would not have an impact on the > model fit or parameter value, as nonmem would look forward towards the next > record in time. > $DES isspecial since the solver may move back and forth and time is > updated in-between data records, but what you try to do may still work fine. > The output in the table at time zero would be the subject’s last value > because it has not yet entered $DES at time zero, but integrating forward > that should not impact the fit (I believe). > > Best regards > > Jakob > > > > > On 6 Jul 2021, at 14:44, Matts Kågedal <[email protected]> wrote: > > Hi all, > I have a question regaring T in $DES. > I have a time-varying covariate that is derived based on an explicit > equation and then use in a differential equation. > I got some funny results in the output table and investigated a bit > further. > > I therefore derived T_DAY=T in $DES as below and output it in $TABLE. > Why is T_DAY at TIME=0 equal to the time of the last observation for the > patient? I was expecting it to be Zero (same as Time). Seems to be the same > for all IDs in the dataset. > Below is the output created in $TABLE including the "derived" variable > T_DAY. > Any advice would be appreciated. > Matts Kågedal > > <image.png> > > <image.png> > > > > *This communication is confidential and is only intended for the use of > the individual or entity to which it is directed. It may contain > information that is privileged and exempt from disclosure under applicable > law. If you are not the intended recipient please notify us immediately. > Please do not copy it or disclose its contents to any other person.* > *Any personal data will be processed in accordance with Pharmetheus' > privacy notice, available here https://pharmetheus.com/privacy-policy/.* >

Re: T in $DES

From: Alison Boeckmann Date: July 11, 2021 technical
The question has been answered correctly by the various people who commented recently. Dennis asked me to "explain the inner workings." This topic has been discussed in the past. See the mail archive web site https://www.mail-archive.com/[email protected] A good search is for "Warning 48". This will bring up a number of emails re: "Question regarding Calculation Process in $DES BLOCK" You will find a discussion of the issue in these emails, from June 2011.
Quoted reply history
On Tue, Jul 6, 2021, at 7:28 AM, Dennis Fisher wrote: > Matts > > I believe that the issue that you encountered is addressed in the NONMEM > output. Look for this text: > > (WARNING 48) DES−DEFINED ITEMS ARE COMPUTED ONLY WHEN EVENT TIME > INCREASES. E.G., DISPLAYED VALUES ASSOCIATED WITH THE FIRST EVENT RECORD > OF AN INDIVIDUAL RECORD ARE COMPUTED WITH (THE LAST ADVANCE TO) AN EVENT > TIME OF THE PRIOR INDIVIDUAL RECORD. > > The wording is arcane but the basic message is that, for each subject, the > first values for DES computed entries are not what you expect. > Despite this, NONMEM is "doing the right thing". > I defer to Alison Boeckmann to explain the inner workings. > > Dennis > > Dennis Fisher MD > P < (The "P Less Than" Company) > Phone / Fax: 1-866-PLessThan (1-866-753-7784) > www.PLessThan.com http://www.plessthan.com/ > > > >> On Jul 6, 2021, at 5:44 AM, Matts Kågedal <[email protected]> wrote: >> >> Hi all, >> I have a question regaring T in $DES. >> I have a time-varying covariate that is derived based on an explicit >> equation and then use in a differential equation. >> I got some funny results in the output table and investigated a bit further. >> >> I therefore derived T_DAY=T in $DES as below and output it in $TABLE. >> Why is T_DAY at TIME=0 equal to the time of the last observation for the >> patient? I was expecting it to be Zero (same as Time). Seems to be the same >> for all IDs in the dataset. >> Below is the output created in $TABLE including the "derived" variable T_DAY. >> Any advice would be appreciated. >> Matts Kågedal >> >> <image.png> >> >> <image.png> -- Alison Boeckmann [email protected]