spearman_r

std.stats.spearman_r · Level L1

Spearman's rank correlation: the Pearson correlation of the two samples' midranks, so ties are handled by average ranks. Calls midrank and correlation.

ρ = corr(midrank(x), midrank(y))

Signature

spearman_r(x: f64[n], y: f64[n]) → f64[]

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.

xf64[n]yf64[n]midrankrxmidrankrycorrelationrhorhof64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size with n ≥ 2.
  • Agrees with the reference the correlation of sort-based midranks to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 40 float64 results inside the running error bound; the closest uses 3% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
68%
bit-equal to the NumPy formula in float64
25%
largest error, in units in the last place
1.80

Identity

sha256:646df6e7ddc10124d05cc1ccd4067304c08746c8f239c93f1373488dc53338ec

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 · Ω:spearman_r
Pins
sha256:1437450f8714cf4f7d5a82ed131c84178f52339f37d100d406a5c9d295318e0fthis graph and the 5 it reaches through calls
Evidence
sha256:c1dd3574b2ea9a17ff8d7a9d36cf50cf54fed188db6713291996239b733b80e3the 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.