Stats chi2contingencyresult gethashcode - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Stats is 0.4.0 — read its documentation.
Home › Stats › Hypothesis tests
Chi2ContingencyResult.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;
Chi2ContingencyResult left = new(1.5, 0.2, 1, [1.0, 2.0], [3.0, 4.0](/CyrilB1531/lodestar/wiki/1.0,-2.0],-[3.0,-4.0));
Chi2ContingencyResult right = new(1.5, 0.2, 1, [1.0, 2.0], [3.0, 4.0](/CyrilB1531/lodestar/wiki/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 — Chi2ContingencyResult.Equals,
Chi2ContingencyResult.