(35S) Statistical Distributions Functions
10-28-2015, 07:54 PM (This post was last modified: 10-28-2015 08:00 PM by Dieter.)
Post: #29
 Dieter Senior Member Posts: 2,398 Joined: Dec 2013
RE: HP 35s Statistical Distributions Functions
(10-28-2015 06:21 PM)PedroLeiva Wrote:  I think we have tight-fitting Student t-distribution. I attached the pdf with the program that Thomas wrote, five calculation examples (test cases), an outline of the distribición and an instruction table for input and output of data.

For the record, here is a version without using the Integrate function. It is based on algorithm AS 3, published as a Fortran program in Applied Statistics (1968). This version includes an improved input routine for the degrees of freedom in that it checks whether the input is a positive integer. Again, both the PDF and CDF are returned on the stack (in Y and X). Code for the inverse is not yet included.

Code:
T001  LBL T T002  ALL T003  INPUT J T004  ENTER T005  ABS T006  IP T007  x=y? T008  x=0? T009  GTO T001 T010  e T011  IP T012  STO T T013  SGN T014  - T015  RCL÷ T T016  ! T017  LASTx T018  RCL T T019  1/x T020  - T021  ! T022  ÷ T023  Pi T024  RCLx J T025  √x T026  ÷ T027  STO G T028  FIX 9 T029  INPUT X T030  RCL J T031  √x T032  ÷ T033  STO A T034  RCL J T035  RCL X T036  x² T037  RCL+ J T038  ÷ T039  STO B T040  RCL J T041  RCL T T042  RMDR T043  RCL+ T T044  STO K T045  SGN T046  STO C T047  ENTER T048  ENTER T049  RCL K T050  RCL- J T051  x≥0? T052  GTO T066 T053  SGN T054  RCL+ K T055  RCLx B T056  RCL÷ K T057  RCLx C T058  STO C T059  + T060  x=y? T061  GTO T066 T062  RCL T T063  STO+ K T064  R↓ T065  GTO T047 T066  R↓ T067  STO C T068  RCL J T069  RCL T T070  RMDR T071  x=0? T072  GTO T090 T073  RCL- J T074  x=0? T075  STO C T076  RCL A T077  RCLx B T078  RCLx C T079  Pi T080  ÷ T081  RCL A T082  ATAN T083  RCL T T084  +/- T085  SGN T086  ACOS T087  ÷ T088  + T089  GTO T095 T090  RCL B T091  √x T092  RCLx A T093  RCLx C T094  RCL÷ T T095  RCL T T096  1/x T097  + T098  RCL X T099  x² T100  RCL÷ J T101  RCL T T102  SGN T103  + T104  LASTx T105  RCL+ J T106  RCL÷ T T107  +/- T108  y^x T109  RCLx G T110  x<>y T111  STOP T112  GTO T028

Here is Thomas' sample case:

Code:
[XEQ] T [ENTER]             J=? Enter degrees of freedom      7  [R/S]               X=? Enter random variable X     1,5 [R/S]               0,126263061   // =PDF(1,5|7)                             0,911350757   // =CDF(1,5|7) Do another calculation         [R/S]               X=?     -2  [R/S]               0,063135337   // =PDF(-2|7)                             0,042809664   // =CDF(-2|7)

Final remark: like the other programs discussed in this thread, this is a rather simple and straightforward implementation that works fine for most practical cases. However, far out in the distribution tails the results may lose accuracy due to rounding, and eventually values may round to 0 or 1. For instance, for 7 d.o.f. and x=–100 you will get a CDF of 2,000...E–12 while the exact result is 1,318 E–12, and for x=0 the returned result is zero while it actually is 1,69 E–17. If you want more or less exact values even for such extreme arguments, a different approach is required.

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread (35S) Statistical Distributions Functions - PedroLeiva - 10-25-2015, 12:19 AM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-25-2015, 01:29 PM RE: HP 35s Statistical Distributions Functions - SlideRule - 10-26-2015, 03:03 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-26-2015, 04:41 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-26-2015, 08:30 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-26-2015, 10:29 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-26-2015, 11:04 PM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-26-2015, 08:39 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-26-2015, 09:25 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-27-2015, 02:29 PM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-26-2015, 09:28 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-27-2015, 11:59 AM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-27-2015, 04:48 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-27-2015, 05:22 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-27-2015, 07:32 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-27-2015, 10:25 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-28-2015, 12:24 AM RE: HP 35s Statistical Distributions Functions - Dieter - 10-28-2015, 12:34 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-28-2015, 06:59 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-27-2015, 11:48 PM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-27-2015, 10:29 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-27-2015, 11:41 PM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-28-2015, 12:11 AM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-28-2015, 12:36 AM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-28-2015, 01:05 AM RE: HP 35s Statistical Distributions Functions - Dieter - 10-28-2015, 11:55 AM RE: HP 35s Statistical Distributions Functions - Thomas Klemm - 10-28-2015, 01:40 AM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-28-2015, 06:21 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-28-2015 07:54 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-28-2015, 10:34 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-30-2015, 02:36 AM RE: HP 35s Statistical Distributions Functions - Dieter - 10-30-2015, 01:56 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-30-2015, 05:20 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-30-2015, 07:16 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-30-2015, 07:43 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-30-2015, 11:08 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-30-2015, 11:16 PM RE: HP 35s Statistical Distributions Functions - rprosperi - 10-31-2015, 09:11 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-28-2015, 10:45 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 10-29-2015, 12:09 AM RE: HP 35s Statistical Distributions Functions - Dieter - 10-29-2015, 07:01 AM RE: HP 35s Statistical Distributions Functions - Dieter - 10-29-2015, 07:18 AM RE: HP 35s Statistical Distributions Functions - Dieter - 10-29-2015, 11:56 PM RE: HP 35s Statistical Distributions Functions - Dieter - 10-31-2015, 09:05 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-01-2015, 12:44 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-01-2015, 09:17 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-05-2015, 01:37 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-05-2015, 02:16 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-13-2015, 06:59 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-13-2015, 08:04 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-13-2015, 09:05 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-14-2015, 11:22 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-15-2015, 03:04 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-15-2015, 09:26 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-16-2015, 01:13 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-16-2015, 07:08 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-16-2015, 10:47 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-17-2015, 12:44 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-17-2015, 09:20 PM RE: HP 35s Statistical Distributions Functions - Gerald H - 11-19-2015, 09:24 AM RE: HP 35s Statistical Distributions Functions - Dieter - 11-19-2015, 01:00 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-19-2015, 01:17 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-19-2015, 08:31 PM RE: HP 35s Statistical Distributions Functions - Gerald H - 11-19-2015, 05:52 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-20-2015, 12:09 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-20-2015, 01:19 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-20-2015, 05:45 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-20-2015, 08:30 PM RE: HP 35s Statistical Distributions Functions - Marcio - 11-20-2015, 08:37 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-20-2015, 08:54 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-20-2015, 11:06 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-21-2015, 07:27 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-20-2015, 05:47 PM RE: HP 35s Statistical Distributions Functions - Marcio - 11-20-2015, 12:24 PM RE: HP 35s Statistical Distributions Functions - PedroLeiva - 11-26-2015, 11:07 PM RE: HP 35s Statistical Distributions Functions - Dieter - 11-27-2015, 06:41 AM RE: HP 35s Statistical Distributions Functions - Dieter - 11-29-2015, 06:50 PM

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