Linear Regression API
Linear least-squares regression as an API, computed locally and deterministically. The linear endpoint fits the best straight line y = a + b·x through a set of x/y data points by ordinary least squares, returning the slope b = Σ((x−x̄)(y−ȳ))/Σ(x−x̄)², the intercept a = ȳ − b·x̄, the ready-to-use equation, the Pearson correlation r and the coefficient of determination R² (the fraction of variance the line explains), and the residual and slope standard errors — the points (1,2),(2,4),(3,5),(4,4),(5,5) fit to y = 2.2 + 0.6·x with R² = 0.6, and a perfectly linear set returns R² = 1. Pass a predict_x and it also extrapolates the fitted value at that point. The predict endpoint evaluates y = intercept + slope·x for a known line. The x and y lists may be given as comma-separated values (x=1,2,3&y=2,4,5) or as JSON arrays in a POST body and must be equal length. Everything is computed locally and deterministically, so it is instant and private. Ideal for data-science, analytics, BI, forecasting, machine-learning-preprocessing and statistics-education app developers, trend-line and best-fit tools, and dashboards. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 2 endpoints. This is the regression line; for the Pearson correlation alone or descriptive statistics use a statistics API and for probability distributions a probability API.
api.oanor.com/regression-api