# Error vs residual in simple linear regression

In my textbook the following definition were presented

However, it was presented previously that

Thus if we were to minimise the sum of squared residuals, shouldn't we be minimising $$Q=\sum_{i=1}^n(y_i-\hat{y})^2=\sum_{i=1}^n(y_i-\hat{\beta_0}-\hat{\beta_1}x_i)^2$$?

• Here, $\hat \beta_0$ denotes the value that minimizes $Q$, which you are trying to find, whereas $\beta_0$ is the current value in your model.
– hff1
Commented Aug 30, 2023 at 10:03
• @hff1 does that mean the $\beta_0$ in the first definition is different from the $\beta_0$ in the regression model definition? Where $\beta_0$ is the true parameter in $y_i=\beta_0+\beta_1x_i+\epsilon_i$ and $\beta_0$ in equation $Q$ is simply a variable that represents some arbitrary value we started with? Commented Aug 30, 2023 at 10:06
• They are the same and can be arbitrary.
– hff1
Commented Aug 30, 2023 at 10:15

You may understand in this way that $$\beta_0$$ and $$\beta_1$$, they denote a solution of $$Q$$, while $$\hat{\beta}_0$$ and $$\hat{\beta}_1$$, they are an optimal solution for the minimization problem $$Q$$.