Post Reply 
NORMALD_ICDF (LEFT/CENTER/RIGHT)
02-29-2020, 06:18 AM
Post: #3
RE: NORMALD_ICDF (LEFT/CENTER/RIGHT)
(02-20-2020 09:03 PM)StephanP Wrote:  NORMALD_ICDF(185,10,.85,RIGHT)=NORMALD_ICDF(185,10,1-0.85)=174.635...
NORMALD_ICDF(185,10,.85,CENTER)={170.604...; 199.395...}

I've been thinking about this suggestion. Using RIGHT or CENTER works well on the TI-84+ CE because there is a dialog box ("Wizard") that makes selecting RIGHT or CENTER very easy. If I had to actually type out "RIGHT" then I think I would resort to using 1-0.85.

Since Prime stats functions already allow for an optional number of arguments, what if calling NORMALD_ICDF with no arguments popped up dialog box, say something like:

Code:
//////////////////////////
// Inverse Normal CDF   //
//////////////////////////

// local but persistent
LOCAL mu=0, sigma=1, area=0.05, tail=1;

EXPORT NormalInv()
BEGIN
 LOCAL status;

 status:=INPUT(
   {
     {mu,[0],{20,50,0}},
     {sigma,[0],{20,50,1}},
     {area,[0],{20,50,2}},
     {tail,{"left","right","inner","outer"},{20,25,3}}
   },
   "Inverse Normal CDF",
   {"Mean:","StdDev:","Area:","Tail:"},
   {"mean of the distribution","standard deviation of the distribution","area (probability)","left, right, inner, or outer area"}
  );
 IF status==0 THEN
  RETURN "canceled";
 END;
 CASE
  // left
  IF tail==1 THEN RETURN NORMALD_ICDF(mu,sigma,area); END
  // right
  IF tail==2 THEN RETURN -NORMALD_ICDF(-mu,sigma,area); END // more precise than NORMALD_ICDF(mu,sigma,1-area) for very small areas
  // inner
  IF tail==3 THEN RETURN {NORMALD_ICDF(mu,sigma,(1-area)/2),-NORMALD_ICDF(-mu,sigma,(1-area)/2)}; END
  // outer (2 tail)
  IF tail==4 THEN RETURN {NORMALD_ICDF(mu,sigma,area/2),-NORMALD_ICDF(-mu,sigma,area/2)}; END
  DEFAULT RETURN "invalid tail";
 END;
END;

When the 84+ introduced the Wizard option for stats functions back in 2011, it make a huge difference in my stats classes. Previously, my students always had difficulty remembering the order of the arguments in the commands. With Stats Wizards, that problem instantly went away.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: NORMALD_ICDF (LEFT/CENTER/RIGHT) - Wes Loewer - 02-29-2020 06:18 AM



User(s) browsing this thread: 1 Guest(s)