NONMEM Users Network Archive

Hosted by Cognigen

Re: PHI inverse?

From: Ron Keizer <ron.keizer>
Date: Sun, 13 May 2012 22:20:20 +0200

hi Chuanpu,
looking more closely, it actually seems a bit better than stated in my
previous mail: the errors for conversions back and forth (x --> cdf -->
inv(cdf)) ranged between 1.99e-7 and 4.11e-9, tested for 200 values. I
hope that is enough for your problem.
best regards,
Ron


On 5/13/12 9:47 PM, Hu, Chuanpu [JRDUS] wrote:
>
> Dear Ron,
>
> Thank you for the helpful response. I am a bit concerned about 1e-05,
> because I needed the function to contribute to objective function
> values. The website you kindly provided claims that this is β€œan
> algorithm with a relative error less than 1.15 Γ— 10^βˆ’9 in the entire
> region.” Would that mean that PHI computation in NONMEM has an
> accuracy of 1e-05?
>
> Best regards,
>
> Chuanpu
>
> *From:*Ron Keizer [mailto:ron.keizer
> *Sent:* Sunday, May 13, 2012 2:00 PM
> *To:* Hu, Chuanpu [JRDUS]
> *Cc:* nmusers
> *Subject:* Re: [NMusers] PHI inverse?
>
> hi Chuanpu,
> i found implemenations of such an approximation here:
> http://home.online.no/~pjacklam/notes/invnorm/
> <http://home.online.no/%7Epjacklam/notes/invnorm/>
> The fortran implementation can be easily implemented in NONMEM by
> putting in your code:
>
> $SUBROUTINE OTHER=dinvnorm.f
>
> and somewhere in the model code e.g.:
>
> B = PHI(ETA(1))
> " C = dinvnorm(B)
> C = C
>
> This seems to work nicely, in the basic example I tried, differences
> between the original eta and the recalculated value were < 1e-05.
>
> best regards,
> Ron
>
> PS. I'm including the fortran file below for archiving purposes.
>
>
> --- file dinvnorm.f
> real*8 function dinvnorm(p)
> real*8 p,p_low,p_high
> real*8 a1,a2,a3,a4,a5,a6
> real*8 b1,b2,b3,b4,b5
> real*8 c1,c2,c3,c4,c5,c6
> real*8 d1,d2,d3,d4
> real*8 z,q,r
> a1=-39.6968302866538
> a2=220.946098424521
> a3=-275.928510446969
> a4=138.357751867269
> a5=-30.6647980661472
> a6=2.50662827745924
> b1=-54.4760987982241
> b2=161.585836858041
> b3=-155.698979859887
> b4=66.8013118877197
> b5=-13.2806815528857
> c1=-0.00778489400243029
> c2=-0.322396458041136
> c3=-2.40075827716184
> c4=-2.54973253934373
> c5=4.37466414146497
> c6=2.93816398269878
> d1=0.00778469570904146
> d2=0.32246712907004
> d3=2.445134137143
> d4=3.75440866190742
> p_low=0.02425
> p_high=1-p_low
> if(p.lt.p_low) goto 201
> if(p.ge.p_low) goto 301
> 201 q=dsqrt(-2*dlog(p))
>
> z=(((((c1*q+c2)*q+c3)*q+c4)*q+c5)*q+c6)/((((d1*q+d2)*q+d3)*q+d4)*q+1)
> goto 204
> 301 if((p.ge.p_low).and.(p.le.p_high)) goto 202
> if(p.gt.p_high) goto 302
> 202 q=p-0.5
> r=q*q
>
> z=(((((a1*r+a2)*r+a3)*r+a4)*r+a5)*r+a6)*q/(((((b1*r+b2)*r+b3)*r+b4)*r+b5)*r+1)
> goto 204
> 302 if((p.gt.p_high).and.(p.lt.1)) goto 203
> 203 q=dsqrt(-2*dlog(1-p))
>
> z=-(((((c1*q+c2)*q+c3)*q+c4)*q+c5)*q+c6)/((((d1*q+d2)*q+d3)*q+d4)*q+1)
> 204 dinvnorm=z
> return
> end
> ---
>
>
> --
> -----------------------------------
> Ron Keizer, PharmD PhD
> Post-doctoral fellow
> Pharmacometrics Research Group
> Uppsala University
> -----------------------------------
>
>
>
>
> On 5/13/2012 5:21 PM, Hu, Chuanpu [JRDUS] wrote:
>
> Dear Colleagues,
>
> It appears that NM7 has the PHI() function but not its inverse. Before
> NM7 was available people used approximations of PHI, e.g., to handle
> BQL. Does anyone know of any similarly implementable approximations of
> the inverse function of PHI?
>
> Thank you,
>
> Chuanpu
>
> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
>
> Chuanpu Hu, Ph.D.
>
> Scientific Director
>
> Pharmacokinetics and Pharmacometrics
>
> Biologics Clinical Pharmacology
>
> Janssen Pharmaceutical Companies of Johnson & Johnson
>
> 1400 McKean Road, PO Box 776, Spring House, PA 19477
>
> Phone: 215-793-7288
>
> Fax: 215-986-1013
>
> E-mail: CHu25
>
> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
>


--
-----------------------------------
Ron Keizer, PharmD PhD
Post-doctoral fellow
Pharmacometrics Research Group
Uppsala University
-----------------------------------


Received on Sun May 13 2012 - 16:20:20 EDT

The NONMEM Users Network is maintained by ICON plc. Requests to subscribe to the network should be sent to: nmusers-request@iconplc.com.

Once subscribed, you may contribute to the discussion by emailing: nmusers@globomaxnm.com.