keisoku

Weighted Reciprocal Regression

Fit the reciprocal model y = a + b / x to frequency-weighted (x, y) data using weighted least squares. Returns the coefficients a and b, the coefficient of determination R², and the total weight, with a scatter chart whose point size reflects each frequency.

Input

Fit the reciprocal model y = a + b / x to frequency-weighted (x, y) data with weighted least squares. Enter one point per line as x,y or x,y,frequency.

One point per line: x,y or x,y,frequency. Separate with commas, spaces, or tabs. x must not be 0 and frequency must be positive.

Result

Regression equation

y = 0.971864 + 10.234396 / x

Constant a

0.971864

Coefficient b

10.234396

R-squared

1

Total weight

15

Data points

5


Scatter plot and fitted curve

2.3440.684.7221.847.139.4784.1611.8565.32Point at x 1, y 11.2, frequency 4.Point at x 2, y 6.1, frequency 5.Point at x 3, y 4.4, frequency 3.Point at x 4, y 3.5, frequency 2.Point at x 5, y 3, frequency 1.

Data and fitted values

No.xyFrequencyFitted
1111.2411.206
226.156.089
334.434.383
443.523.53
55313.019

How it works

  • Each data point (x, y) carries a frequency weight w, and the reciprocal model y = a + b / x is fitted. Substituting u = 1 / x turns it into a weighted straight-line regression y = a + b u.
  • With weighted means ubar = Sum(w u) / Sum(w) and ybar = Sum(w y) / Sum(w), the coefficients are b = Sum(w (u - ubar)(y - ybar)) / Sum(w (u - ubar)^2) and a = ybar - b ubar.
  • The coefficient of determination comes from the weighted total variation SStot = Sum(w (y - ybar)^2) and residual variation SSres = Sum(w (y - yhat)^2) as R-squared = 1 - SSres / SStot.
  • At x = 0 the term 1 / x is undefined, so such rows are rejected. Frequencies must be positive.
  • Enter each row as x,y or x,y,frequency. Separators can be commas, spaces, or tabs. A row without a frequency is treated as frequency 1.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Weighted Reciprocal Regression