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
Data and fitted values
| No. | x | y | Frequency | Fitted |
|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 2.0249 |
| 2 | 2 | 5.5 | 5 | 5.4176 |
| 3 | 3 | 9.6 | 2 | 9.6345 |
| 4 | 4 | 14.4 | 4 | 14.495 |
| 5 | 5 | 19.8 | 1 | 19.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
- Home
Weighted Power Regression