[WP-34S] Chi-Square Distribution
01-11-2014, 06:18 PM
Post: #3
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: [WP-34S] Chi-Square Distribution
(01-11-2014 03:02 PM)walter b Wrote:
(01-11-2014 01:37 PM)Sanjeev Visvanatha Wrote:  Degrees of freedom = 19
Upper tail probability = 0.001

5.4068 is correct for 0.1%, while 43.8202 is correct for 99.9% Integrating form zero to p, the value returned must increase for growing p (see pp. 54f of the manual quoted). The HP-21S calculates with the error probability instead.

I tried this example on my 34s (v. 3.2 3405) and was puzzled about the execution time: about 25 seconds. So I wrote a short quick-and-dirty program based on my original contributions for the chi-square quantile (providing a decent initial guess, followed by a slightly modified Newton iteration), and even this simple user-code program got the result in not much more than four (!) seconds (SP), resp. 5-6 seconds in DP mode. The initial guess is approx. 5,6 (resp. 42,8 for p=0,999) and requires four or five iterations for SP accuracy and one or two more for DP.

Another example:
n = 20, p = 0,05 requires 17 s with the internal function and about 4 resp. 5 s in user code.

Which leads to the question: what's going on there?

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread [WP-34S] Chi-Square Distribution - Sanjeev Visvanatha - 01-11-2014, 01:37 PM RE: [WP-34S] Chi-Square Distribution - walter b - 01-11-2014, 03:02 PM RE: [WP-34S] Chi-Square Distribution - Dieter - 01-11-2014 06:18 PM RE: [WP-34S] Chi-Square Distribution - Sanjeev Visvanatha - 01-12-2014, 03:16 PM RE: [WP-34S] Chi-Square Distribution - Sanjeev Visvanatha - 01-12-2014, 03:13 PM RE: [WP-34S] Chi-Square Distribution - walter b - 01-12-2014, 05:57 PM RE: [WP-34S] Chi-Square Distribution - Sanjeev Visvanatha - 01-12-2014, 07:23 PM The sheet (was: RE: [WP-34S] Chi-Square Distribution) - walter b - 01-13-2014, 07:55 PM RE: [WP-34S] Chi-Square Distribution - Sanjeev Visvanatha - 01-14-2014, 03:04 AM RE: [WP-34S] Chi-Square Distribution - Paul Dale - 01-11-2014, 11:11 PM RE: [WP-34S] Chi-Square Distribution - Dieter - 01-12-2014, 02:37 PM RE: [WP-34S] Chi-Square Distribution - Paul Dale - 01-12-2014, 09:38 PM RE: [WP-34S] Chi-Square Distribution - Dieter - 01-12-2014, 10:21 PM RE: [WP-34S] Chi-Square Distribution - Paul Dale - 01-13-2014, 01:08 AM RE: [WP-34S] Chi-Square Distribution - Dieter - 01-14-2014, 02:33 PM RE: [WP-34S] Chi-Square Distribution - walter b - 01-14-2014, 02:46 PM RE: [WP-34S] Chi-Square Distribution - Dieter - 01-14-2014, 03:11 PM RE: [WP-34S] Chi-Square Distribution - Paul Dale - 01-14-2014, 10:07 PM RE: [WP-34S] Chi-Square Distribution - Dieter - 01-14-2014, 11:05 PM RE: [WP-34S] Chi-Square Distribution - Paul Dale - 01-16-2014, 01:41 AM

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