Can anyone please explain the difference between residual and error in regression problems? According to me both are same as :
$Y = Z*\beta + \epsilon$ Here $\epsilon$ is error.
And residual is defined as $\hat{\epsilon}$= $Y-\hat{Y}$ ,and since $\hat{Y} = Z*\beta $ ,
$=>$ $\hat{\epsilon}$= $Y-\hat{Y}$ = $Z*\beta + \epsilon - Z*\beta$ = $\epsilon$
I just am not able to understand the difference between residual and error. Any help on this is highly appreciated.
The error $\epsilon$ is a theoretical representation of random "noise" in your model; this is also known as irreducible error as it represents the amount by which you expect observations to deviate from a perfect model.
The residuals $\hat{\epsilon}$ are a measurement of how much your observations deviated from your fitted model. They are an estimate of your error $\epsilon$.
In statistics, the $\hat{}$ symbol is usually placed over values that estimate model parameters using observed data. That's what's going on here; $\hat{\epsilon}$ is just your estimate for $\epsilon$ given your data.