Skip to content

Stats chisquaredcontingencyresult gethashcode

github-actions[bot] edited this page Sep 27, 2026 · 1 revision

Development build. This page describes main, not a released package. The latest published Lodestar.Stats is 0.5.0 — read its documentation.

Home › Stats › Hypothesis tests

ChiSquaredContingencyResult.GetHashCode

A hash consistent with the equality, in constant time.

public int GetHashCode()

Returns — a hash over the scalars and the number of rows.

Example — equal results hash alike.

using Lodestar.Stats;

ChiSquaredContingencyResult left = new(1.5, 0.2, 1, [[1.0, 2.0], [3.0, 4.0]]);
ChiSquaredContingencyResult right = new(1.5, 0.2, 1, [[1.0, 2.0], [3.0, 4.0]]);

bool alike = left.GetHashCode() == right.GetHashCode();  // => True

Remarks — the table contributes its row count, never its frequencies. Equal results agree on that count, and walking the table would make hashing cost what the test itself cost.

Applies to — net10.0, netstandard2.0.

See also — ChiSquaredContingencyResult.Equals, ChiSquaredContingencyResult.

Clone this wiki locally