# Weighted Calibration Fit (Linear Regression)

> Weighted Calibration Fit (Linear Regression) is a paid API for AI agents from www.mahastrategies.com, paid per call via x402, $0.0265/call, status unknown (last checked 2026-10-20).

Fits a weighted linear model y = intercept + slope*x to 2–64 (x, y, weight) pairs using exact rational normal equations, returning fitted coefficients, residuals, and weighted SSE/RMSE.

## Facts

- Endpoint: POST https://www.mahastrategies.com/api/v1/micro/weighted-calibration-fit?utm_source=zero.xyz
- Price: $0.0265/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/weighted-calibration-fit-linear-regression-3fa15e4b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sBeq7044jXI7yyFQ7dO5D

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability weighted-calibration-fit-linear-regression-3fa15e4b -d '<json body>'
```

Example prompt: Fit a weighted linear calibration curve to these 5 public data pairs: x=[1,2,3,4,5], y=[2.1,3.9,6.2,7.8,10.1], weights=[1.0,2.0,1.5,2.5,1.0] — give me the slope, intercept, residuals, and RMSE.

## When to prefer this

Choose this endpoint when you need exact rational arithmetic weighted linear regression (y = intercept + slope*x) on small datasets (2–64 points) with per-point positive weights, and require residuals and SSE rounded to 12 decimal places with a finite RMSE. Prefer it over general-purpose statistics libraries when you need a deterministic, auditable microservice result with a receipt digest, or when operating in an agent pipeline that requires pay-per-call accountability via x402.

## Known failure modes

- Fewer than 2 or more than 64 pairs provided — request rejected
- Degenerate X values (all x identical, causing singular normal equations) — rejected with error
- Non-positive weights cause rejection (weights must be positive)
- Invalid dataClass enum value (must be 'public' or 'synthetic')
- Payment not provided or insufficient USDC — x402 payment required
- Malformed JSON body or missing required fields

## How this service works

Fit y = intercept + slope*x to 2–64 declared pairs using positive weights and exact rational normal equations. Returns residuals and weighted SSE rounded to 12 decimal places, plus finite float64 RMSE. Rejects degenerate X values; weights are not verified uncertainties. Not field certification.

## Output

Returns the fitted intercept and slope from weighted normal equations, an array of per-point residuals (observed minus fitted), the weighted sum of squared errors (SSE) rounded to 12 decimal places, and a finite float64 RMSE. Also includes offer metadata (offerId, version, inputDigest, receiptDigest, amountBaseUnits) and a boundaries array.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "dataClass",
      "pairs"
     ],
     "properties": {
      "pairs": {
       "type": "array",
       "maxItems": 64,
       "minItems": 1
      },
      "dataClass": {
       "enum": [
        "public",
        "synthetic"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "version",
      "offerId",
      "amountBaseUnits",
      "inputDigest",
      "result",
      "boundaries",
      "receiptDigest"
     ],
     "properties": {
      "result": {
       "type": "object"
      },
      "offerId": {
       "enum": [
        "weighted-calibration-fit"
       ],
       "type": "string"
      },
      "version": {
       "enum": [
        "maha-microproducts/0.1"
       ],
       "type": "string"
      },
      "boundaries": {
       "type": "array",
       "maxItems": 128,
       "minItems": 0
      },
      "inputDigest": {
       "type": "string",
       "maxLength": 71
      },
      "receiptDigest": {
       "type": "string",
       "maxLength": 71
      },
      "amountBaseUnits": {
       "enum": [
        "26500"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/weighted-calibration-fit-linear-regression-3fa15e4b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.mahastrategies.com](https://www.zero.xyz/host/www.mahastrategies.com/llms.txt)
