mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-01-12 08:08:25 +00:00
[NumCS] linear curve fitting start
This commit is contained in:
Binary file not shown.
@@ -167,6 +167,13 @@ Moral of the story: Use descriptive variable names and do NOT use $t$, $tt$, $tt
|
||||
\section{Ausgleichsrechnung}
|
||||
\input{parts/05_curve-fitting/00_intro.tex}
|
||||
\input{parts/05_curve-fitting/01_linear/00_intro.tex}
|
||||
\input{parts/05_curve-fitting/01_linear/01_normal-equations.tex}
|
||||
\input{parts/05_curve-fitting/01_linear/02_orthogonal-transforms.tex}
|
||||
\input{parts/05_curve-fitting/01_linear/03_total-curve-fitting.tex}
|
||||
\input{parts/05_curve-fitting/02_non-linear/00_intro.tex}
|
||||
\input{parts/05_curve-fitting/02_non-linear/01_newton-method-in-rn.tex}
|
||||
\input{parts/05_curve-fitting/02_non-linear/02_gauss-newton.tex}
|
||||
\input{parts/05_curve-fitting/02_non-linear/03_further-methods.tex}
|
||||
|
||||
|
||||
\end{document}
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
\subsection{Lineare Ausgleichsrechnung}
|
||||
Die Ansatz der Methode der kleinsten Quadrate ist (ausgedrückt mit Matrizen) ist $\displaystyle \min_{\hat{x} \in \R^n} ||A\hat{x} - b||^2$ und als Summe:
|
||||
\drmvspace
|
||||
\begin{align*}
|
||||
(a, c) = \argmin{p \in \R^n, q \in \R} \sum_{i = 1}^{m} |y_i - p^{\top} x_i - q|^2
|
||||
\end{align*}
|
||||
|
||||
\drmvspace
|
||||
Wobei $y_i$ die $y$-Koordinaten der Messpunkte zugehörig zu $x_i$ sind.
|
||||
|
||||
\innumpy haben wir die Funktionen \texttt{numpy.polyfit} (um ein Polynom zu fitten), oder die allgemeinere Methode \texttt{numpy.linalg.lstsq}.
|
||||
Um eine eindeutige Lösung zu erhalten können wir die Moore-Penrose (eine Art der Pseudoinversen) verwenden, wofür \texttt{numpy.linalg.pinv} und \texttt{numpy.linalg.pinv2} zur Verfügung stehen
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
\subsubsection{Normalengleichung}
|
||||
\setLabelNumber{all}{9}
|
||||
\fancydef{Normalengleichung} $A^H Ax = A^H$
|
||||
|
||||
\inlineremark $A^H A$ ist Hermite-Symmetrisch, und falls $A$ vollen Rank hat, dannn ist $A^H A$ positiv-definit und die Normalengleichung hat eine eindeutige Lösung.
|
||||
Jedoch ist die Normalengleichung schlecht konditioniert (es gilt: $\cond(A^H A) = \cond(A)^2$).
|
||||
Für gut konditionierte Matrizen ist dies kein Problem, jedoch ist die Normalengleichung für schlecht konditionierte Matrizen ungeeignet.
|
||||
|
||||
|
||||
\inlineremark Man kann die Normalengleichung auch ohne die Berechnung von $A^H A$ berechnen:
|
||||
\rmvspace
|
||||
\begin{align*}
|
||||
A^H Ax = A^H b
|
||||
\Longleftrightarrow B
|
||||
\begin{bmatrix}
|
||||
r \\ x
|
||||
\end{bmatrix}
|
||||
:=
|
||||
\begin{bmatrix}
|
||||
-I & A \\
|
||||
A^H & 0
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
r \\ x
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
b \\ 0
|
||||
\end{bmatrix}
|
||||
\end{align*}
|
||||
|
||||
\drmvspace
|
||||
für $r := \frac{1}{a} (Ax - b)$ mit $a > 0$, dann können wir $B$ in obiger Gleichung durch
|
||||
$B_a =
|
||||
\begin{bmatrix}
|
||||
-aI & A \\
|
||||
A^H & 0
|
||||
\end{bmatrix}
|
||||
$
|
||||
@@ -0,0 +1 @@
|
||||
\subsection{Nichtlineare Ausgleichsrechnung}
|
||||
|
||||
Reference in New Issue
Block a user