Contents Links Search
 

RPN Scripts

RPN Documentation

Submit Script

Conversion
   Conversions
   Convert
   Euro
   Euro_Calculator
   Soundex
Engineering
   Feet_&_Inch
   Units
   Water
Entertainment
   Master_Mind
   Sticks!
Finance
   Annuity
   Euro_Calculator
   TVM_Financial_Functions
Math
   3D_Vectors_v1.2
   Base
   Base_Conversions
   Complex_Arithmetic
   Complex_Math
   Discrete_Math
   EBBases
   Fractions
   Fractions
   Least
   Logs_&_Powers
   Misc
   Regressions
   Scientific
   Scientific_Functions
   Scientific_Programmable
   Simple_Complex_Math
   Standard_Normal_Distribution
   Trig
Misc
   Health
   Husband's_Calculator
Physics
   Angle_of_View
   Depth_of_Field
   Physics_Functions
Time
   Clock
   Julian
   Multiple_Timer
   Stop5Watch
   Stopwatch
   Timer
Utility
   Board_Foot_Calculator
   Calendar_Functions
   Checkbook_II
   MiniG
   Stack_Handling_and_Saving
   WindChill

Standard Normal Distribution
Russ Lenth - email


summary
pdf, cdf, and quantile of the N(0,1) distribution

instructions
This adds basic functionality for the normal
distribution.

The pdf at z is the function
phi(z) = exp(-.5 z^2) / sqrt(2pi).

The cdf is the function
Phi(z) = integral phi(t)dt from t = -infinity to t = z.

The quantile is the solution z to the equation Phi(z) = p where p is the
value supplied.

The algorithm for the cdf is (26.2.16) in Abramowitz and Stegun,
which is accurate to +/- 1e-5.
(It'd be easy but bulkier to use (26.2.17), accurate to +/ -1e-8).
The quantile is obtained using the Tukey's lambda approximation
z = 4.92{p^.14 - (1-p)^.14} as a starter, and doing one Newton step.

code
RPN.1
[d]g1*Hne#'.39894228'*;
[p]g10<(nCpn1+:g1#'.33267'*1+tg1g1#'.9372980'*#'.1201676'-*#'.4361836'+*r2Cd*n1+);

[q]g1g1#'.14'Pr2n1+#'.14'P-#'4.92'*r2g2Cp-g2Cd/+;
"Normal dist"
"_p(x): pdf"Cd;
"_P(x): cdf"Cp;
"_Q(x): quantile"Cq;

top
Nth Lab
©1996 - 2001 all rights reserved
August 03, 2001
contact