Autocovariance - expectation across all time indices? I am new to time series analysis and I came across the following definition of autocovariance:
$\gamma_h(Y) = \mathbb{E}[(y_t - \mu_t)(y_{t-h}-\mu_{t-h})]$
It should tell us, how correlated are two rv's of our process at some specific $t$ and $t-h$.
My question is: 
Is the expectation in this formula taken with respect to all indices of the stochastic process (then why is it not taken into account in the formula?), and if yes, why do we estimate the autocorrelation with the following formula?
$\hat{\gamma}_h = \sum_{t=h+1}^T(y_t - \bar{y})(y_{t-h}-\bar{y})$, where $\bar{y}$ is the sample average.
Doesn't the second formula estimate rather the average correlation of rv's in our process, that are $h$ time units apart, than the correlation between rv's at specific point in time $t$ and $t-h$?
 A: For index set $\mathcal{T}$, is custom in some time series analysis texts to denote by $\{\mu_t\}_{t \in \mathcal{T}}$ the time-deterministic component of your series $\{\widetilde{Y}_t\}_{t \in \mathcal{T}}$. Making this more explicit, one may write any trend-stationary $\{\widetilde{Y}_t\}_{t \in \mathcal{T}}$ as the decomposition
\begin{align}
 \widetilde{Y}_t = \mu_t + Y_t + \varepsilon_t,
\end{align}
where $\mu_t:\mathcal{T} \to \mathbb{R}$ is purely deterministic (i.e., purely a function of time), the component $ Y_t$ is a purely non-deterministic (i.e., stochastic) trend term and is weakly stationary, and $\varepsilon_t$ is your iid white noise term. Now since stationarity is a property of stochastic sequences and $\mu_t$ is purely-deterministic, you don't care for it. Instead, you define $Y_t = \widetilde{Y}_t - \mu_t$, which will be purely non-deterministic. You then calculate auto-covariances for this transformed process. Since $\mu_t$ is non-stochastic, these auto-covariances will be identical to those of $\widetilde{Y}_t$.
In practice of course, you don't know $\mu_t$. Instead, you give it some functional form with parameters $\theta$, for example $\mu_t = \theta_0 + t\theta_1$ and estimate those parameters to obtain $Y_t$ from the observations $\widetilde{Y}_t$. Alternatively (and that is what the autocovariance estimator in your post is based upon), you assume that $\mu_t = \mu$ for all $t \in \mathcal{T}$, and you simply estimate it by the mean of $\widetilde{Y}_t$.
Once you have obtained the autocovariance estimates $\hat{\gamma}(h)$ for lag lengths $h$ that you deem relevant, you can also transform them into autocorrelation estimates by defining $\hat{\rho}(h) = \hat{\gamma}(h)/\hat{\gamma}(0)$.
