Solution (source code)

= Solution

A real <weakly stationary process> has finite <second moments>, a time-independent <mean> $\mu$, and <autocovariance function> $\gamma_k=\operatorname{Cov}(X_t,X_{t+k})$ depending only on the lag. Use the angular-frequency convention
$$
\gamma_k=\int_{-\pi}^{\pi}e^{ik\lambda}f_X(\lambda)\,d\lambda,\qquad
\boxed{f_X(\lambda)=\frac1{2\pi}\sum_{k\in\mathbb Z}\gamma_k e^{-ik\lambda}.}
$$
The <time-series spectral density> is nonnegative and integrates to $\gamma_0$. The displayed <Fourier series> is ordinarily justified by $\sum_k|\gamma_k|<\infty$. More generally, <weak stationarity> gives a <spectral measure of a stationary time series>, not necessarily a <spectral density>. If a <spectral density> exists without this summability, its Fourier inversion can be understood using <Fejér sums>, which converge in $L^1$ and at its Lebesgue points. Thus <spectral density> existence should not be inferred from <weak stationarity> alone.

A <white noise process> $WN(0,\sigma^2)$ has <mean> zero and $\operatorname{Cov}(\varepsilon_t,\varepsilon_s)=\sigma^2\mathbf1_{\{t=s\}}$. Neither <independence> nor a <normal distribution> is needed for this second-order definition. Its <autocovariance function> is zero at nonzero lags, so
$$
\boxed{f_\varepsilon(\lambda)=\frac{\sigma^2}{2\pi}.}
$$
For a real absolutely summable filter $(c_r)$, the series defining $Y_t$ has <mean-square convergence>: its tails have $L^2$ norm at most $\|X_0\|_2\sum_{\text{tail}}|c_r|$. Its <mean> is $\mu\sum_rc_r$, and
$$
\gamma_Y(k)=\sum_{r,s\in\mathbb Z}c_rc_s\gamma_X(k+r-s).
$$
The sum is absolutely convergent, since $|\gamma_X(j)|\leq\gamma_X(0)$ by the <Cauchy-Schwarz inequality>. It depends only on $k$, proving that the output is a <weakly stationary process>. Substitute the spectral integral for $\gamma_X$ and interchange the sums and integral, justified by $f_X\in L^1$ and $\sum_{r,s}|c_rc_s|<\infty$. This gives
$$
\gamma_Y(k)=\int_{-\pi}^{\pi}e^{ik\lambda}
C(e^{i\lambda})C(e^{-i\lambda})f_X(\lambda)\,d\lambda.
$$
Because the coefficients are real, the two factors are <complex conjugates>. Hence the <spectral density transformation under a linear filter> is
$$
\boxed{f_Y(\lambda)=|C(e^{-i\lambda})|^2f_X(\lambda).}
$$
For complex coefficients the same formula holds with the conjugate-covariance convention.

Applying this result to the order-two <moving-average model> yields
$$
\boxed{f_X(\lambda)=\frac{\sigma^2}{2\pi}|1+\theta_1e^{-i\lambda}+\theta_2e^{-2i\lambda}|^2
=\frac{\sigma^2}{2\pi}\left[1+\theta_1^2+\theta_2^2+2\theta_1(1+\theta_2)\cos\lambda+2\theta_2\cos2\lambda\right].}
$$
Equivalently, its nonzero <autocovariances> are $\gamma_0=\sigma^2(1+\theta_1^2+\theta_2^2)$, $\gamma_1=\sigma^2\theta_1(1+\theta_2)$ and $\gamma_2=\sigma^2\theta_2$, together with $\gamma_{-k}=\gamma_k$.

For the order-one <moving-average process>, invert its filter by a <geometric series>. The required coefficients are
$$
\boxed{c_r=(-\theta)^r,\qquad r=0,1,2,\ldots.}
$$
They are absolutely summable for $|\theta|<1$. Direct cancellation gives
$$
\sum_{r=0}^n(-\theta)^rX_{t-r}
=\varepsilon_t-(-\theta)^{n+1}\varepsilon_{t-n-1}
\longrightarrow\varepsilon_t
$$
with <mean-square convergence>. Thus the inverse filter recovers exactly the original <white noise process>, including its <variance>; it is an <invertible time-series representation>.