Fit a multiple linear regression API

Ordinary least squares by Householder QR with coefficient standard errors, t-tests and intervals, R-squared, F, VIF, Durbin-Watson, Breusch-Pagan and confidence and prediction intervals. Matches NIST StRD Norris and Longley.

The Fit a multiple linear regression operation is part of the Statistics and SPC Calculators API on BRAINIAC.software. Ordinary least squares by Householder QR with coefficient standard errors, t-tests and intervals, R-squared, F, VIF, Durbin-Watson, Breusch-Pagan and confidence and prediction intervals. Matches NIST StRD Norris and Longley. It is exposed as POST /api/v1/statistics/linear-regression and priced at $0.05 USDC on Base. Payment uses the x402 exact scheme: an unpaid call returns HTTP 402 with payment requirements; after paying the exact USDC amount, retry the same request with a payment-signature header and Idempotency-Key. No account and no API key are required. Data sources for this product: NIST/SEMATECH e-Handbook of Statistical Methods NIST Statistical Reference Datasets (StRD) Norris, Longley and SiRstv ASTM E2587 control chart constants (d2, d3, c4 derived from their definitions and rounded to table precision) AIAG MSA 4th edition (gage R&R) and Box, Hunter & Hunter (designed experiments) Limitations: Pure computation on caller input: no data is fetched, stored or logged, and no network request is made at request time. Results are statistical calculations for human review, not a validated-software substitute or a regulatory, clinical or safety determination. Numeric arrays are finite JSON numbers; null marks a missing value and is dropped listwise, with the count returned as droppedRows. Requests are capped at 100,000 numbers. Distribution functions are implemented in the service and agree with R and SciPy to about 1e-9 on the reference cases; very small p-values keep relative accuracy only to about 1e-8. Regression uses Householder QR so NIST higher-difficulty datasets pass. Rank-deficient designs return an error that names the aliased columns. Exact nonparametric p-values ignore ties (the no-ties null distribution is used); pass exact false for the tie-corrected normal approximation. Control-chart constants follow published table precision, so limits match textbook tables rather than unrounded integrals. Outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Related operations in this group include Run a t-test with confidence interval, Run one-way or two-way ANOVA, Run a chi-square test, Run a nonparametric test. Open the group documentation for the full request schema, field notes, and response examples before integrating.

POST$0.05 USDC
/api/v1/statistics/linear-regression

Example request

curl -i -X POST "https://www.brainiac.software/api/v1/statistics/linear-regression" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "y": [
    0.1,
    338.8,
    118.1,
    888,
    9.2,
    228.1,
    668.5,
    998.5,
    449.1,
    778.9,
    559.2,
    0.3,
    0.1,
    778.1,
    668.8,
    339.3,
    448.9,
    10.8,
    557.7,
    228.3,
    998,
    888.8,
    119.6,
    0.3,
    0.6,
    557.6,
    339.3,
    888,
    998.5,
    778.9,
    10.2,
    117.6,
    228.9,
    668.4,
    449.2,
    0.2
  ],
  "X": [
    [
      0.2
    ],
    [
      337.4
    ],
    [
      118.2
    ],
    [
      884.6
    ],
    [
      10.1
    ],
    [
      226.5
    ],
    [
      666.3
    ],
    [
      996.3
    ],
    [
      448.6
    ],
    [
      777
    ],
    [
      558.2
    ],
    [
      0.4
    ],
    [
      0.6
    ],
    [
      775.5
    ],
    [
      666.9
    ],
    [
      338
    ],
    [
      447.5
    ],
    [
      11.6
    ],
    [
      556
    ],
    [
      228.1
    ],
    [
      995.8
    ],
    [
      887.6
    ],
    [
      120.2
    ],
    [
      0.3
    ],
    [
      0.3
    ],
    [
      556.8
    ],
    [
      339.1
    ],
    [
      887.2
    ],
    [
      999
    ],
    [
      779
    ],
    [
      11.1
    ],
    [
      118.3
    ],
    [
      229.2
    ],
    [
      669.1
    ],
    [
      448.9
    ],
    [
      0.5
    ]
  ],
  "names": [
    "x1"
  ],
  "intercept": true,
  "predict": [
    [
      500
    ]
  ],
  "confidence": 0.95
}
JSON

An unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.

FAQ

  • Do I need an API key? No. Pay the listed USDC amount with x402.
  • What network? Base (eip155:8453), USDC.
  • Is this an official determination? No. Results are for human review against the cited sources.

Related APIs

Statistics and SPC Calculators APIFull docsHow it works