Survival nelsonaalencurve equals - CyrilB1531/lodestar GitHub Wiki

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

HomeSurvivalSurvival estimators

NelsonAalenCurve.Equals

Compares the steps and the cumulative hazard, element by element.

public bool Equals(NelsonAalenCurve other)

Parametersother is the curve to compare against, or null.

Returnstrue when the steps and the hazard hold the same values.

Example — the same curve, built twice.

using Lodestar.Survival;

NelsonAalenCurve left = new([new(0.0, 4, 0, 0), new(1.0, 4, 1, 0)], [0.0, 0.25]);
NelsonAalenCurve right = new([new(0.0, 4, 0, 0), new(1.0, 4, 1, 0)], [0.0, 0.25]);

bool same = left == right;  // => True

Remarks — a record's generated equality compares both arrays by reference, so the two above would be unequal without this. the equality rule has the rule.

Applies to — net10.0, netstandard2.0.

See alsoNelsonAalenCurve.GetHashCode, NelsonAalenCurve.