keisoku

Weighted Power Regression

Fit a power model y = a x^b to frequency-weighted data points using least squares, showing the coefficient, exponent, and R-squared with a scatter plot.

Input

Enter (x, y, frequency) on each line to fit the power model y = a x^b with frequency-weighted least squares. A line without a frequency is treated as frequency 1.

One point per line. x and y must be positive. Example: 2, 5.5, 5

Result

Regression equation

y = 2.0249 x^1.4198

Coefficient a

2.024853

Exponent b

1.419835

R-squared

0.9998

Total frequency

15

Data points

5


Scatter plot and regression curve

-0.090.85.58321.911.2564316.92964.122.60285.2x = 1, y = 2, frequency = 3x = 2, y = 5.5, frequency = 5x = 3, y = 9.6, frequency = 2x = 4, y = 14.4, frequency = 4x = 5, y = 19.8, frequency = 1

Data and fitted values

No.xyFrequencyFitted
11232.0249
225.555.4176
339.629.6345
4414.4414.495
5519.8119.8983

How it works

  • Enter each data point as (x, y, frequency) on its own line. A line without a frequency is treated as frequency 1.
  • Taking the natural logarithm of y = a x^b gives ln y = ln a + b ln x, reducing the problem to a straight-line regression in X = ln x and Y = ln y.
  • The exponent and coefficient are found with frequency-weighted least squares: b = sum w (X - mean X)(Y - mean Y) / sum w (X - mean X) squared, and a = exp(mean Y - b times mean X).
  • R-squared is computed in log space from the weighted total and residual variation as R-squared = 1 - residual sum of squares / total variation. A value close to 1 indicates a good fit.
  • Both x and y must be positive. Points with values of zero or below cannot be used because the logarithm is undefined there.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Weighted Power Regression