Problem
A linear approximation calculator in statistics typically fits a straight line to paired data by the least-squares method (simple linear regression). Using the points (1, 2.1), (2, 2.9), (3, 3.2), (4, 4.0), (5, 5.1), determine the least-squares linear approximation \(\hat{y}=b_0+b_1 x\) and then estimate \(\hat{y}\) at \(x=3.5\).
Concept: what “linear approximation” means here
Given data \((x_i,y_i)\), a linear approximation in the regression sense is the line \(\hat{y}=b_0+b_1 x\) that minimizes the total squared vertical error \(\sum (y_i-\hat{y}_i)^2\). This is the same “best-fit line” a linear approximation calculator would report for a trend line and prediction.
Step 1: compute sample means
\[ \bar{x}=\frac{\sum x_i}{n},\qquad \bar{y}=\frac{\sum y_i}{n},\qquad n=5 \]
\[ \bar{x}=\frac{1+2+3+4+5}{5}=\frac{15}{5}=3 \]
\[ \bar{y}=\frac{2.1+2.9+3.2+4.0+5.1}{5}=\frac{17.3}{5}=3.46 \]
Step 2: compute \(S_{xx}\) and \(S_{xy}\)
\[ S_{xx}=\sum (x_i-\bar{x})^2,\qquad S_{xy}=\sum (x_i-\bar{x})(y_i-\bar{y}) \]
| Point \((x_i,y_i)\) | \(x_i-\bar{x}\) | \(y_i-\bar{y}\) | \((x_i-\bar{x})(y_i-\bar{y})\) | \((x_i-\bar{x})^2\) |
|---|---|---|---|---|
| (1, 2.1) | \(-2\) | \(-1.36\) | \(2.72\) | \(4\) |
| (2, 2.9) | \(-1\) | \(-0.56\) | \(0.56\) | \(1\) |
| (3, 3.2) | \(0\) | \(-0.26\) | \(0\) | \(0\) |
| (4, 4.0) | \(1\) | \(0.54\) | \(0.54\) | \(1\) |
| (5, 5.1) | \(2\) | \(1.64\) | \(3.28\) | \(4\) |
| Sums | \(S_{xy}=2.72+0.56+0+0.54+3.28=7.10\) | \(S_{xx}=4+1+0+1+4=10\) |
Step 3: compute slope and intercept
\[ b_1=\frac{S_{xy}}{S_{xx}},\qquad b_0=\bar{y}-b_1\bar{x} \]
\[ b_1=\frac{7.10}{10}=0.71 \]
\[ b_0=3.46-0.71\times 3=3.46-2.13=1.33 \]
\[ \hat{y}=1.33+0.71x \]
Step 4: estimate at \(x=3.5\)
\[ \hat{y}(3.5)=1.33+0.71\times 3.5=1.33+2.485=3.815 \]
Rounded to two decimals, the linear approximation calculator would report \(\hat{y}(3.5)\approx 3.82\).
Interpretation: the slope \(b_1=0.71\) means the fitted line increases by about \(0.71\) units in \(y\) for every \(1\) unit increase in \(x\), within the range of the observed data.
Visualization: data with fitted linear approximation
Common checks for a linear approximation calculator result
- The fitted line must pass through the point \((\bar{x},\bar{y})=(3,3.46)\). Substituting \(x=3\) gives \(\hat{y}=1.33+0.71\times 3=3.46\), which matches \(\bar{y}\).
- Predictions are most reliable for \(x\) values inside the observed range \([1,5]\). Since \(3.5\) is inside that range, the estimate is an interpolation rather than a strong extrapolation.