Essays/t-Distribution CDF

From J Wiki
Jump to navigation Jump to search

x tcdf y computes the CDF at y of the t-distribution with x degrees of freedom.

tcdf=: 4 : 0
 assert. (%:x)>|y
 0.5 + y * (!-:x-1) * ((0.5,-:1+x) H. 1.5 x%~-*:y) % (%:o.x) * !<:-:x
)


   5 tcdf 2.01505 1.47588
0.95 0.899999



See also


Contributed by Roger Hui.