- 2074 Bhadra · 8 marks
Least squares: y = ax + b + c/x
Short answer
Minimize S = sum(y_i - a x_i - b - c/x_i)^2. The normal equations are a sum x^2 + b sum x + cn = sum xy, a sum x + bn + c sum(1/x) = sum y, and an + b sum(1/x) + c sum(1/x^2) = sum(y/x). Solve for a, b, c; the illustration gives y = 1.9304x + 3.3318 + 0.6507/x.
The following data are provided; use least-squares method to fit these data with the following model, y = ax + b + c/x. [The data table is not given in the printed paper.]
The data table is not printed in the question, so the method is given in general form and then applied to an assumed data set to show the numbers.
Normal equations for y = ax + b + c/x
The model is linear in the unknowns a, b, c. Minimise
S = Σ (yᵢ − a xᵢ − b − c/xᵢ)²
Setting ∂S/∂a = ∂S/∂b = ∂S/∂c = 0:
a Σx² + b Σx + c·n = Σxy ... (1)
a Σx + b·n + c Σ(1/x) = Σy ... (2)
a·n + b Σ(1/x) + c Σ(1/x²) = Σ(y/x) ... (3)
(Here x·(1/x) = 1, so the Σ of that cross term is n.)
Procedure
- Tabulate x, y, 1/x, 1/x², x², xy, y/x and find the sums.
- Substitute the sums in (1), (2), (3).
- Solve the three equations by Gauss elimination for a, b, c.
Illustration with assumed data (n = 5)
| x | y | 1/x | 1/x² | x² | xy | y/x |
|---|---|---|---|---|---|---|
| 1 | 5.9 | 1.0000 | 1.0000 | 1 | 5.90 | 5.9000 |
| 2 | 7.6 | 0.5000 | 0.2500 | 4 | 15.20 | 3.8000 |
| 3 | 9.2 | 0.3333 | 0.1111 | 9 | 27.60 | 3.0667 |
| 4 | 11.3 | 0.2500 | 0.0625 | 16 | 45.20 | 2.8250 |
| 5 | 13.1 | 0.2000 | 0.0400 | 25 | 65.50 | 2.6200 |
| Σ=15 | 47.1 | 2.2833 | 1.4636 | 55 | 159.4 | 18.2117 |
55a + 15b + 5c = 159.4
15a + 5b + 2.2833c = 47.1
5a + 2.2833b + 1.4636c = 18.2117
Solving: a = 1.9304, b = 3.3318, c = 0.6507.
Answer: y = 1.9304x + 3.3318 + 0.6507/x for the assumed data; for the actual paper, insert its own x, y values in the same sums.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Quadratic least squares fit · Numerical Method, chapter 4
- Least squares significance, normal equations · Numerical Method, chapter 4
- Fit y = ln(ax + b) · Numerical Method, chapter 4 · asked 2×
- Fit y = ax/(b + x) · Numerical Method, chapter 4 · asked 2×
- Derive linear least squares · Numerical Method, chapter 4
- Fit curve y = a b^x (decay data) · Numerical Method, chapter 4 · asked 3×
- Least squares fit for calibration data · Metrology, chapter 2
- Wire-frame model and polygon table · Computer Graphics, chapter 6
- 1D implicit river stage - water table model · Computational Techniques in Civil Engineering, chapter 7 · asked 2×
- Fit straight line: humidity and moisture · Probability and Statistics, chapter 5