I am asking in the context of simple linear regression.
If my regressor $X_i$ is non-stochastic, should $\mathbb E(X_i) = \overline X$ or $X_i$ i.e., treat it like a constant? I presume the latter because some of the derivations, the unbiased one for example treat it as a constant by taking $X$ terms out of the expectation.
Further, what is $\mathrm{Corr}(Y_i,X_i)$ where $Y_i$ is the regressand. If we treat $X_i$ as a constant like we did previously, then the correlation should be undefined since $\mathrm{Cov}(Y_i,X_i)=0$ and ${\sigma_x}^2 = 0 \quad \because X_i - \mathbb E(X_i) = 0$. Intuitively, though I feel like it should be a number close to $\pm 1$ because they share a linear relationship.
If we go by undefined, then my question is what is correlation coeffecient? So far, I thought of it as a measure of how closely can we fit a straight line in a scatter plot but that definition seems to break down when we consider a non-stochastic variable.
What's more puzzling is that the book I am following, Basic Econometrics by Damodar Gujarati, states that the residuals $\widehat u_i$ are uncorrelated with $X_i$ because $\sum_{i=1}^n \widehat u_i \, X_i = 0$ (end of section 3.1, fifth edition).
This makes me think that correlation should not be undefined for a non-stochastic variable, thus my intuition serving right.
If we assume $X_i$ as stochastic i.e., $\mathbb E(X_i) = \overline X$, then $\mathrm{Cov}(Y_i,X_i) = \mathbb E(u_i \, X_i)$ which makes a lot more sense, but then some of the proofs that require it to be treated like a constant break down.
While writing this question, I realised that it may be that for unscripted terms i.e., constants, the expectation is itself but for scripted terms i.e., non-stochastic variable, there should be a bar, but that still doesn't solve the problems. With this interpretation, $\mathbb E(u_i \, X_i) = \overline X \,E(u_i) = 0$. Which again, doesn't make sense why two variables that share a linear relation should have zero covariance, and this still poses the problem of treating it like a constant in derivations. $\mathbb E(X_i \, Y_i)$ should $= \overline X \, \mathbb E(Y_i)$ not $X_i \, \mathbb E(Y_i)$.
Lastly, I know $\mathrm{Corr}(Y_i,X_i) \neq 0$ generally, since coeffecient of determination has a similar formula and that obviously won't always be 0.