spearman_r_test

std.stats.spearman_r_test · Level L5

The test of Spearman's rank correlation against zero, by the usual t approximation: [ρ, p] with the two-sided p = I_{1−ρ²}((n − 2)/2, ½), Student's t with n − 2 degrees of freedom. An approximation to the exact permutation distribution, closer as n grows. Calls spearman_r.

p = I_{1−ρ²}((n − 2)/2, ½)

Signature

spearman_r_test(x: f64[n], y: f64[n]) → f64[2]

Requires: n ≥ 3

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.

xf64[n]yf64[n]Sizen2.0spearman_rrhoSubtractnu0.5Multiplyr21.0Reshaperho1Multiplya0.0SubtractxrMaximumxbBetaIncpReshapep1Concatoutoutf64[2]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size with n ≥ 3.
  • Agrees with the reference ρ from sort-based midranks; p through the t CDF's ₂F₁ form to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 80 float64 results inside the running error bound; the closest uses 19% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
43%
bit-equal to the NumPy formula in float64
61%
largest error, in units in the last place
19

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.

Identity

Calls
Called by
—
sha256:17a7be4c001e58b5ef6c6ca36097b0baf01254745c25bfbb2e1df121f457b3b5

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.stats.spearman_r_test · Ω:spearman_r_test
Pins
sha256:aea32db57d052033dd9018965e7d5fc716e57295abc8ca585f4c4138c138f7e3this graph and the 6 it reaches through calls
Evidence
sha256:4b372e4fc168be8e9f1501c71613971acf73ef9be131ff34c6d10dab2fbf02acthe 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.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.