{"uid":"cap_IATsfozCH58KPV8NeUgBR","slug":"trend-line-calculator-linear-regression-e650d9bc","name":"Trend Line Calculator (Linear Regression)","description":"Fits a straight trend line through a set of x/y data pairs and returns slope, y-intercept, and R-squared fit quality. Useful for spotting growth trends, forecasting next values from historical data, and validating whether a relationship is actually linear before an agent bases a decision on it. Computed exactly, with no sampling error.","url":"https://x402.forgemesh.io/trend-line-calculator","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"x":{"type":"array","items":{"type":"number"}},"y":{"type":"array","items":{"type":"number"}}}},"responseSchema":{"type":"json","example":{"slope":1.9,"equation":"y = 1.9x + -0.5","intercept":-0.5,"r_squared":0.966}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__UD3Y_lKaRqcU5w-_KDp7","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fits a least-squares straight trend line through x/y data pairs, returning slope, y-intercept, and R-squared fit quality for linear trend analysis.","exampleAgentPrompt":"Fit a straight trend line through these data points and tell me the slope, y-intercept, and how good the linear fit is: x = [1, 2, 3, 4, 5] and y = [2.1, 3.9, 6.2, 8.0, 10.1].","exampleUseCases":null,"resultDescription":"Returns the slope (rate of change), y-intercept (value when x=0), and R-squared coefficient (0-1 fit quality) of the best-fit straight line through the provided x/y data pairs. R-squared close to 1 indicates a strong linear relationship.","failureModes":["Mismatched array lengths between x and y inputs — returns error","Fewer than 2 data points provided — insufficient for regression","Non-numeric values in input arrays — schema validation failure","All x values identical — division by zero in slope calculation","Payment failure or insufficient USDC balance — 402 response"],"whenToPreferThis":"Choose this endpoint when you need an exact, analytically computed linear regression with no sampling error on a set of numeric x/y pairs — especially when validating linearity (via R-squared) before making downstream decisions, detecting growth trends in time-series data, or forecasting the next value from a historical sequence. Prefer this over general-purpose ML or statistics APIs when you need a fast, cheap, precise result for simple linear trend fitting without standing up your own compute.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:59:08.193Z","isFirstParty":false}