{"uid":"cap_cIz9k1mt2rQNdkd1MJj2o","slug":"stats-regression-48534bc3","name":"stats-regression","description":"Pay-per-call tools for AI agents: web search + content, documents, live market data, and multi-chain wallet/gas reads. Mainnet test from $0.000001 USDC on Base. Pay-per-call tools for AI agents in USDC on Base (x402/MPP): search, pdf, web-read, extract, summarize, fact-check, translate, jobs, discover. See GET /capabilities.","url":"https://x402.agentindex.world/stats/regression?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"x":{"type":"array","items":{"type":"number"},"title":"X","minItems":2},"y":{"type":"array","items":{"type":"number"},"title":"Y","minItems":2}}},"responseSchema":{"type":"json","example":{"slope":2,"intercept":0,"r_squared":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2-DdPx1m_WRGjs5NLLU3v","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Performs ordinary least squares (OLS) simple linear regression on two numeric arrays, returning slope, intercept, and R-squared.","exampleAgentPrompt":"Can you run a simple linear regression on these two arrays — x: [1,2,3,4,5] and y: [2.1,3.9,6.2,7.8,10.1] — and tell me the slope, intercept, and R-squared?","exampleUseCases":[{"title":"Sales trend line fitting","prompt":"I have monthly sales figures for the past year — x is [1,2,3,4,5,6,7,8,9,10,11,12] and y is [4200,4500,4800,5100,5300,5600,5900,6100,6400,6700,7000,7300]. Fit a linear regression to those and give me the slope, intercept, and R-squared so I can see how consistent the growth is."},{"title":"Student study hours vs grades","prompt":"I want to see how well study hours predict exam scores. Here's my data — hours: [1,2,3,4,5,6,7,8] and scores: [55,60,65,70,72,80,85,92]. Can you run OLS regression on those and tell me the slope, intercept, and R-squared?"},{"title":"Temperature vs energy consumption correlation","prompt":"Run a linear regression for me on these temperature readings and electricity usage numbers — x temperatures are [30,35,40,45,50,55,60,65] and y usage values are [200,220,260,290,330,380,420,470]. I need the slope, intercept, and how good the fit is."}],"resultDescription":"Returns the OLS regression slope (rate of change of y per unit x), intercept (y-value when x is zero), and R-squared (coefficient of determination, 0–1, indicating how much variance in y is explained by x).","failureModes":["Arrays of different lengths cause a validation error","Arrays with fewer than 2 elements are rejected (minItems: 2)","Non-numeric values in either array cause a schema validation failure","Perfectly vertical data (zero variance in x) causes division by zero / undefined slope","Payment failure or insufficient funds returns HTTP 402"],"whenToPreferThis":"Use this endpoint when you need a fast, pay-per-call OLS simple linear regression (single predictor) with R-squared, without setting up a local stats library or managing API keys. Ideal for agents doing ad-hoc analytics, validating linear trends, or building lightweight data pipelines. For multiple regression or non-linear fitting, look elsewhere.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:39:16.920Z","isFirstParty":false,"canonicalSlug":"stats-regression-48534bc3"}