keisoku

Power Regression Calculator (y = a x^b)

Enter your (x, y) data points and fit a power model y = a x^b by least squares. Shows the coefficient a, exponent b, R squared and correlation, a scatter plot with the fitted curve, and a table of predictions and residuals.

Input

Enter one (x, y) pair per line. The tool fits a power regression y = a x^b by least squares (both x and y must be positive).

One pair per line. Separate values with a comma, spaces, or a tab.

Result

Regression equation

y = 1.9924 x^1.5023

Coefficient a

1.992432

Exponent b

1.502333

R squared

1

Correlation r

1

Number of points

6


Scatter plot and fitted curve

xy

Data points and predictions

xy (observed)PredictedResidual
121.99240.0076
25.65.6446-0.0446
310.410.37960.0204
41615.99110.0089
522.422.35990.0401
629.429.4053-0.0053

How it works

  • The power model is y = a x^b. Taking the natural log of both sides gives ln(y) = ln(a) + b ln(x), which turns the problem into a straight-line fit (simple linear regression) in X = ln(x) and Y = ln(y).
  • Least squares is applied to the transformed (X, Y) pairs to find the slope b and intercept ln(a), then a = exp(intercept) recovers the original coefficient. Every x and y must be positive because logarithms are used.
  • The R squared and correlation are computed on the original scale, comparing the observed y with the predicted yhat = a x^b rather than the transformed values. An R squared near 1 indicates a good fit.
  • Enter one (x, y) pair per line. Values may be separated by a comma, spaces, or a tab, and blank lines are ignored.
  • If x is constant, so that ln(x) is the same for every point, the slope cannot be determined and the fit is not possible. At least two points are required.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Power Regression Calculator (y = a x^b)