Continuous Time Markov Model Data Structure

3 messages 2 people Latest: Aug 11, 2021

Continuous Time Markov Model Data Structure

From: Jay Wen Date: August 09, 2021 technical
Dear All, I am currently working on a continuous time Markov Model to use drug concentration as exposure to predict the toxicity (categorical outcome). The dataset preparation and control stream is developed based on Lu et al *CPT *2020 (PMID: 31877239 https://www.ncbi.nlm.nih.gov/pubmed/31877239) as it is somewhat easier to construct the dataset compared to Schindler et al AAPS 2017 (PMID: 28634883 https://pubmed.ncbi.nlm.nih.gov/28634883/) or Lacroix et al* CPT* 2009 (PMID: 19626001 https://pubmed.ncbi.nlm.nih.gov/19626001/). The dataset is structured as following: ID TIME AMT EVID DV MDV CMT 1 1 . 0 1 0 2 1 1 . 3 . 1 . 1 1 615 1 . 1 1 1 8 . 0 1 0 2 1 8 . 3 . 1 . 1 8 607 1 . 1 1 1 22 . 0 1 0 2 1 22 . 3 . 1 . 1 22 607 1 . 1 1 The relevant control stream: ;; ---------Start $MODEL COMP=(CENTRAL) ; CMT1 DRUG COMP=(EFFECT) ; CMT2 COMP=(PR0) ; CMT3 PR(TOXGR=0) COMP=(PR1) ; CMT4 PR(TOXGR=1) COMP=(PR2) ; CMT5 PR(TOXGR=2) $PK IF (NEWIND.NE.2) THEN A1=0 A2=0 A3=0 A4=0 A5=0 PDV=0 ENDIF IF (A_0FLG.EQ.1) THEN A_0(1) IF (PDV.EQ.0) THEN A_0(3)=1 A_0(4)=0 A_0(5)=0 ENDIF IF (PDV.EQ.1) THEN A_0(3)=0 A_0(4)=1 A_0(5)=0 ENDIF IF (PDV.EQ.2) THEN A_0(3)=0 A_0(4)=0 A_0(5)=1 ENDIF ENDIF $ERROR IF (EVID.EQ.0) PDV=DV Y-16 IF (DV.EQ.0) Y-16 + A(3) IF (DV.EQ.1) Y-16 + A(4) IF (DV.EQ.2) Y-16 + A(5) A1=A(1) PR0=A(3) PR1=A(4) PR2=A(5) ;; ---------End *My question is:* to allow the preceding state to impact the probability of the current state, should I be resetting the CMT at the same time as the DV? Or I should be resetting the CMT until the next DV? In another word, should I contructure the dataset as shown above or below? If there is any difference, can someone kindly explain why? ID TIME AMT EVID DV MDV CMT 1 1 . 0 1 0 2 1 1 615 1 . 1 1 1 8 . 3 . 1 . 1 8 . 0 1 0 2 1 8 607 1 . 1 1 1 22 . 3 . 1 . 1 22 . 0 1 0 2 1 22 607 1 . 1 1 Thank you for your time! Best, Ya-Feng (Jay) -- Ya-Feng (Jay) Wen, Pharm.D. | Ph.D. Student Experimental and Clinical Pharmacology University of Minnesota College of Pharmacy 7-192 Weaver-Densford Hall, 308 Harvard Street SE Minneapolis, MN 55455 Office: 612-624-9683 | Cell: 612-443-0511

Continuous Time Markov Model Data Structure

From: Jay Wen Date: August 10, 2021 technical
Dear All, I am currently working on a continuous time Markov Model to use drug concentration as exposure to predict the toxicity (categorical outcome). The dataset preparation and control stream is developed based on Lu et al *CPT *2020 (PMID: 31877239 https://www.ncbi.nlm.nih.gov/pubmed/31877239) as it is somewhat easier to construct the dataset compared to Schindler et al AAPS 2017 (PMID: 28634883 https://pubmed.ncbi.nlm.nih.gov/28634883/) or Lacroix et al* CPT* 2009 (PMID: 19626001 https://pubmed.ncbi.nlm.nih.gov/19626001/). The dataset is structured as following: ID TIME AMT EVID DV MDV CMT 1 1 . 0 1 0 2 1 1 . 3 . 1 . 1 1 615 1 . 1 1 1 8 . 0 1 0 2 1 8 . 3 . 1 . 1 8 607 1 . 1 1 1 22 . 0 1 0 2 1 22 . 3 . 1 . 1 22 607 1 . 1 1 The relevant control stream: ;; ---------Start $MODEL COMP=(CENTRAL) ; CMT1 DRUG COMP=(EFFECT) ; CMT2 COMP=(PR0) ; CMT3 PR(TOXGR=0) COMP=(PR1) ; CMT4 PR(TOXGR=1) COMP=(PR2) ; CMT5 PR(TOXGR=2) $PK IF (NEWIND.NE.2) THEN A1=0 A2=0 A3=0 A4=0 A5=0 PDV=0 ENDIF IF (A_0FLG.EQ.1) THEN A_0(1)=A1 IF (PDV.EQ.0) THEN A_0(3)=1 A_0(4)=0 A_0(5)=0 ENDIF IF (PDV.EQ.1) THEN A_0(3)=0 A_0(4)=1 A_0(5)=0 ENDIF IF (PDV.EQ.2) THEN A_0(3)=0 A_0(4)=0 A_0(5)=1 ENDIF ENDIF $ERROR IF (EVID.EQ.0) PDV=DV Y=1E-16 IF (DV.EQ.0) Y=1E-16 + A(3) IF (DV.EQ.1) Y=1E-16 + A(4) IF (DV.EQ.2) Y=1E-16 + A(5) A1=A(1) PR0=A(3) PR1=A(4) PR2=A(5) ;; ---------End *My question is:* to allow the preceding state to impact the probability of the current state, should I be resetting the CMT at the same time as the DV? Or I should be resetting the CMT until the next DV? In another word, should I contructure the dataset as shown above or below? If there is any difference, can someone kindly explain why? ID TIME AMT EVID DV MDV CMT 1 1 . 0 1 0 2 1 1 615 1 . 1 1 1 8 . 3 . 1 . 1 8 . 0 1 0 2 1 8 607 1 . 1 1 1 22 . 3 . 1 . 1 22 . 0 1 0 2 1 22 607 1 . 1 1 Thank you for your time! Best, Ya-Feng (Jay) -- Ya-Feng (Jay) Wen, Pharm.D. | Ph.D. Student Experimental and Clinical Pharmacology University of Minnesota College of Pharmacy 7-192 Weaver-Densford Hall, 308 Harvard Street SE Minneapolis, MN 55455 Office: 612-624-9683 | Cell: 612-443-0511

Continuous Time Markov Model Data Structure

From: Robert Bauer Date: August 11, 2021 technical
The following is on behalf of Martin Bergstrand, as there is some difficulty in posting on to nmusers: Dear Ya-Feng, The first data example seems correct but probably requires another record at TIME= 0, to account for what happens before the first observation (e.g. TIME=0 & EVID=2). If you have a dose record etc. at TIME=0 this is not needed. Also notice that with the current code you assume that TOXGR=0 at TIME= 0 [ IF(NEWIND.NE.2) PDV=0 => A_0(3)=1 ]. This is often a reasonable assumption but it is important to be aware of. Now for some explanation: With a continuous time Markov Model the most recent preceding state is by default impacting the probability of the next state (higher order markov effects are possible but most often not needed). The "amount" in each compartment in the markov chain represents the probability for observing the corresponding state. Right after observing that the TOXGR (toxicity score) was = 1 you re-initialize each compartment so that at that point the probability is 1 for TOXGR=1 (CMT=4) and 0 for the other states i.e. TOXGR=0|2 (CMT=3|5). In the time that passes between the system being reset and the next observation some probability will distribute from CMT=4 to CMT=3 and CMT = 5 (and some will remain in CMT= 4). The rate of distribution of probability between the 3 compartments are given by the rate constants K34,K43,K45 and K54 (that are not present in your example code). Rather than estimating the rate constraints (that can be hard to interpret), Schindler et al showed how you can estimate mean equilibrium times and steady state probabilities (and from them derive the rate constants). I hope this was helpful? Kind regards, Martin Bergstrand, Ph.D. Principal Consultant Pharmetheus AB +46(0)709 994 396 [email protected]<mailto:[email protected]> http://www.pharmetheus.com/ +46(0)18 513 328 U-A Science Park, Dag Hammarskjölds v. 36b 752 37 Uppsala, Sweden