Re: AW: Re: Parameter Estimation in IF Conditioning Statement

From: Leonid Gibiansky Date: September 20, 2013 technical Source: mail-archive.com
Sorry, there was a typos in the code, here is the version with continuous SLOPE function IF(CONC.LE.THRESH) SLOPE = THETA(3)+THETA(4)*CONC+ETA(2) IF(CONC.GT.THRESH) SLOPE = THETA(3)+THETA(4)*THRESH+THETA(5)*(CONC-THRESH)+ETA(2) Then, if you rename NEWTHETA3 = THETA(3)+THETA(4)*THRESH you will have IF(CONC.LE.THRESH) SLOPE = NEWTHETA3+THETA(4)*(CONC-THRESH)+ETA(2) IF(CONC.GT.THRESH) SLOPE = NEWTHETA3+THETA(5)*(CONC-THRESH)+ETA(2) exactly as your second version (up to the parametrization). Leonid -------------------------------------- Leonid Gibiansky, Ph.D. President, QuantPharm LLC web: www.quantpharm.com e-mail: LGibiansky at quantpharm.com tel: (301) 767 5566
Quoted reply history
On 9/19/2013 6:42 PM, Leonid Gibiansky wrote: > Benjamin. > Even as WCMIN is continuous by nature, it is not continuous in the > dataset (at observation points). You may look at your WCMIN values in > the data file (I assume this values are in the data file?) and see where > the initial conditions for THETA(1) placed in that range. Step for > gradient computations can be quite small, so it will not see continuous > nature of the variable, and will treat it as discrete. > > One the same model but separate topic, I am not sure that you can code > the model as you coded it if you indeed assume that WCMIN=CONC. > It is better to write as (set aside problems with the gradient): > > IF(WCMIN.LE.THRESH) SLOPE = THETA(3)+THETA(4)*CONC+ETA(2) > > IF(WCMIN.GT.THRESH) SLOPE = THETA(3)*WCMIN+THETA(5)*(CONC-WCMIN)+ETA(2) > > Otherwise, you SLOP function will be discontinuous at WCMIN as a > function of CONC. > > Note also that your two models are not exactly equivalent. If you use > IF(WCMIN.LE.THRESH) SLOPE = THETA(3)+THETA(4)*CONC+ETA(2) > IF(WCMIN.GT.THRESH) SLOPE = THETA(3)+THETA(5)*CONC+ETA(2) > > your values at WCMIN=THRESH are equal to > SLOPE = THETA(3)+THETA(4)*THRESH+ETA(2) > SLOPE = THETA(3)+THETA(5)*THRESH+ETA(2) > immediately before and after WCMIN=THRESH (different) > > while for the second model they are equal to > > SLOPE = THETA(3)+ETA(2) > SLOPE = THETA(3)+ETA(2) > > and equal to each other > > Leonid > > -------------------------------------- > Leonid Gibiansky, Ph.D. > President, QuantPharm LLC > web: www.quantpharm.com > e-mail: LGibiansky at quantpharm.com > tel: (301) 767 5566 > > On 9/19/2013 4:29 PM, [email protected] wrote: > > > Hi Leonid. Thanks for your quick response. WCMIN is continuous. In > > fact, it is actually identical to CONC (forgot to change it while > > simplifying). Any thoughts on this?Ben > > > > ----- Originalnachricht ----- > > Von: Leonid Gibiansky [mailto:[email protected]] > > Gesendet: Thursday, September 19, 2013 09:32 PM > > An: Weber,Dr.,Benjamin (TransMed) BIP-DE-B > > Cc: [email protected] <[email protected]> > > Betreff: Re: [NMusers] Parameter Estimation in IF Conditioning Statement > > > > Hi Benjamin > > I think the problem was that when nonmem tested small variations of > > THETA(1) in the first version, nothing changed in the OF as these > > variation have not resulted in the change in the IF conditions (e.g., if > > your data contained WCMIN values 1 and 2 and nothing in between, and > > THETA(1) was 1.5, changes of THETA(1) to 1.6 or 1.4 were not resulting > > in the changes in OF, gradient was zero, and the gradient method was > > unable to move the model. When you put theta(1) in the centering, this > > resulted in changes of OF. This is not an unusual behavior. Therefore, > > it is better to use continuous functions rather than switches. For > > example, you can code it as > > > > INT = THETA(4)+(THETA(5)-THETA(4))/(1+(THETA(1)/WCMIN)**GAM) > > > > SLOPE = THETA(3)+INT*CONC+ETA(2) > > > > When GAM is infinity, this is equivalent to your model. You may use > > large GAM (or even estimated GAM) > > > > Leonid > > > > -------------------------------------- > > Leonid Gibiansky, Ph.D. > > President, QuantPharm LLC > > web: www.quantpharm.com > > e-mail: LGibiansky at quantpharm.com > > tel: (301) 767 5566 > > > > On 9/19/2013 2:31 PM, [email protected] wrote: > > > > > Dear NONMEM users, > > > > > > My goal was to add a drug effect to a disease progression model in a way > > > that the drug effect is different when a certain threshold concentration > > > is exceeded (similarly to modeling a ‘hockey-stick’ when performing > > > covariate analysis). First, I did it in the following way (partial > > > simplified code) > > > > > > $PRED > > > > > > THRESH = THETA(1) ;threshold concentration > > > > > > INT = THETA(2)+ ETA(1) > > > > > > IF(WCMIN.LE.THRESH) SLOPE = THETA(3)+THETA(4)*CONC+ETA(2) > > > > > > IF(WCMIN.GT.THRESH) SLOPE = THETA(3)+THETA(5)*CONC+ETA(2) > > > > > > IPRED=INT+SLOPE*TIME > > > > > > and NONMEM did not manage to estimate THRESH=THETA(1) (i.e., the initial > > > estimate did not change during minimization and the gradient was zero > > > throughout). I tried this for several different initial estimates. > > > > > > I then centered the observed CONC on THRESH and run the following model > > > because colleagues mentioned that they have successfully run a > > > ‘hockey-stick’ estimating the threshold parameter (partial > > > simplified code) > > > > > > IF(WCMIN.LE.THRESH) SLOPE = THETA(3)+THETA(4)*(CONC-THRESH)+ETA(2) > > > > > > IF(WCMIN.GT.THRESH) SLOPE = THETA(3)+THETA(5)*(CONC- THRESH)+ETA(2) > > > > > > This time, NONMEM provided very reasonable estimates for all model > > > parameters and the covariance step was successful. > > > > > > I wonder now if the centering of the variable (and hence something > > > particular to the data set) caused the difference in estimability of the > > > threshold parameter or whether NONMEN cannot estimate parameters that > > > only occur in the conditioning part of the IF statement (Note that after > > > centering THRESH also appears in another part of the code). > > > > > > Could somebody please provide some insight on this? I have searched in > > > the NONMEM user group but could not find anything. > > > > > > Mit freundlichen Grüßen / Kind regards, > > > Dr. Benjamin Weber > > > > > > Boehringer Ingelheim Pharma GmbH & Co. KG > > > Translational Medicine > > > Tel.: +49 (7351) 54-143520 > > > Fax: +49 (7351) 83-143520 > > > mailto:[email protected] > > > > > > Boehringer Ingelheim Pharma GmbH & Co. KG, Sitz: Ingelheim am Rhein; > > > Registergericht Mainz: HR A 22206; Komplementär Boehringer Ingelheim > > > Deutschland GmbH; Geschäftsführung: Dr. Engelbert Günster > > > (Vorsitzender), Ursula Fuggis-Hahn, Ralf Gorniak, Michael Klein, Dr. > > > Martin Wanning; Vorsitzender des Aufsichtsrates: Dr. Joachim Hasenmaier; > > > Sitz: Ingelheim am Rhein; Registergericht Mainz: HR B 23260 > > > > > > Diese E-Mail ist vertraulich zu behandeln. Sie kann besonderem > > > rechtlichem Schutz unterliegen. Wenn Sie nicht der richtige Adressat > > > sind, senden Sie bitte diese E-Mail an den Absender zurück, löschen die > > > eingegangene E-Mail und geben den Inhalt der E-Mail nicht weiter. > > > Jegliche unbefugte Bearbeitung, Nutzung, Vervielfältigung oder > > > Verbreitung ist verboten. / This e-mail is confidential and may also be > > > legally privileged. If you are not the intended recipient please reply > > > to sender, delete the e-mail and do not disclose its contents to any > > > person. Any unauthorized review, use, disclosure, copying or > > > distribution is strictly prohibited.
Sep 19, 2013 Benjamin Weber AW: Re: Parameter Estimation in IF Conditioning Statement
Sep 19, 2013 Leonid Gibiansky Re: AW: Re: Parameter Estimation in IF Conditioning Statement
Sep 20, 2013 Leonid Gibiansky Re: AW: Re: Parameter Estimation in IF Conditioning Statement
Sep 20, 2013 Nick Holford Re: AW: Re: Parameter Estimation in IF Conditioning Statement