home *** CD-ROM | disk | FTP | other *** search
- .MCD 20000 0
- .CMD PLOTFORMAT logs=0,0 subdivs=1,1 size=5,15 type=l
- .CMD FORMAT rd=d ct=10 im=i et=3 zt=15 pr=3 mass length time charge
- .CMD SET ORIGIN 0
- .CMD SET TOL 0.001000
- .CMD MARGIN 0
- .CMD LINELENGTH 78
- .CMD SET PRNCOLWIDTH 8
- .CMD SET PRNPRECISION 4
- .TXT 0 39 1 39
- a1,38,39,37
- Copyright (c) 1988 by MathSoft, Inc.
- .TXT 2 -13 1 28
- a1,27,57,26
- PROBABILITY DISTRIBUTIONS
- .TXT 2 -26 2 80
- a2,79,78,140
- This application calculates values for the following cumulative distribution
- functions. The function and variable names are listed below.
- .TXT 3 25 5 22
- a5,21,63,58
- Normal
- Chi-square
- Student's t
- F (variance ratio)
- Beta
- .TXT 6 -23 1 68
- a1,67,76,66
- cnorm(x) Normal distribution with mean 0 and variance 1
- .TXT 2 0 1 71
- a1,70,75,69
- Pchi(chi2,v) Chi-square distribution with v degrees of freedom
- .TXT 2 0 1 72
- a1,71,76,70
- PA(t,v) Student's t distribution with v degrees of freedom
- .TXT 2 0 1 70
- a1,69,76,68
- PF(F,v1,v2) F distribution with degrees of freedom v1 and v2
- .TXT 2 0 1 73
- a1,72,76,71
- PB(x,v1,v2) Beta distribution with degrees of freedom v1 and v2
- .TXT 2 0 1 15
- a1,14,76,13
- [Ctrl][PgDn]
- .TXT 2 0 2 77
- a2,76,76,139
- It is sometimes convenient to work with the complementary function giving
- the tail of the distribution. The complementary functions are:
- .TXT 3 0 1 71
- a1,70,76,69
- Qnorm(x) The complement or tail of the normal distribution
- .TXT 2 0 1 67
- a1,66,76,65
- Qchi(chi2,v) The complement of the chi-square distribution
- .TXT 2 0 1 58
- a1,57,76,56
- QA(t,v) The complement of the t distribution
- .TXT 2 0 1 59
- a1,58,77,57
- QF(F,v1,v2) The complement of the F distribution
- .TXT 2 0 1 61
- a1,60,76,59
- QB(F,v1,v2) The complement of the beta distribution
- .TXT 2 0 2 79
- a2,78,76,155
- These function definitions and the calculation routines follow Section 26 in
- "Handbook of Mathematical Functions," by Abramowitz and Stegun, Dover, 1965.
- .TXT 4 -1 1 15
- a1,14,76,13
- [Ctrl][PgDn]
- .TXT 2 0 1 77
- a1,76,77,75
- You can use these definitions in place of tables. Here are some examples:
- .TXT 2 0 1 46
- a1,45,77,44
- Chi-square at 5.6 for 7 degrees of freedom:
- .EQN 0 51 1 19
- Pchi(5.6,7)=?
- .TXT 2 -51 1 47
- a1,46,77,45
- Student's t at 2.5 for 2 degrees of freedom:
- .EQN 0 53 1 17
- PA(2.5,2)=?
- .TXT 2 -53 1 45
- a1,44,78,43
- Beta at .3 for 6 and 8 degrees of freedom:
- .EQN 0 52 1 18
- PB(.3,6,8)=?
- .TXT 2 -52 2 40
- a2,39,40,52
- The probability of a standard normal
- value > 1.5:
- .EQN 0 52 1 18
- Qnorm(1.5)=?
- .TXT 3 -52 2 40
- a2,39,40,70
- The probability of t values > 2 when
- there are 5 degrees of freedom:
- .EQN 0 55 1 15
- QA(2,5)=?
- .TXT 3 -55 2 42
- a2,41,40,78
- The probability of an F value > 2 when
- there are 3 and 5 degrees of freedom:
- .EQN 0 53 1 21
- QF(2,3,5)=?
- .TXT 3 -53 1 15
- a1,14,77,13
- [Ctrl][PgDn]
- .TXT 1 0 5 80
- a5,79,77,343
- Use the root function to find approximate α percentage points, that is,
- values x such that the probability of a larger value is α. The root function
- requires an initial guess: for chi-square with df degrees of freedom use df
- or 1.5df; when df = 1, use .5. For t and F use 1. With TOL = .00001 the
- results are usually correct within 1%.
- .EQN 6 0 1 14
- TOL~.00001
- .TXT 1 0 1 54
- a1,53,77,52
- .1 point for Chi-square with 10 degrees of freedom:
- .EQN 2 15 1 8
- x~10
- .EQN 0 26 1 35
- root(Qchi(x,10)-.1,x)={18994}?
- .TXT 2 -41 1 63
- a1,62,77,61
- .005 point for the t distribution with 2 degrees of freedom:
- .EQN 2 15 1 7
- x~1
- .EQN 0 27 1 33
- root(QA(x,2)-.005,x)={18994}?
- .TXT 2 -42 1 51
- a1,50,77,49
- .05 point for F with degrees of freedom 2 and 5:
- .EQN 2 15 1 7
- x~1
- .EQN 0 26 1 34
- root(QF(x,2,5)-.05,x)={19010}?
- .TXT 1 -41 1 15
- a1,14,77,13
- [Ctrl][PgDn]
- .TXT 2 0 1 58
- a1,57,77,56
- The following screens contain the function definitions.
- .TXT 2 1 1 22
- a1,21,75,20
- NORMAL DISTRIBUTION
- .TXT 2 0 1 40
- a1,39,76,38
- cnorm is a built-in MathCAD function.
- .EQN 2 0 1 25
- Qnorm(x)~1-cnorm(x)
- .TXT 5 -1 1 16
- a1,15,76,14
- BETA FUNCTION
- .EQN 2 3 3 20
- ß(a,b)~(Γ(a)*Γ(b))/Γ(a+b)
- .TXT 5 -3 1 26
- a1,25,78,24
- CHI SQUARE DISTRIBUTION
- .TXT 2 0 1 45
- a1,44,78,43
- Series approximations, good for small chi:
- .EQN 2 0 1 22
- Pchi_index_~1;10
- .EQN 0 28 1 31
- altneg(n)~if(mod(n,2),-1,1)
- .EQN 1 -29 10 81
- Pchi_s(chi2,v)~(chi2/2)^(v/2)/Γ(v/2)*(2/v+Pchi_index_$(altneg(Pchi_index_)*(chi2/2)^Pchi_index_)/(Pchi_index_!*(v/2+Pchi_index_)))
- .TXT 14 0 1 60
- a1,59,78,58
- Integral approximations, workable for high values of chi:
- .EQN 2 0 9 49
- Pchi_i(chi2,v)~1/(2^(v/2)*Γ(v/2))*(2&chi2`t^(v/2-1)*exp(-t/2)&t)
- .EQN 14 0 1 73
- Pchi(chi2,v)~if(chi2<2,Pchi_s(chi2,v),Pchi_s(2,v)+Pchi_i(chi2,v))
- .EQN 2 0 1 33
- Qchi(chi2,v)~1-Pchi(chi2,v)
- .TXT 3 0 1 77
- a1,76,78,75
- THE INCOMPLETE BETA FUNCTION (used in defining Student's t, F, and beta)
- .TXT 2 0 1 26
- a1,25,78,24
- Fundamental definition:
- .EQN 2 0 3 52
- Iß_integral(x,a,b)~1/ß(a,b)*(0&x`t^(a-1)*(1-t)^(b-1)&t)
- .TXT 4 0 1 37
- a1,36,78,35
- Practical transformation of above:
- .EQN 2 1 1 9
- ε~.01
- .EQN 1 -1 4 27
- Ißint1(x,a,b)~1/ß(a,b)*x^a/a
- .EQN 6 0 4 54
- Ißint2(x,a,b)~1/ß(a,b)*(ε^a/a+(ε&x`t^(a-1)*(1-t)^(b-1)&t))
- .EQN 6 0 4 74
- Ißint3(x,a,b)~1/ß(a,b)*((ε^b-(1-x)^b)/b+ε^a/a+(ε&1-ε`t^(a-1)*(1-t)^(b-1)&t))
- .EQN 6 0 1 80
- Ißi(x,a,b)~if(x<ε,Ißint1(x,a,b),if(x<1-ε,Ißint2(x,a,b),Ißint3(x,a,b)))
- .TXT 7 0 1 44
- a1,43,78,42
- Approximation accurate when a+b is large:
- .EQN 2 0 11 157
- Ißs(x,a,b)~if((((a+b-1)*(1-x))≤0.8),Qchi((a+b-1)*(1-x)*(3-x)-(1-x)*(b-1),2*b),cnorm(3*(((b*x)^(1/3)*(1-1/(9*b))-(a*(1-x))^(1/3)*(1-1
- /(9*a)))/\(b^(-1/3)*x^(2/3)+a^(-1/3)*(1-x)^(2/3)))))
- .TXT 12 0 1 69
- a1,68,78,67
- Use symmetry transformation, for better speed and higher accuracy:
- .EQN 2 0 1 67
- Iß_series_flip(x,a,b)~if(x>0.5,Ißs(x,a,b),1-Ißs(1-x,b,a))
- .TXT 3 0 1 30
- a1,29,78,28
- Define the master function.
- .EQN 2 0 1 62
- Iß(x,a,b)~if((a+b≤6),Ißi(x,a,b),Iß_series_flip(x,a,b))
- .TXT 5 0 1 27
- a1,26,78,25
- STUDENT'S t DISTRIBUTION
- .EQN 1 0 4 55
- QA(t,v)~(t<0)+if(t<0,-1,1)*(1/2)*Iß(v/(v+t^2),v/2,1/2)
- .EQN 4 0 1 23
- PA(t,v)~1-QA(t,v)
- .TXT 2 0 1 43
- a1,42,78,41
- F (VARIANCE RATIO) DISTRIBUTION FUNCTION
- .EQN 2 0 3 35
- QF(F,v1,v2)~Iß(v2/(v2+v1*F),v2/2,v1/2)
- .EQN 4 0 1 31
- PF(F,v1,v2)~1-QF(F,v1,v2)
- .TXT 2 0 1 29
- a1,28,78,27
- BETA DISTRIBUTION FUNCTION
- .EQN 2 0 3 27
- PB(x,v1,v2)~Iß(x,v1/2,v2/2)
- .EQN 4 0 1 31
- QB(x,v1,v2)~1-PB(x,v1,v2)
-