Skip to content

Commit

Permalink
Missing figures of 03/06/2020
Browse files Browse the repository at this point in the history
  • Loading branch information
edomora97 committed Jun 3, 2020
1 parent 386cb3a commit 6ff3aec
Showing 1 changed file with 77 additions and 5 deletions.
82 changes: 77 additions & 5 deletions lectures/2020-06-03.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,34 @@ \section{Least square}
\end{align*}

This procedure has a drawback:
\missingfigure{Form1}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\node at (0,0.5) {$ \left\{ u(1), \ldots, u(N) \right\} $};
\node at (0,0) {$ \left\{ y(1), \ldots, y(N) \right\} $};
\node at (6,0.5) {$ \left\{ u(1), \ldots, u(N), u(N+1) \right\} $};
\node at (6,0) {$ \left\{ y(1), \ldots, y(N), y(N+1) \right\} $};
\node at (0,-0.8) {$\hat{\theta}_N$};
\node at (6,-0.8) {$\hat{\theta}_{N+1}$};

\draw[->] (1.8,0.25) -- (3.5,0.25) node[pos=0.5] {\footnotesize new data avail.};
\end{tikzpicture}
\end{figure}

$\hat{\theta}_N$ is not used to compute $\hat{\theta}_{N+1}$, it is necessary to repeat all the computation.
The solution is \emph{Recursive Least Square}.

\section{Recursive Least Square}

\missingfigure{Fig1}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\node[int, minimum height=1.5cm, minimum width=1.5cm] at (0,0) (RLS) {RLS};
\draw[<-,transform canvas={yshift=0.4cm}] (RLS) -- (-1.5,0) node[left] {$\hat{\theta}_{N-1}$};
\draw[<-,transform canvas={yshift=-0.4cm}] (RLS) -- (-1.5,0) node[left] {$\phi(N)$};
\draw[->] (RLS) -- (1.5,0) node[right] {$\hat{\theta}_{N}$};
\end{tikzpicture}
\end{figure}

\textbf{Advantages}
\begin{itemize}
Expand Down Expand Up @@ -158,7 +178,18 @@ \subsection{Third form}
\begin{remark}
RLS is a rigorous version of LS (not an approximation), provided a correct initialization.

\missingfigure{Fig2}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\draw (0,0.2) -- (2.45,0.2) -- (2.45,0.7) -- (0,0.7) -- (0,0.2);
\node at (1.225, 0.45) {\footnotesize Initialization};
\draw (4.95, 0.2) -- (2.55, 0.2) -- (2.55, 0.7) -- (4.95, 0.7);
\node at (3.75, 0.45) {\footnotesize RLS};

\draw[->] (0,0) -- (5,0);
\draw (2.5,0.1) -- (2.5,-0.1) node[below] {$t_0$};
\end{tikzpicture}
\end{figure}

\begin{itemize}
\item Collect a first set of data, till $t_0$
Expand All @@ -172,7 +203,29 @@ \subsection{Third form}
\section{Recursive Least Square with Forgetting Factor}

Consider a time varying parameter
\missingfigure{Fig3}
\begin{figure}[H]
\centering
\begin{minipage}[t]{0.48\textwidth}
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\draw[->] (0,0) -- (5,0) node[below] {$t$};
\draw[->] (0,0) -- (0,3) node[left] {$\alpha(t)$};
\draw[domain=0:4.5,smooth,variable=\x] plot ({\x},{sin(\x*180/3.14*0.8+45)*0.8+1.2});
\draw[dashed, fill] (0,0.45) -- (4.5,0.45) circle (1pt);
\node[left] at (0,0.45) {$\hat{\alpha}_0$};
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.48\textwidth}
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\draw[->] (0,0) -- (5,0) node[below] {$t$};
\draw[->] (0,0) -- (0,3) node[left] {$\alpha(t)$};
\draw[domain=0:4.5,smooth,variable=\x] plot ({\x},{sin(\x*180/3.14*0.8+45)*0.8+1.2});
\draw[dashed, fill] (0,1.05) -- (4.5,1.05);
\node[left] at (0,1.05) {$\hat{\alpha}_{LS}$};
\end{tikzpicture}
\end{minipage}
\end{figure}

$\hat{\alpha}_0$ is the correct estimation at time $N$, but it does not minimizes the objective function $J_N(\alpha)= \frac{1}{N} \sum_{t=1}^N \left( y(t) - \hat{y}(t|t-1, \alpha) \right)^2$ because it considers the entire time history of the system.

Expand All @@ -192,7 +245,26 @@ \section{Recursive Least Square with Forgetting Factor}
\end{align*}

\begin{remark}[Choice of $\rho$]
\missingfigure{Fig4}
\begin{figure}[H]
\centering
\begin{tikzpicture}[
node distance=2cm,auto,>=latex',
declare function={
f1(\x) = atan(\x*1.5-2)/180*3+1.5;
f2(\x) = f1(\x) + rand/4;
f3(\x) = f1(\x-0.6) + rand/30;
}]
\draw[->] (0,0) -- (5,0) node[below] {$t$};
\draw[->] (0,0) -- (0,3) node[left] {$\alpha(t)$};

\node[right, red] at (5,2.5) {$\rho \ll 1$};
\node[right, blue] at (5,2) {$\rho \approx 1$};

\draw[domain=0:4.5,smooth,variable=\x] plot ({\x},{f1(\x)});
\draw[domain=0:4.5,smooth,variable=\x,red] plot ({\x},{f2(\x)});
\draw[domain=0:4.5,smooth,variable=\x,blue] plot ({\x},{f3(\x)});
\end{tikzpicture}
\end{figure}

If $\rho \ll 1$ there's high tracking speed but low precision. With $\rho \approx 1$ there's low tracking speed but greater precision.
\end{remark}

0 comments on commit 6ff3aec

Please sign in to comment.