(35S) Statistical Distributions Functions
|
10-28-2015, 12:34 PM
(This post was last modified: 10-28-2015 12:58 PM by Dieter.)
Post: #26
|
|||
|
|||
RE: HP 35s Statistical Distributions Functions
(10-28-2015 12:24 AM)PedroLeiva Wrote: Dieter, the program works perfect!. Please include the function for the inverse, no mather how long it takes OK, here is a first version with a rough initial guess. At the X=? prompt simply enter a negative value if you want to compute the quantile for that probabily. If you already have entered the previous C program, simply add lines C010 and C011 and continue with line C054. Code: C001 LBL C Usage: At the X=? prompt enter the negative probability for which you want the Chi² quantile. The program will then display two estimates in Y and X (the previous and the current), so that you can see the iteration converge. Pressing R/S yields the next approximation. Code: [XEQ] C [ENTER] J=? If 18,307 is sufficiently accurate you may stop here. Otherwise continue: Code: [R/S] 18,307038039 When the two approximations are displayed you may also enter your own guess before pressing R/S, and the approximation will continue with this value. NB: This program is not very sophisticated, and it does not match what's inside the 34s. For instance, the latter evaluates CDFs for large x via P(x) = 1–Q(x), and also the quantile function has a much, much better initial guess. It took me quite a while to get the guess within <10% of the true value. ;-) For instance, the first guess for the case above is 18,2..., compared to the exact value 18,307... Some time ago I wrote 35s/41C programs for the Normal distribution. They evaluate the PDF, one- and two-sided CDFs and also one- and two-sided quantiles with several tweaks to ensure best possible accuracy and efficiency. But these are about three times the size of the small Chi² progam posted above. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)