t_test_1samp
std.stats.t_test_1samp · Level L5One-sample t-test of the mean against μ₀: [t, ν, p] with t = (x̄ − μ₀)/(s/√n), ν = n − 1, and the two-sided p = I_{ν/(ν+t²)}(ν/2, ½). The incomplete beta function's lower tail keeps a small p-value's relative accuracy.
Signature
t_test_1samp(x: f64[n], mu0: f64[]) → f64[3]
Requires: n ≥ 2
Structure
The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size with n ≥ 2.
- Agrees with the reference
t and ν exactly; p = 1 − 2·(F(|t|) − ½) through the t CDF's ₂F₁ formto 80 digits (100-digit arithmetic), on all 40 test cases. - All 120 float64 results inside the running error bound; the closest uses 18% of it.
- Interpreter and NumPy backend return bit-identical results.
- correctly rounded (the float64 nearest the exact value)
- 58%
- bit-equal to the NumPy formula in float64
- 98%
- largest error, in units in the last place
- 38
Large ulp counts appear where a result is tiny next to the numbers it is computed from (after cancellation, for example), so one unit in the last place is tiny too; the absolute error is still inside the bound. Results within their own error of zero are not counted.
Note
The reference computes the p-value from the hypergeometric form of the t distribution's CDF, so the incomplete beta function is checked against a different special function.
Identity
sha256:1198bc78e5d62cb40ac2fccb66916398c1f84e411f0bc8af7b9f4bb03af89175The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.stats.t_test_1samp · Ω:t_test_1samp
- Pins
sha256:9f7f2f7411a0ef4913fbc82829a3499c313bd9e34b7ece723180bac9033e13e5this graph and the 2 it reaches through calls- Evidence
sha256:9b73e7d6015de175aedcc026ea71296df98d238c3100199a8722e9dcf8015f48the hash of its verification record- Needs
- no capability: a pure function
Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.