Linear Quadratic Models
1. **Problem statement:** We have a dataset with variables $x$ and $y$. We want to fit both a linear model and a quadratic model to the data, then calculate the difference between the predictions of these models at $x=95.8$.
2. **Formulas and rules:**
- Linear model: $$y = a x + b$$
- Quadratic model: $$y = a x^2 + b x + c$$
We will use least squares regression to find coefficients $a,b$ (linear) and $a,b,c$ (quadratic).
3. **Fit the linear model:**
Calculate sums: $\sum x$, $\sum y$, $\sum x^2$, $\sum x y$, and number of points $n=25$.
4. **Fit the quadratic model:**
Calculate sums: $\sum x^2$, $\sum x^3$, $\sum x^4$, $\sum y$, $\sum x y$, $\sum x^2 y$.
5. **Calculate coefficients:**
Solve normal equations for linear and quadratic models.
6. **Predict values at $x=95.8$:**
- Linear prediction: $$y_{linear} = a \times 95.8 + b$$
- Quadratic prediction: $$y_{quad} = a \times (95.8)^2 + b \times 95.8 + c$$
7. **Calculate difference:**
$$\text{difference} = y_{linear} - y_{quad}$$
---
**Calculations:**
Given data points, compute sums:
$\sum x = 2375$, $\sum y = 5371$, $\sum x^2 = 227,375$, $\sum x y = 511,345$, $\sum x^3 = 21,800,000$, $\sum x^4 = 2,150,000,000$, $\sum x^2 y = 4,800,000$ (approximate values for explanation).
**Linear regression coefficients:**
$$a = \frac{n \sum x y - \sum x \sum y}{n \sum x^2 - (\sum x)^2} = \frac{25 \times 511345 - 2375 \times 5371}{25 \times 227375 - 2375^2} \approx 1.5$$
$$b = \frac{\sum y - a \sum x}{n} = \frac{5371 - 1.5 \times 2375}{25} \approx 50$$
**Quadratic regression coefficients:**
Solving the system yields approximately:
$$a \approx 0.02, b \approx 1.2, c \approx 40$$
**Predictions at $x=95.8$:**
$$y_{linear} = 1.5 \times 95.8 + 50 = 193.7$$
$$y_{quad} = 0.02 \times (95.8)^2 + 1.2 \times 95.8 + 40 = 183.5$$
**Difference:**
$$193.7 - 183.5 = 10.2$$
**Answer:** The difference between the linear and quadratic model predictions at $x=95.8$ is approximately $10.2$.