Cours du jour
This commit is contained in:
parent
bef50f3f61
commit
e74c3a6dc8
3 changed files with 552 additions and 4 deletions
|
|
@ -381,11 +381,237 @@ $$\Rightarrow||P_n||=\sqrt{\frac{2}{2n+1}}$$
|
|||
|
||||
\section{Méthode des moindres carrés}
|
||||
|
||||
Soit $E$ espace vectoriel sur $\mathbb{R}$.
|
||||
|
||||
$$(f,g)\in E\times E\longrightarrow<f,g>\in\mathbb{R}$$
|
||||
$$||f||=\sqrt{<f,f>}$$
|
||||
|
||||
Soit $F\subset E$ (sous-espace vectoriel) de dimension finie.
|
||||
|
||||
\paragraph{Théorème} Une condition nécessaire et suffisante pour que
|
||||
$\phi^*\in F$ soit une meilleure approximation de
|
||||
$f\in E$ et que $<f.\phi^*,\phi>=0\quad\forall\phi\in F$
|
||||
|
||||
\paragraph{Démonstration}
|
||||
\subparagraph{Condition nécessaire}
|
||||
|
||||
Soit $\phi^*\in F$ la meilleure approximation de $f\in E$, supposons
|
||||
$\exists\phi_1\in F$ tel que $<f-\phi^*, \phi_1>=\alpha\neq 0$.
|
||||
|
||||
Soit $\phi_2=\phi^*+\beta.\phi_1$ avec $\beta=\frac{\alpha}{||\phi_1||^2}$
|
||||
$$
|
||||
\begin{array}{l l}
|
||||
||f-\phi_2||^2 & =<f-\phi_2, f-\phi_2>\\
|
||||
& =<f-\phi^*-\beta.\phi_1,f-\phi^*-\beta.\phi_1>\\
|
||||
& =||f-\phi^*||^2 - 2\beta<f-\phi^*,\phi_1>+\beta^2||\phi_1||^2\\
|
||||
& =||f-\phi^*||^2 - 2\beta\alpha + \beta^2||\phi_1||^2\\
|
||||
&=||f-\phi^*||^2-2\frac{\alpha^2}{||\phi_1||}+\frac{\alpha^2}{||\phi_1||^2}\\
|
||||
& =||f-\phi^*||^2-\frac{\alpha^2}{||\phi_1||^2}\\
|
||||
& =||f-\phi^*||^2-\frac{\alpha^2}{||\phi_1||^2}\\
|
||||
& \Rightarrow||f-\phi_2||<||f-\phi^*|| \text{ce qui est absurde car }\phi^*
|
||||
\text{ est déjà la meilleure approximation de } f\\
|
||||
& \Rightarrow <f-\phi^*, \phi>=0\forall\phi\in F\\
|
||||
\end{array}
|
||||
$$
|
||||
|
||||
\subparagraph{Condition suffisante}
|
||||
|
||||
Supposons que $<f-\phi^*,\phi>=0\quad\forall\phi\in F$.
|
||||
|
||||
Soit $\phi_1\in F$ tel que $<f-\phi_1,\phi>=0\quad\forall\phi\in F$.
|
||||
|
||||
$$
|
||||
\begin{array}{l l}
|
||||
||f-\phi||^2 & =<f-\phi, f-\phi>\\
|
||||
& = <(f-\phi_1)-(\phi-\phi_1), (f-\phi_1)-(\phi-\phi_1)>\\
|
||||
& =||f-\phi_1||^2-2<f-\phi_1, \phi-\phi_1>+||\phi-\phi_1||^2\\
|
||||
& =||f-\phi_1||^2+||\phi-\phi_1||^2\qquad\forall\phi\in F\\
|
||||
& \Rightarrow ||f-\phi_1||\le||f-\phi||\quad\forall\phi\in F\\
|
||||
& \Rightarrow ||f-\phi_1||=\min||f-\phi||\Longrightarrow\phi_1=\phi^*\\
|
||||
\end{array}
|
||||
$$
|
||||
|
||||
\subparagraph{Remarque} Cette condition montre que l'élément $\phi^*$
|
||||
représente la projection orthogonale de $f$ sur $F$.\\
|
||||
$\phi^*$ est unique
|
||||
|
||||
\subsubsection{Construction de $\phi^*$}
|
||||
|
||||
Soit ${\varphi_1,\varphi_2,\ldots,\varphi_n}$ une base de $F$.
|
||||
|
||||
$$\varphi^*=\sum^{n}_{k=1}a^*_k.\varphi_k$$
|
||||
|
||||
La condition d'orthogonalisation $<f-\varphi^*,\varphi_j>=0\quad\forall
|
||||
j=1\ldots
|
||||
n$\\
|
||||
$$\left<f-\sum^n_{k=1}a^*_k.\varphi_k,\varphi_j\right>=0\quad\forall j=1\ldots
|
||||
n$$
|
||||
$$<f,\varphi_j>-\sum^n_{k=1}a^*_{k=1}<\varphi_k,\varphi_j>=0\quad\forall
|
||||
j=1\ldots n$$
|
||||
|
||||
\[ (S)
|
||||
\begin{cases}
|
||||
\sum^n_{k=1}<\varphi_k,\varphi_j>a^*_k=<f,\varphi_j>\\
|
||||
\forall j=1\ldots n
|
||||
\end{cases}
|
||||
\]
|
||||
|
||||
C'est un système linéaire à $n$ équations et $n$ inconnues.
|
||||
|
||||
\paragraph{Remarque} Si la base ${\varphi_1,\varphi_2,\ldots,\varphi_n}$ est
|
||||
orthonormée, la matrice du système sera diagonale.\\
|
||||
|
||||
La matrice du système $(S)$ est la matrice de \emph{Gram}~:
|
||||
$$G_{kj}=<\varphi_k,\varphi_j>\forall k=1\ldots n, j=1\ldots n$$
|
||||
|
||||
\begin{enumerate}[(a)]
|
||||
\item \textbf{Cas continu}
|
||||
\end{enumerate}
|
||||
|
||||
Soit $\omega$ une fonction poids, position telle que $\int^b_af(x)\omega(x)dx$
|
||||
existe $\forall f\in E=\mathcal{C}([a,b])$.
|
||||
|
||||
$<f,g>=\int^b_af(x)g(x)\omega(x)dx$ produit scalaire sur $E$.
|
||||
|
||||
$F=\epsilon$ sous-espace vectoriel de dimension $n$.
|
||||
|
||||
$$(S)\Leftrightarrow
|
||||
\begin{cases}
|
||||
\sum^n_{k=1}a^*_k\int_a^b\varphi_k(x)\omega(x)dx=\int_a^bf(x)\varphi_j(x)dx\\
|
||||
\forall j=1\ldots n\\
|
||||
\end{cases}
|
||||
$$
|
||||
|
||||
$$\text{La matrice de Gram~: }
|
||||
G_{kj}=\int^b_a\varphi_k(x).\varphi_j(x)\omega(x)dx$$
|
||||
|
||||
\begin{enumerate}[(b)]
|
||||
\item \textbf{Cas discret}
|
||||
\end{enumerate}
|
||||
|
||||
Le produit scalaire discret~: $<f,g>=\sum^N_{i=0}f(x_i)g(x_i)\omega(x_i)$.
|
||||
|
||||
$f$ est donnée aux points $x_i(i=0\ldots N)$
|
||||
$$||f||=\sqrt{\sum^N_{i=0}f(x_i)\omega(x_i)}$$
|
||||
|
||||
$$(S)\Leftrightarrow
|
||||
\left\{
|
||||
\begin{array}{l}
|
||||
\sum^n_{k=1}a_k^*
|
||||
\sum^N_{i=0}\varphi_k(x_i).\varphi_j(x_i)\omega(x_i)=
|
||||
\sum^N_{i=0}f(x_i)\varphi_j(x_i)\omega(x_i)\\
|
||||
\forall j=1\ldots n \text{ La matrice } G_{kj}=
|
||||
\sum^N_{i=0}\varphi_k(x_i).\varphi_j(x_i)\omega(x_i)
|
||||
\end{array}\right.
|
||||
$$
|
||||
|
||||
\section{Interpolation}
|
||||
|
||||
\subsection{Algo de Lagrange}
|
||||
Soit $f(x)$ une fonction continue sur $[a,b]$.
|
||||
|
||||
\subsection{Algo de Newton}
|
||||
$f(x)$ est connue en $(n+1)$ points $x_i\in[a,b] (i=1\ldots n+1)$.
|
||||
|
||||
Chercher une fonction $\varphi$ d'un type choisi à l'avance qui interpole
|
||||
$f(x)$ sur $[a,b]$, c'est déterminer $\varphi$ tel que
|
||||
$\varphi(x_i)\quad\forall i=1\ldots n+1$.
|
||||
|
||||
En général, on cherche $\varphi$ dans l'espace des polynômes.
|
||||
|
||||
\subsection{Polynôme d'interpolation de Lagrange}
|
||||
|
||||
Soit $P_n(x)=\sum_{i=1}^{n+1}L_i(x)f(x_i)$ où les fonctions $L_i$ sont des
|
||||
polynômes de degré au plus $n$, telles que $L_i(x_j)=\delta_{ij}$.
|
||||
|
||||
$$L_i(x_j)=0\Rightarrow
|
||||
L_i(x)=C(x-x_1)(x-x_2)\ldots(x-x_{i-1})(x-x_{i+1})\ldots(x-x_{n+1})
|
||||
\qquad\forall j\neq i$$
|
||||
$$L_i(x_i)=1\Rightarrow
|
||||
C=\left[(x_i-x_1)\ldots(x-x_{i-1})(x-x_{i+1})\ldots(x-x_{n+1})\right]$$
|
||||
$$L_i(x)=\prod^{n+1}_{j=1~j/neq i}\frac{x-x_j}{x_i-x_j}\text{ La base de
|
||||
Lagrange}$$
|
||||
|
||||
$$P_n(x)=\sum^{n+1}_{i=1}L_i(x)f(x_i)=\sum^{n+1}_{i=1}\prod^{n+1}_{j=1~j\neq
|
||||
i}\frac{x-x_j}{x_i-x_j}f(x_i)\text{ Le polynôme de Lagrange}$$
|
||||
$$P_n(x_k)=\sum^{n+1}_{i=1}L_i(x_k)f(x_i)$$
|
||||
$$P_n(x_k)=f(x_k)\qquad\forall k=1\ldots n+1$$
|
||||
|
||||
\paragraph{Exemple} Soit $f$ continue telle que~:
|
||||
\begin{tabular}{r|cccc}
|
||||
$x_i$ & $0$ & $1$ & $3$ & $4$ \\ \hline
|
||||
$f(x_i)$ & $1$ & $3$ & $2$ & $5$
|
||||
\end{tabular}
|
||||
|
||||
Construire le polynôme d'interpolation $P_z(x)$ de $f(x)$.
|
||||
|
||||
$$P_z(x)=\frac{(x-1)(x-3)(x-4)}{(-1)(-3)(-4)}.1+
|
||||
\frac{x(x-3)(x-4)}{1(1-3)(1-4)}.3+
|
||||
\frac{x(x-1)(x-4)}{3(3-1)(3-4)}.2+
|
||||
\frac{x(x-1)(x-3)}{4(4-1)(4-3)}.5$$
|
||||
$$P_z(x)=\frac{x^3}{2}-\frac{14}{6}x^2+\frac{13}{3}x+1$$
|
||||
|
||||
Pour vérifier que l'on a pas fait d'erreur de calcul, on véfifie que
|
||||
$P_z(x_i)=f(x_i)$
|
||||
|
||||
\paragraph{Remarque} L'erreur d'interpolation $\varepsilon(x)=f(x)-P_n(x)$.
|
||||
|
||||
Si $f\in\mathcal{C}^{n+1}[a,b]$ ($f$ est dérivable $n+1$ fois avec ses dérivées
|
||||
continues).
|
||||
$$\exists\eta_x\in[a,b]/\varepsilon(x)=\prod^{n+1}_{i=1}(x-x_i)
|
||||
\frac{f^{(n+1)}(\eta_x)}{(n+1)!}$$
|
||||
|
||||
\subsection{Polynôme d'interpolation de Newton}
|
||||
|
||||
\paragraph{Différence divisées} Soit $f$ une fonction donnée en $n+1$ points
|
||||
$x_1,x_2,\ldots,x_{n+1}~(x_i\neq x_j~i\neq j)$.
|
||||
|
||||
On appelle différence divisée d'ordre $0,1,2,\ldots,n$ de $f$ les expressions
|
||||
suivantes~:
|
||||
|
||||
\begin{figure}[h!]
|
||||
\centering
|
||||
\begin{tabular}{c|c|c}
|
||||
\textbf{Ordre} & \textbf{Notation} & \textbf{Définition} \\ \hline
|
||||
$0$ & $f[x_i]$ & $f(x_i)$ \\
|
||||
$1$ & $f[x_i,x_j]$ & $\frac{f[x_i]-f[x_j]}{x_i-x_j}~i\neq j$ \\
|
||||
$2$ & $f[x_i,x_j,x_k]$ & $\frac{f[x_i,x_j]-f[x_j,x_k]}{x_i-x_k}~i\neq j\neq
|
||||
k$ \\
|
||||
\vdots&\vdots&\vdots\\
|
||||
$n$ & $f[x_1,\ldots,x_{n+1}]$ &
|
||||
$\frac{f[x_1,\ldots,x_n]-f[x_2,\ldots,x_{n+1}]}{x_1-x_{n+1}}$\\
|
||||
\end{tabular}
|
||||
\end{figure}
|
||||
|
||||
\paragraph{Polynôme de Newton}
|
||||
|
||||
$$f[x,x_1]=\frac{f(x)-f(x_1)}{x-x_1}\Rightarrow f(x)=f(x_1)+(x-x_1).f[x,x_1]$$
|
||||
$$f[x,x_1,x_2]=\frac{f[x,x_1]-f[x_1,x_2]}{x-x_2}
|
||||
\Rightarrow f[x,x_1]=f[x_1,x_2]+(x-x_2).f[x,x_1,x_2]$$
|
||||
$$f(x)=f(x_1)+(x-x_1).f[x_1,x_2]+(x-x_1)(x-x_2).f[x,x_1,x_2]$$
|
||||
|
||||
$$P_1(x)=f(x_1)+(x-x_1).f[x_1,x_2]$$
|
||||
$$P_1(x_1)=f(x_1)$$
|
||||
$$P_1(x_2)=f(x_1)+(x_2-x_1).\frac{f(x_1)-f(x_2)}{x_1-x_2}=f(x_1)-f(x_1)+f(x_2)
|
||||
=f(x_2)$$
|
||||
|
||||
Donc $P_1(x)$ interpole la fonction $f$ aux points $x_1$ et $x_2$.
|
||||
En réitérant le procédé, on obtient~:
|
||||
|
||||
$$f(x)=f(x_1)+(x-x_1).f[x_1,x_2]+(x-x_1)(x-x_2)f[x_1,x_2,x_3]+
|
||||
\ldots+(x-x_1)\ldots(x-x_n).f[x_1,\ldots,x_{n+1}]$$
|
||||
$$+\prod^{n+1}_{i=1}(x-x_i).f[x,x_1,\ldots,x_{n+1}]\qquad\text{l'erreur}$$
|
||||
|
||||
$P_n(x)$ est le polynôme d'interpolation de Newton de $f(x)$ aux $(n+1)$ points
|
||||
$x_i~(i=1\ldots n+1)$.
|
||||
$$\varepsilon(x)=\prod^{n+1}_{i=1}(x-x_i).f[x,x_1,\ldots,x_{n+1}]$$
|
||||
|
||||
\paragraph{Algorithme de Newton}
|
||||
|
||||
$$P_0(x)=f(x_1)$$
|
||||
|
||||
Pour $m=0,\ldots,n-1$~:
|
||||
$$P_{m+1}(x)=P_m(x)+(x-x_1)\ldots(x-x_{m-1}).f[x_1,\ldots,x_{m+1}]$$
|
||||
|
||||
%% Il cherchait à faire un tableau
|
||||
|
||||
\section{Dérivation numérique}
|
||||
|
||||
|
|
|
|||
Reference in a new issue