What this calculator does
This tool evaluates and plots the Student's t-distribution for any degrees of freedom \(\nu > 0\). You can choose one of three quantities: the probability density \(f(x,\nu)\), the lower cumulative probability \(P(x,\nu)\) (the CDF), or the upper cumulative probability \(Q(x,\nu) = 1 - P\). The calculator builds a table of (x, value) pairs over a range you define and feeds them to a line graph.
How to use it
Pick the function (density, lower, or upper). Enter the degrees of freedom \(\nu\). Then set the starting x value, the increment (step) between successive points, and the number of repetitions (how many points to generate). The points are \(x_k = \text{startX} + k\cdot\text{stepX}\) for \(k = 0..\text{iterations}-1\). With the defaults (start \(-5\), step \(0.1\), 101 points) x runs from \(-5\) to \(+5\).
The formula explained
The density is $$f(x,\nu) = \frac{\Gamma\!\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\!\left(\frac{\nu}{2}\right)}\left(1+\frac{x^{2}}{\nu}\right)^{-\frac{\nu+1}{2}}.$$ To stay numerically stable for large \(\nu\), we evaluate the gamma factors through the log-gamma function. The cumulative probability uses the regularized incomplete beta function \(I_z(\nu/2, 1/2)\) with \(z = \nu/(\nu+x^2)\): for \(x \ge 0\), \(P = 1 - \tfrac12 I_z\); for \(x < 0\), \(P = \tfrac12 I_z\). By symmetry \(P(0,\nu) = 0.5\).
Worked example
For density with \(\nu = 2\) at \(x = 0\): \((1 + 0/2)^{-1.5} = 1\), and \(B(1/2, 1) = 2\), so $$f(0,2) = \frac{1}{\sqrt{2} \cdot 2} = 0.353553.$$ For the lower cumulative with \(\nu = 2\) at \(x = 0\), the distribution is symmetric, so \(P(0,2) = 0.5\) and \(Q(0,2) = 0.5\).
FAQ
What happens as \(\nu\) grows? The t-distribution approaches the standard normal \(N(0,1)\); for instance \(f(0,\nu)\) tends to \(1/\sqrt{2\pi} \approx 0.39894\).
Can the increment be negative? Yes. A negative step lets x descend; a zero step repeats the same x.
Why is \(\nu\) restricted to be positive? The factors \(\sqrt{\nu}\) and \(\Gamma(\nu/2)\) require \(\nu > 0\); non-positive values are not defined for the distribution.