Re: NONMEM code verification

From: Ana Miranda Bastos Date: January 25, 2016 technical Source: mail-archive.com
Hi, Thank you all for your input. Nick - I'll follow your approach, but I'll try to use the R package suggested by Kyle, as I don't have Berckeley Madonna. Suruchi - The weird behaviour is that the model simulation is suggesting that for a given Probability of treatment target, a lower dose is needed as the weight goes up and dosing interval goes up. Weight is incorporated in the model using allometric scaling for different parameters. The drug is a penicillin. The model diagnostics, including VPCs, look OK, but this result seems to be counter-intuitive...Has anyone seen a behaviour like that before? Ana
Quoted reply history
________________________________ From: [email protected] <[email protected]> on behalf of Denney, William S. <[email protected]> Sent: 22 January 2016 15:03 To: Bakshi, S.D. Cc: [email protected] Subject: Re: [NMusers] NONMEM code verification Hi, Adding to Suruchi, one issue I have encountered in the past when working with complex or mathematically stiff models is that different integrators occasionally give different results. This will usually show up as instability of one of the integrators (big jumps up and down on a percent basis from one point to the next). In the past several years, this is getting rarer, but it can never be eliminated while using computers and numerical methods. Thanks, Bill On Jan 22, 2016, at 5:21, "Bakshi, S.D." <[email protected]<mailto:[email protected]>> wrote: Hi Ana, What kind of weird behavior do you get? If your model is complex in that it is nonlinear, it is likely that it shows multistationarity or oscillations or other emergent behavior which you may not expect. Some mathematical analysis of the structural model itself may be useful in that case. Suruchi. From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Kyle Baron Sent: donderdag 21 januari 2016 22:42 To: Bauer, Robert Cc: Nick Holford; [email protected]<mailto:[email protected]> Subject: Re: [NMusers] NONMEM code verification If working in R, you can use mrgsolve: https://urldefense.proofpoint.com/v2/url?u=http-3A__metrumrg.com_opensourcetools.html&d=CwMGaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=4WqjVFXRfAkMXd6y3wiAtxtNlICJwFMiogoD6jkpUkg&m=ppRE3mLmLwEUK40XIVKCcYhDBPg6Ut8daFHz3--izi4&s=xZxJx4fKx0tHuBPX2jrymatHCBV3ia4MDZXvDqjP_qw&e= It is open-source, validated R package interfacing with DLSODA solver in ODEPACK. It should be able to directly utilize your NONMEM data set: https://urldefense.proofpoint.com/v2/url?u=http-3A__metrumrg.com_mrgsolve-2Dhowdoi.html-23implement-2Devents-2Dvia-2Ddata-2Dset&d=CwMGaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=4WqjVFXRfAkMXd6y3wiAtxtNlICJwFMiogoD6jkpUkg&m=ppRE3mLmLwEUK40XIVKCcYhDBPg6Ut8daFHz3--izi4&s=1jnINFT9t3Y9xLxm6u7WDT-q0RoQgWvx7vkwAnMgp5Q&e= (you might need to rename some columns ... use tolower() or mrgsolve has a function to do it). If you're really making a really close comparison, pay attention to the solver tolerances and the number of digits in the answer (you can control them in both NONMEM and mrgsolve). Caution: mrgsolve advances with the covariate at T1 (in Bob's example). But I guess I'd tend to take that factor out of play and just look at predictions from some parameters constant over time where possible (assuming you're really wanting to diagnose what is happening with the ODEs; that's how I understood Nick's post). Kyle On Thu, Jan 21, 2016 at 2:02 PM, Bauer, Robert <[email protected]<mailto:[email protected]>> wrote: Ana: The most common reason NONMEM may produce a different result than expected is if the evaluation depends on covariates listed in the data set that changes with each record, the default action of NONMEM is for an interval covering T1>Time<=T2, it uses the covariate at record TIME=T2. This behavior can be changed with $BIND. Also, if you program in discontinuities that vary with model parameters, like changing a rate constant suddenly, you may want to use the MTIME() system. Both of these items are discussed in viii.pdf. Robert J. Bauer, Ph.D. Vice President, Pharmacometrics R&D ICON Early Phase Office: (215) 616-6428<tel:%28215%29%20616-6428> Mobile: (925) 286-0769<tel:%28925%29%20286-0769> [email protected]<mailto:[email protected]> www.iconplc.com&d=CwMGaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=4WqjVFXRfAkMXd6y3wiAtxtNlICJwFMiogoD6jkpUkg&m=ppRE3mLmLwEUK40XIVKCcYhDBPg6Ut8daFHz3--izi4&s=Y_rKfgK60QKPvt-a1cR51zCfjhe03CecdbU1RGJHEmk&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__www.iconplc.com&d=CwMGaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=4WqjVFXRfAkMXd6y3wiAtxtNlICJwFMiogoD6jkpUkg&m=ppRE3mLmLwEUK40XIVKCcYhDBPg6Ut8daFHz3--izi4&s=Y_rKfgK60QKPvt-a1cR51zCfjhe03CecdbU1RGJHEmk&e= From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Nick Holford Sent: Thursday, January 21, 2016 11:33 AM To: [email protected]<mailto:[email protected]> Subject: Re: [NMusers] NONMEM code verification Ana, I call this process fixed effect (or deterministic) model qualification. I code complex models using Berkeley Madonna then run NONMEM without any $EST or $SIM records. The NONMEM PRED values should agree with the Berkeley Madonna predictions if your structural model is coded the same way in both systems. Best wishes, Nick On 20-Jan-16 11:14, Ana Miranda Bastos wrote: > > Hi, > > > I have a complex model with manually coded ODEs and multiple > compartments. VPC etc seem ok but simulation results are getting a bit > weird. > > > I'd like to find out what people use to ensure that the NONMEM code > written really represents the set of ODEs written on paper. Just to > clarify, this is just to make sure the NONMEM instructions are > actually a correct representation of the mathematical description of > the model, not if the model is a correct representation of the biology > at this stage. > > > This problem is not so obvious when you use the built-in macros but > once the model grows complex, and has a lot manual inputs, it is more > likely that a bug creeps in. > > > I'm looking for something more stringent than a code review by a peer. > > > Thank you advance for your time and attention, > > > Ana > > > ------------------------------------------ > Ana Bastos, Pharm, MSc, PhD student > Pharmacologie cellulaire et moléculaire > (Cellular and Molecular Pharmacology Unit) > Louvain Drug Research Institute > Université catholique de Louvain (Catholic University of Louvain) > UCL 7370 avenue E. Mounier 73 > 1200 Bruxelles, Belgique > -- Nick Holford, Professor Clinical Pharmacology Dept Pharmacology & Clinical Pharmacology, Bldg 503 Room 302A University of Auckland,85 Park Rd,Private Bag 92019,Auckland,New Zealand office:+64(9)923-6730<tel:%2B64%289%29923-6730> mobile:NZ+64(21)46 23 53 email: [email protected]<mailto:[email protected]> https://urldefense.proofpoint.com/v2/url?u=http-3A__holford.fmhs.auckland.ac.nz_&d=CwMGaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=4WqjVFXRfAkMXd6y3wiAtxtNlICJwFMiogoD6jkpUkg&m=ppRE3mLmLwEUK40XIVKCcYhDBPg6Ut8daFHz3--izi4&s=n_lm1CsMIyouNC38ssmFpdHdQGI1_0IDXFKGjy0C-iE&e= "Declarative languages are a form of dementia -- they have no memory of events" Holford SD, Allegaert K, Anderson BJ, Kukanich B, Sousa AB, Steinman A, Pypendop, B., Mehvar, R., Giorgi, M., Holford,N.H.G. Parent-metabolite pharmacokinetic models - tests of assumptions and predictions. Journal of Pharmacology & Clinical Toxicology. 2014;2(2):1023-34. Holford N. Clinical pharmacology = disease progression + drug action. Br J Clin Pharmacol. 2015;79(1):18-27.
Jan 19, 2016 Ana Miranda Bastos NONMEM code verification
Jan 21, 2016 Ana Miranda Bastos NONMEM code verification
Jan 21, 2016 Nick Holford Re: NONMEM code verification
Jan 21, 2016 Robert Bauer RE: NONMEM code verification
Jan 21, 2016 Kyle Baron Re: NONMEM code verification
Jan 22, 2016 S.d Bakshi RE: NONMEM code verification
Jan 22, 2016 Bill Denney Re: NONMEM code verification
Jan 25, 2016 Ana Miranda Bastos Re: NONMEM code verification