# Curve fits and model comparison

`relate_curve_fit` · Runs: Held: built, not on the server yet · Level: Checked against a reference: R 4.4.3 nls

Fits one curve family to X and Y, such as exponential, power, sigmoid or polynomial.

**Why it is held.** A specific fault has been found in this tool. The next sentence says which inputs it affects and whether it can return a wrong number. It returns some numbers without the unit or the limit needed to read them, and this is being corrected (SCI-832).

From server 1.0.0 this tool is called stats\_curve\_fit. Until then it answers as relate\_curve\_fit.

Research and education software; not medical advice, and not for diagnosis or treatment decisions. It computes from the inputs it receives. It does not check the person's data, design or sample.

[Catalogue](https://www.drybench.com/mcp/catalogue) / [Statistics](https://www.drybench.com/mcp/catalogue/statistics)

[Open in Drybench Assay](https://www.drybench.com/assay/app)

```cite
Curve fits and model comparison (relate_curve_fit), Drybench MCP server 1.0.0; nonlinear-families@1.1.0 (Checked against a reference); relationship-model-comparison@1.0.0 (Checked against a reference); https://www.drybench.com/mcp/tools/relate-curve-fit
```

## What it is

Required: unit (unspecified, replicates, rows, serial, technical). Fits one curve family by least squares (exponential growth, one- or two-phase exponential, power law, Boltzmann sigmoid, quadratic or cubic polynomial), or ranks several models by AICc through compare; family or compare is required. x0 is required for exponential families and compare. Profile or t intervals open only for replicate units, or row units with one value per row. AICc ranking is informational only.

Field: [Statistics](https://www.drybench.com/mcp/catalogue/statistics). It is the same calculation as [Drybench Assay](https://www.drybench.com/assay/app), called by an AI assistant through the server.

## What it does

**You give**

- `x` (required): X per row, in its own unit; null for a blank.
- `y` (required): Y per row: a number, null (blank), or an array of replicate values for that row.
- `unit` (required): What one point is (required; never inferred): 'replicates' (each replicate an independent unit), 'rows' (each row an independent unit, replicates technical: row means are used), 'serial' (serial reads of one unit), 'technical', or 'unspecified'. Inference needs 'replicates' or 'rows'.
- `xLabel`: Optional name of X.
- `yLabel`: Optional name of Y.
- `family`: Single curve family to fit (supply family or compare, never both).

and 5 more, listed below

No request is shown while this tool is held.

**Limits**

- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
- No other limit is recorded for this tool.

Every reply also carries its app's limits line: "A C50 estimated here describes this assay under these conditions and is not a binding constant."

### Every input, with its units

11 inputs

- `x` (required): X per row, in its own unit; null for a blank.
- `y` (required): Y per row: a number, null (blank), or an array of replicate values for that row.
- `unit` (required): What one point is (required; never inferred): 'replicates' (each replicate an independent unit), 'rows' (each row an independent unit, replicates technical: row means are used), 'serial' (serial reads of one unit), 'technical', or 'unspecified'. Inference needs 'replicates' or 'rows'.
- `xLabel`: Optional name of X.
- `yLabel`: Optional name of Y.
- `family`: Single curve family to fit (supply family or compare, never both).
- `label`: One- or two-phase exponential direction label (default 'decay').
- `x0`: Start X for exponential families (required for exponential families and compare).
- `plateau`: Optional fixed plateau in Y unit for 'one-phase' family only.
- `compare`: 2 to 10 distinct model keys to rank by AICc instead of fitting one family.
- `level`: Confidence coverage level for intervals (0.9, 0.95 default, or 0.99).

## The calculation

2 methods, each with its equations, constants and worked example.

### [Exponential, two-phase, power, Boltzmann and polynomial fits, with profile intervals](https://www.drybench.com/methods/m/nonlinear-families/1.1.0)

`nonlinear-families@1.1.0`

No equation is recorded for this version.

Kind of method: not recorded.

Worked example: not recorded for nonlinear-families\@1.1.0.

### [ΔAICc across fitted models, extra-sum-of-squares F for nested pairs](https://www.drybench.com/methods/m/relationship-model-comparison/1.0.0)

`relationship-model-comparison@1.0.0`

No equation is recorded for this version.

Kind of method: not recorded.

Worked example: not recorded for relationship-model-comparison\@1.0.0.

## Sources

No source is recorded for this tool's methods.

Read by AI-assisted sessions. No person has checked these readings.

## How it is checked

**Level:** Checked against a reference, the lowest of its 2 methods.

**Checked against:** Exponential, two-phase, power, Boltzmann and polynomial fits, with profile intervals: R 4.4.3 nls (port) on the 29 curve cases of the 0.11.0 fixture (exponential growth, one-phase, two-phase, power and Boltzmann; polynomials in exact fractions): residual sums of squares within 1e-8 relative, ln parameters within 1e-6 absolute and the others within 1e-6 × max(|value|, span), noiseless fits within 1e-8, polynomials within 1e-9 relative, profile bounds within 1e-3 in ln or scaled units of a SciPy direct profile, side states and withheld states exact; SciPy 1.13.1 least\_squares agrees on all 16 of the residual sums of squares it computes. Simulated coverage of the 95 percent profile intervals cleared on one design per family for growth, one-phase, two-phase, power and Boltzmann (2,000 replicates per family, every one estimable): every quantity covered at least 94.5 percent against a gate of 90 percent, with no side unresolved in the first 100 replicates' full profiles (2026-10-13). Intervals at 90 and 99 percent are not simulated. ΔAICc across fitted models, extra-sum-of-squares F for nested pairs: R 4.4.3 (anova between nested pairs, AIC, and AICc on the residual-sum-of-squares form) on the 9 comparison cases of the 0.11.0 fixture: the ranking, the parameter counts, the models left out with their reasons, and the F pairs and labels exact; between linear models ΔAICc within 1e-8 absolute, F and p within 1e-8; with a nonlinear model ΔAICc within 1e-4 absolute, F within 1e-5 and p within 1e-4; withheld states exact (2026-10-13). No SciPy cross-check.

**Cases:** Exponential, two-phase, power, Boltzmann and polynomial fits, with profile intervals: No case set is linked to this version. ΔAICc across fitted models, extra-sum-of-squares F for nested pairs: No case set is linked to this version.

**Hostile inputs:** Sent 118 malformed, extreme and misspelt calls. None broke it, and every call with an undeclared argument, or with text in place of a number or a true/false value, was declined with a reason. Run 2026-11-12-2 of 12 November 2026, server 0.11.0.

**Same answer:** Called twice and with its arguments in another order, it gave the same result. Run 2026-11-12-2 of 12 November 2026, server 0.11.0.

**Not checked:** Exponential, two-phase, power, Boltzmann and polynomial fits, with profile intervals: Not recorded. Its absence does not mean everything was checked. ΔAICc across fitted models, extra-sum-of-squares F for nested pairs: Not recorded. Its absence does not mean everything was checked.

**Open:** A specific fault has been found in this tool. The next sentence says which inputs it affects and whether it can return a wrong number. It returns some numbers without the unit or the limit needed to read them, and this is being corrected (SCI-832).

No independent scientist has yet reviewed this.

### What this project's records still lack

5 things

- A case worked by hand from the source's equation for both methods.
- The equation for both methods.
- The constants with their sources for both methods.
- A case set linked to this version for both methods.
- A record of what was not checked for both methods.

### Changes to its methods

0 changes

No change is logged for these method versions.
