I would like to derive the confidence interval for OLS regression but having difficulty in understanding the coefficients itself. Let me state this way, for $Y=aX+b+\epsilon$ where $X, Y, \epsilon$ are random variables with $\epsilon$ zero-mean Gaussian random variable, I can find $a, b$ by minimizing $f(a,b)=E[(Y-aX-b)^2]$ wrt $a, b$ such that $\frac{\partial f}{\partial a}=\frac{\partial f}{\partial b}=0$. However, in this derivation I am implicitly assuming that $a, b$ are constants. My problem starts here:
How can I derive confidence intervals for a constant variable, e.g. for $a,b$?
If $a,b$ are not constants but rather random variables then, my derivation fails from the beginning since in this case $E[(Y-aX-b)^2]$ involves terms like $E[bY], E[aXY]$ which I believe cannot be separated since the variables are not independent of each other.
Can you please clarify this? What are the random variables in simple OLS regression? If the coefficients are not random but rather constant then how it is possible to compute the confidence interval, since as far as I know just the random variables have confidence intervals?
Regards,