{"uid":"cap_ZJfBL3MSe1OiaK3PdFkjx","slug":"api-quantoracle-dev-c49af2df","name":"QuantOracle Linear Regression","description":"QuantOracle: stats/linear-regression","url":"https://api.quantoracle.dev/v1/stats/linear-regression","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"x":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"array","items":{"type":"number"}}],"title":"X","description":"Independent variable(s): 1D array for simple, 2D for multiple regression"},"y":{"type":"array","items":{"type":"number"},"title":"Y","description":"Dependent variable array"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95,"description":"Confidence level for intervals (e.g. 0.95 = 95%)"}}},"responseSchema":null,"example":{"request":{"input":{"body":{"x":[1,2,3,4,5],"y":[2.1,3.9,6.2,7.8,10.1],"confidence_level":0.95},"type":"http","method":"POST","bodyType":"json"}},"response":{"n":5,"ms":9.07,"mse":0.035667,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","powered_by":"QuantOracle"},"p_values":[0.059308,0.000059],"intercept":0.05,"r_squared":0.9973,"predictors":1,"f_statistic":1110.3084,"coefficients":[1.99],"t_statistics":[0.2524,33.3213],"standard_errors":[0.198074,0.059722],"adjusted_r_squared":0.9964}},"exampleRequest":{"x":[1,2,3,4,5],"y":[2.1,3.9,6.2,7.8,10.1],"confidence_level":0.95},"tags":["x402"],"displayCostAmount":"0.008","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.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_FNtxqfwgCsyXv5dxrlhny","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fits an ordinary least squares linear regression to x/y data and returns coefficients, R-squared, p-values, t-statistics, F-statistic, and confidence-interval diagnostics.","exampleAgentPrompt":"Run a linear regression on these five data points — x: [1, 2, 3, 4, 5] and y: [2.1, 3.9, 6.2, 7.8, 10.1] — using a 95% confidence level, and give me the slope, intercept, R-squared, and p-values.","exampleUseCases":null,"resultDescription":"Returns a JSON object with: sample size (n), mean squared error, root MSE, p-values for each predictor, intercept, R-squared, number of predictors, F-statistic, regression coefficients array, t-statistics, standard errors, and adjusted R-squared — all derived from an OLS fit of the provided x/y data.","failureModes":["x and y arrays of mismatched length — returns 4xx validation error","fewer than 2 data points provided — underdetermined system error","non-numeric values in x or y arrays — type validation error","confidence_level outside (0,1) range — parameter validation error","payment not included or insufficient — x402 payment required response"],"whenToPreferThis":"Choose this endpoint when you need a full suite of OLS regression diagnostics (coefficients, R-squared, p-values, F-statistic, t-statistics, standard errors) in a single call, especially for quantitative finance or statistical analysis workflows where significance testing matters. Prefer it over generic statistics libraries when operating in an agentic/x402 payment context or when you need a hosted, pay-per-call computation without managing infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:04.552Z","isFirstParty":false}