Finish autocorrelation

This commit is contained in:
jannisp 2021-08-12 14:25:56 +02:00
parent 7731b7dbdd
commit 443ea83418
2 changed files with 25 additions and 2 deletions

BIN
img/pacf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -522,6 +522,29 @@ var.ts <- 1/n^2*acf(b,lag=0,type="cov")$acf[1]*(n+2*sum(((n-1):(n-10))*acf(b,10)
mean(b) + c(-1.96,1.96)*sqrt(var.ts)
\end{lstlisting}
\subsection{Partial autocorrelation (PACF)}
The $k$-th partial autocorrelation $\pi_k$ is defined as the correlation between $X_{t+k}$ and $X_t$, given all the values in between.
$$\pi_k = Cor(X_{t+k},X_t | X_{t+1},...,X_{t+k-1} = x_{t+k-1})$$
\begin{itemize}
\item Given a time series X t , the partial autocorrelation of lag $k$, is the autocorrelation between $X_t$ and $X_{t+k}$ with the linear dependence of $X_{t+1}$ through to $X_{t+k-1}$ removed.
\item One can draw an analogy to regression. The ACF measures the „simple“ dependence between $X_t$ and $X_{t+k}$, whereas the PACF measures that dependence in a „multiple“ fashion.\footnote{See e.g. \href{https://n.ethz.ch/~jannisp/download/Mathematik-IV-Statistik/zf-statistik.pdf}{\textit{Mathematik IV}}}
\end{itemize}
$$\pi_1 = \rho_1$$
$$\pi_2 = \frac{\rho_2 - \rho_1^2}{1-\rho_1^2}$$
for AR(1) moderls, we have $\pi_2 = 0$, because $\rho_2 = \rho_1^2$, i.e. there is no conditional relation between $(X_t, X_{t+2} | X_{t+1})$
\begin{lstlisting}[language=R]
pacf(wave, ylim=c(1,1))
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=.25\textwidth]{pacf.png}
\caption{PACF for wave tank}
\label{fig:pacf}
\end{figure}
\scriptsize
\section*{Copyright}
@ -532,8 +555,8 @@ Jannis Portmann, FS21
\section*{References}
\begin{enumerate}
\item ATSA\_Script\_v219219.docx, M. Dettling
\item ATSA\_Slides\_v219219.pptx, M. Dettling
\item ATSA\_Script\_v210219.docx, M. Dettling
\item ATSA\_Slides\_v210219.pptx, M. Dettling
\end{enumerate}
\section*{Image sources}