Statistical Methods

Fit a nondecreasing sequence with isotonic regression

Define the task

State why the underlying relationship should be nondecreasing before imposing that restriction. Fix the order of the predictor values and document how repeated predictor values are aggregated. Isotonic regression finds ordered fitted values that minimize weighted squared differences from the observations. It does not assume a particular smooth curve.

Carry out the check

For equal weights, begin with one block per observation. Whenever a left block has a greater mean than the block to its right, pool them and replace both by their combined mean. Recheck the neighboring blocks until all means are nondecreasing. Restore one fitted value for every original position. Unequal reliability or sample sizes require an explicit weighting rule.

Worked hypothetical example

For hypothetical ordered responses 1, 3, 2 and 4, the middle two observations violate the restriction. Pooling them gives fitted values 1, 2.5, 2.5 and 4 with squared-error sum 0.5. A flat block represents the constrained fit, not proof that the underlying response is exactly constant. Report the restriction, weights, pooling and intended use before extrapolating the result.

Method checked 14 November 2026 against SciPy documentation: isotonic_regression.

Open the equal weight isotonic regression calculator.

Download the monotonicity constraint worksheet.

Related reading

Reading path: Analyze data. Guide 137 of 142. Choose any guide to suit your project.

Statistical Methods

Audit clustering in a binary sequence with run counts

Count contiguous blocks of two prespecified labels and compare their number with the random-order expectation.

Statistical Methods

Detect Redundant Columns Before Interpreting Regression Coefficients

Check exact dependencies in the fitted design rather than assuming a returned coefficient table identifies every parameter.

Browse this reading pathTools for this stageGuides and downloads for this stage