Il est de plus en plus fréquent pour le statisticien de se retrouver confronté à des jeux de données de grande dimension, dont il faudra extraire des informations pertinentes.
L'objectif d'une analyse en
composantes principales (ACP) est d'obtenir une représentation approchée d'un nuage de points dans
un sous-espace de dimension plus faible tout en perdant le moins d'information possible.
Les méthodes d'analyse factorielle contribuent également à améliorer la lisibilité des données, en mettant en évidence des
relations entre variables ou entre groupes de variables, ainsi qu'en permettant de visualiser
les relations entre données ou entre variables projetées dans l'espace de faible dimension des facteurs les plus significatifs.
Le point de départ d'une analyse factorielle est un jeu de données concernant \( n \) individus pour
lesquels on détient des observations pour \( p \) variables. Ce jeu de données peut alors être représenté
sous la forme d'un nuage de points de \( \R^p \) .
Lorsque \( p \) est grand, il devient alors difficile de visualiser correctement ce nuage de points, et les méthodes d'analyses factorielles que nous allons détailler ici
permettent alors de représenter la projection ce ce nuage de points dans un sous-espace de dimension plus petite, mais
en gardant le maximum d'information.
Cette situation peut être résumée dans une matrice \( (x_{i, j})\) communément appelée la
matrice des données
\[X=
\begin{pmatrix}
x_{1, 1} & \cdots & x_{1, p} \\
\vdots & \ddots & \vdots \\
x_{n, 1} & \cdots & x_{n, p}
\end{pmatrix}
\]
Ainsi dans la notation \( x_{ij}\) , l'indice \( i\) fait référence à l'individu \( i\) et l'indice \( j\) au caractère \( j\) .
Notons \( c_j=(x_{1, j}, \ldots, x_{n, j})\) la variable statistique du caractère \( j\) et \( e_i=(x_{i, 1}, \ldots, x_{i, p})\) la variable statistique de tous les caractères de l'individu \( i\) .
Ainsi la matrice \( (x_{i, j})\) est la matrice dont les lignes sont les \( e_i\) et les colonnes \( c_j\) .
Pour illustrer les propos de ce chapitre nous allons utiliser l'exemple suivant.
Pour un groupe de \( 60\) étudiants, on dispose de leur note en anglais et de mathématiques.
\[\begin{array}{|l|c|c|}
\hline
\text{Étudiant 1 } & 10.73 & 9.13 \\\hline
\text{Étudiant 2 } & 3.53 & 14.52 \\\hline
\text{Étudiant 3 } & 5.88 & 14.15 \\\hline
\text{Étudiant 4 } & 10.42 & 9.57 \\\hline
\text{Étudiant 5 } & 4.51 & 14.77 \\\hline
\text{Étudiant 6 } & 7.61 & 12.27 \\\hline
\text{Étudiant 7 } & 12.71 & 6.79 \\\hline
\text{Étudiant 8 } & 18.82 & 0.18 \\\hline
\text{Étudiant 9 } & 4.48 & 14.34 \\\hline
\text{Étudiant 10 } & 15.94 & 4.19 \\\hline
\text{Étudiant 11 } & 14.78 & 5.21 \\\hline
\text{Étudiant 12 } & 7.03 & 13.77 \\\hline
\text{Étudiant 13 } & 4.97 & 13.99 \\\hline
\text{Étudiant 14 } & 18.07 & 1.84 \\\hline
\text{Étudiant 15 } & 4.57 & 15.2 \\\hline
\text{Étudiant 16 } & 4.61 & 15.29 \\\hline
\text{Étudiant 17 } & 19.8 & 0 \\\hline
\text{Étudiant 18 } & 17.21 & 3.91 \\\hline
\text{Étudiant 19 } & 11.8 & 7.91 \\\hline
\text{Étudiant 20 } & 7.46 & 12.81 \\\hline
\end{array}
\]
\[
\begin{array}{|l|c|c|}
\hline
\text{Étudiant 21 } & 16.0 & 4.2 \\\hline
\text{Étudiant 22 } & 13.57 & 7.02 \\\hline
\text{Étudiant 23 } & 1.96 & 17.35 \\\hline
\text{Étudiant 24 } & 1.85 & 19.73 \\\hline
\text{Étudiant 25 } & 14.23 & 5.18 \\\hline
\text{Étudiant 26 } & 6.55 & 13.59 \\\hline
\text{Étudiant 27 } & 8.28 & 10.0 \\\hline
\text{Étudiant 28 } & 1.2 & 19.18 \\\hline
\text{Étudiant 29 } & 9.67 & 10.07 \\\hline
\text{Étudiant 30 } & 10.62 & 9.71 \\\hline
\text{Étudiant 31 } & 5.84 & 5.76 \\\hline
\text{Étudiant 32 } & 10.93 & 10.86 \\\hline
\text{Étudiant 33 } & 8.36 & 4.54 \\\hline
\text{Étudiant 34 } & 7.24 & 12.17 \\\hline
\text{Étudiant 35 } & 5.25 & 7.84 \\\hline
\text{Étudiant 36 } & 13.2 & 12.55 \\\hline
\text{Étudiant 37 } & 10.72 & 16.36 \\\hline
\text{Étudiant 38 } & 11.78 & 10.73 \\\hline
\text{Étudiant 39 } & 6.9 & 9.2 \\\hline
\text{Étudiant 40 } & 5.02 & 0 \\\hline
\end{array}
\]
\[
\begin{array}{|l|c|c|}
\hline
\text{Étudiant 41 } & 6.77 & 4.89 \\\hline
\text{Étudiant 42 } & 13.85 & 13.8 \\\hline
\text{Étudiant 43 } & 8.53 & 4.85 \\\hline
\text{Étudiant 44 } & 5.64 & 6.77 \\\hline
\text{Étudiant 45 } & 12.6 & 11.38 \\\hline
\text{Étudiant 46 } & 14.13 & 10.72 \\\hline
\text{Étudiant 47 } & 7.95 & 8.4 \\\hline
\text{Étudiant 48 } & 7.41 & 3.34 \\\hline
\text{Étudiant 49 } & 5.73 & 4.4 \\\hline
\text{Étudiant 50 } & 12.25 & 11.13 \\\hline
\text{Étudiant 51 } & 12.03 & 11.51 \\\hline
\text{Étudiant 52 } & 9.65 & 7.39 \\\hline
\text{Étudiant 53 } & 12.64 & 8.08 \\\hline
\text{Étudiant 54 } & 11.03 & 11.45 \\\hline
\text{Étudiant 55 } & 10.85 & 9.2 \\\hline
\text{Étudiant 56 } & 5.19 & 6.26 \\\hline
\text{Étudiant 57 } & 9.81 & 11.31 \\\hline
\text{Étudiant 58 } & 10.96 & 4.67 \\\hline
\text{Étudiant 59 } & 7.8 & 3.66 \\\hline
\text{Étudiant 60 } & 13.39 & 20 \\\hline
\end{array}\]
Avec nos notations, \( X=\begin{pmatrix}
10.73&9.13\\
3.53&14.52\\
\vdots&\vdots\\
7.8&3.66\\
13.39&20
\end{pmatrix}\) est une matrice à \( 60\) lignes et \( 2\) colonnes
et par exemple \( e_{30}=(10.62\qquad 9.71)\) , \( e_{52}=(9.65\qquad 7.39)\) .
Dans ce cas très particulier de la dimension \( p=2\) , nous pouvons représenter ces données dans un repère.
Théorème
Soit \( X\in \mathcal{Mat}_{n, p}(\R)\) une matrice des données. Alors \( {\vphantom{X}}^{t}{X}X\) est une matrice diagonalisable et toutes ses valeurs propres sont strictement positive.
Démonstration
Admise
Avec le données de notre exemple, on a
\( {\vphantom{X}}^{t}{X}X
=\begin{pmatrix}
6578.5797 & 4818.7964\\
4818.7964 & 6808.7059
\end{pmatrix}\) .
Il est d'accoutumé en statistique de travailler avec des données normalisées. C'est à dire de considérer la matrice, que nous noterons dans la suite encore \( X\) pour ne pas alourdir les notations
\[X=\left(\dfrac{x_{i, j}-\overline{c_j}}{\sigma_{c_{j}}}\right)_{i, j}\]
Avec notre exemple, nous avons :
En d'autre terme, sans perdre en généralité, on peut supposer que les colonnes des \( X\) sont des variables statistiques de moyenne nulles et d'écart-type \( 1\) .
En particulier, nous pouvons considérer les individus \( e_i\) comme des vecteurs de \( \overrightarrow{e}_{i}\in \R^p\) . Dans l'absolue \( \overrightarrow{e}_{i}\) est la transposée de la \( i\) -ème ligne de \( X\) .
Dans la suite, on munit \( \R^p\) de sa structure euclidienne canonique.
Exercice
Soit \( X\in \mathcal{Mat}_{n, p}(\R)\) une matrice des données et \( \overline{X}\) la matrice des données centrées et réduites.
- Montrer que \( \left(\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\right)_{i, j}=corr(c_i, c_j)\) .
- En déduire que \( \left(\dfrac{1}{n}{\vphantom{\overline{X}}}^{t}{\overline{X}}\overline{X}\right)_{i, j}=cov(c_i, c_j)\) .
- En déduire que \( \left(\dfrac{1}{n}{\vphantom{\overline{X}}}^{t}{\overline{X}}\overline{X}\right)_{i, i}=1\) .
- En déduire que \( tr\left({\vphantom{\overline{X}}}^{t}{\overline{X}}\overline{X}\right)=np\) .
Avec notre exemple, on a
\( \dfrac{1}{60}{\vphantom{\overline{X}}}^{t}{\overline{X}}\overline{X}=
\begin{pmatrix}
1 & -0.4849\\
-0.4849&1
\end{pmatrix}
\)
Définition
Soit \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (e_i)_{i\in[\![1, n]\!]}\) . On appel inertie absolue ou inertie totale de \( X\) , noté \( I(X)\) , le nombre
\[I(X)=\dfrac{1}{n}\sum_{i=1}^n\norm{\overrightarrow{e}_{i}}^2\]
On pourra vérifier que l'inertie absolue de notre exemple est \( I(X) = 2\) . En fait c'est toujours le cas, on a toujours \( I(X)=p\) . Nous le démontrerons plus tard.
On note parfois l'inertie absolue \( I_{\R^p}\) . Cela donne du sens à la définition suivante.
Définition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (e_i)_{i\in[\![1, n]\!]}\) et \( V\) un sous espace vectoriel de \( \R^p\) . On appel inertie relative à \( V\) le nombre
\[I_V(X)=\dfrac{1}{n}\sum_{i=1}^n\norm{p_V(\overrightarrow{e}_{i})}^2\]
En d'autre terme, au lieu de regarder les individus dans \( \R^p\) , on les regarde dans un espace plus petit au travers de leur projection. On ne calcule plus les normes des individus dans l'absolue de tout l'espace, comme dans l'inertie totale, mais leur projeté sur l'espace considéré.
Proposition [Pythagore]
Soit \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (e_i)_{i\in[\![1, n]\!]}\) .
- \( (i)\) .
- \( \forall V\subseteq\R^p\) , \( I_V(X)\leqslant I(X)\)
- \( (ii)\) .
- \( \forall V\subseteq\R^p\) , \( I(X)=I_{V}(X)+I_{V^{\bot}}(X)\)
- \( (iii)\) .
- \( \forall V\subseteq\R^p\) , \( \dpl{I_{V^{\bot}}(X)=\dfrac{1}{n}\sum_{i=1}^n\norm{\overrightarrow{e}_{i}-p_V(\overrightarrow{e}_{i})}^2}\)
Démonstration
Il s'agit de la reformulation du théorème de Pythagore : \( \overrightarrow{e}_{i}=\left(\overrightarrow{e}_{i}-p_V(\overrightarrow{e}_{i})\right)+p_V(\overrightarrow{e}_{i})\)
Avec notre exemple, considérons \( \overrightarrow{v}=\begin{pmatrix}
1\\2
\end{pmatrix}\) et \( V={\texttt{Vect}}\left(\overrightarrow{v} \right)\) alors l'inertie relative à \( V\) est \( I_V(X)=0.6120739427123439\) .
L'idée de l'ACP est de trouver un sous-espace vectoriel \( V\) (dont la dimension est fixée
a priori et est en général \( 1\) , \( 2\) ou \( 3\) en fonction des besoins du datascientiste) de sorte que l'inertie relative à \( V\) , soit la plus proche de l'inertie totale. D'après la proposition précédente, il s'agit donc de trouver \( V\subseteq \R^p\)
simple tel que \( I_V(X)\) soit le plus grand possible ou de manière équivalente \( I_{V^{\bot}}(X)\) soit le plus petit possible.
Proposition
Soit \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données.
Si \( \overrightarrow{v}\in E\) un vecteur unitaire et \( V={\texttt{Vect}}\left(\overrightarrow{v} \right)\) alors
\[I_V(X)=\dfrac{1}{n}\left\langle \overrightarrow{v} \left|\vphantom{\overrightarrow{v} {\vphantom{X}}^{t}{X}X\overrightarrow{v}}\right. {\vphantom{X}}^{t}{X}X\overrightarrow{v} \right\rangle\]
Démonstration
D'une part on a
\begin{eqnarray*}
I_V(X)
&=& \dfrac{1}{n}\sum_{i=1}^n\norm{p_V(\overrightarrow{e}_{i})}^2\\
&=& \dfrac{1}{n}\sum_{i=1}^n\left\langle \overrightarrow{e}_{i} \left|\vphantom{\overrightarrow{e}_{i} \overrightarrow{v}}\right. \overrightarrow{v} \right\rangle^2\\
&=& \dfrac{1}{n}\sum_{i=1}^n\left(\sum_{j=1}^px_{i, j}v_j\right)^2\\
&=& \dfrac{1}{n}\sum_{i=1}^n\sum_{k=1}^p\sum_{l=1}^px_{i, k}v_kx_{i, l}v_l\\
&=& \dfrac{1}{n}\sum_{k=1}^p\sum_{l=1}^p\sum_{i=1}^nx_{i, k}v_kx_{i, l}v_l\\
&=& \dfrac{1}{n}\sum_{k=1}^p\sum_{l=1}^p\left(\sum_{i=1}^nx_{i, k}x_{i, l}\right)v_kv_l\\
&=& \dfrac{1}{n}\sum_{k=1}^p\sum_{l=1}^pcov(c_k, c_l)v_kv_l
\end{eqnarray*}
D'autre part, on rappel que \( ({\vphantom{X}}^{t}{X}X)_{i, j}=cov(c_i, c_j)\) . On a alors
\begin{eqnarray*}
\left\langle \overrightarrow{v} \left|\vphantom{\overrightarrow{v} {\vphantom{X}}^{t}{X}X\overrightarrow{v}}\right. {\vphantom{X}}^{t}{X}X\overrightarrow{v} \right\rangle
&=&\left\langle
\begin{pmatrix}
v_1\\\vdots\\v_p
\end{pmatrix}
\left|\vphantom{
\begin{pmatrix}
v_1\\\vdots\\v_p
\end{pmatrix}
\begin{pmatrix}
cov(c_1, c_1)&\cdots&cov(c_1, c_p)\\
\vdots&\ddots&\vdots\\
cov(c_p, c_1)&\cdots&cov(c_p, c_p)
\end{pmatrix}
\begin{pmatrix}
v_1\\\vdots\\v_p
\end{pmatrix}
}\right.
\begin{pmatrix}
cov(c_1, c_1)&\cdots&cov(c_1, c_p)\\
\vdots&\ddots&\vdots\\
cov(c_p, c_1)&\cdots&cov(c_p, c_p)
\end{pmatrix}
\begin{pmatrix}
v_1\\\vdots\\v_p
\end{pmatrix}
\right\rangle\\
&=&\left\langle
\begin{pmatrix}
v_1\\\vdots\\v_p
\end{pmatrix}
\left|\vphantom{
\begin{pmatrix}
v_1\\\vdots\\v_p
\end{pmatrix}
\begin{pmatrix}
\vdots\\
\dpl{\sum_{l=1}^pcov(c_i, c_l)v_l}
\\\vdots
\end{pmatrix}
}\right.
\begin{pmatrix}
\vdots\\
\dpl{\sum_{l=1}^pcov(c_i, c_l)v_l}
\\\vdots
\end{pmatrix}
\right\rangle\\
&=&\sum_{k=1}^p\sum_{l=1}^pcov(c_k, c_l)v_lv_k
\end{eqnarray*}
Avec notre exemple, prenons \( \overrightarrow{v}=\begin{pmatrix}
\dfrac{1}{\sqrt{5}}\\\dfrac{2}{\sqrt{5}}
\end{pmatrix}\) . On a \( {\vphantom{X}}^{t}{X}X=
\begin{pmatrix}
60 & -29.0945\\
-29.0945 & 60
\end{pmatrix}
\) et \( \dfrac{1}{n}\left\langle \overrightarrow{v} \left|\vphantom{\overrightarrow{v} {\vphantom{X}}^{t}{X}X\overrightarrow{v}}\right. {\vphantom{X}}^{t}{X}X\overrightarrow{v} \right\rangle=
\dfrac{1}{60}\left\langle
\begin{pmatrix}
\dfrac{1}{\sqrt{5}}\\\dfrac{2}{\sqrt{5}}
\end{pmatrix}
\left|\vphantom{
\begin{pmatrix}
\dfrac{1}{\sqrt{5}}\\\dfrac{2}{\sqrt{5}}
\end{pmatrix}
\begin{pmatrix}
60 & -29.0945\\
-29.0945 & 60
\end{pmatrix}
\begin{pmatrix}
\dfrac{1}{\sqrt{5}}\\\dfrac{2}{\sqrt{5}}
\end{pmatrix}}\right. \begin{pmatrix}
60 & -29.0945\\
-29.0945 & 60
\end{pmatrix}
\begin{pmatrix}
\dfrac{1}{\sqrt{5}}\\\dfrac{2}{\sqrt{5}}
\end{pmatrix} \right\rangle=0.6120739427123443=I_V(X)\)
Théorème
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données, \( \overrightarrow{v}\) un vecteur propre unitaire de valeur propre \( \lambda\) de la matrice \( \dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) .
\[I_V(X)=\lambda\]
Démonstration
\( I_V(X)=\dfrac{1}{n}\left\langle \overrightarrow{v} \left|\vphantom{\overrightarrow{v} {\vphantom{X}}^{t}{X}X\overrightarrow{v}}\right. {\vphantom{X}}^{t}{X}X\overrightarrow{v} \right\rangle=\left\langle \overrightarrow{v} \left|\vphantom{\overrightarrow{v} \dfrac{1}{n}{\vphantom{X}}^{t}{X}X\overrightarrow{v}}\right. \dfrac{1}{n}{\vphantom{X}}^{t}{X}X\overrightarrow{v} \right\rangle=\left\langle \overrightarrow{v} \left|\vphantom{\overrightarrow{v} \lambda\overrightarrow{v}}\right. \lambda\overrightarrow{v} \right\rangle=\lambda\norm{\overrightarrow{v}}^2=\lambda\)
Dans notre exemple, nous avons \( \dfrac{1}{60}{\vphantom{X}}^{t}{X}X=
\begin{pmatrix}
1 & -0.4849\\
-0.4849& 1
\end{pmatrix}
\)
dont on peut montrer que \( 0.51509243\) et \( 1.48490757\) sont des valeurs propres de vecteurs propres unitaire respectif \(
\begin{pmatrix}
-\dfrac{1}{\sqrt{2}}\\-\dfrac{1}{\sqrt{2}}
\end{pmatrix}
\) et \(
\begin{pmatrix}
\dfrac{1}{\sqrt{2}}\\-\dfrac{1}{\sqrt{2}}
\end{pmatrix}
\) . On laisse le soin au lecteur de vérifier les calculs.
Corollaire
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données et \( \lambda_1\) , \( \ldots\) , \( \lambda_p\) des valeurs propres de \( \dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) . L'inertie totale de \( X\) est la somme des valeurs propre
\[I(X)=\sum_{i=1}^p\lambda_i\]
Démonstration
C'est une conséquence de l'égalité \( I(X)=I_V(X)+I_{V^{\bot}}(X)\) avec le précédent théorème.
Avec notre exemple, on vérifie bien que \( I(X)\simeq2\simeq0.515+1.485\) .
Corollaire
Soit \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données. Alors \( I(X)=p\)
Démonstration
L'inertie \( I(X)\) est la somme des valeurs propres, c'est à dire la trace de la diagonalisation de la matrice de variance-covariance \( \dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) . La trace est invariante par changement de base.
Puisque les données sont centrée et réduite les variances, les éléments diagonaux de la matrice de variance-covariance, valent \( 1\) .
Définition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données, \( \lambda_1\) , \( \cdots\) , \( \lambda_p\) les valeurs propres de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) (comptées avec leur multiplicité) et \( \overrightarrow{v}_i\) leur vecteurs propres associés.
On appel les droites \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) les axes factoriels ou axes principales d'inertie.
Dans notre exemple les axes factoriels sont\(
\begin{pmatrix}
-\dfrac{1}{\sqrt{2}}\\-\dfrac{1}{\sqrt{2}}
\end{pmatrix}
\) et \(
\begin{pmatrix}
\dfrac{1}{\sqrt{2}}\\-\dfrac{1}{\sqrt{2}}
\end{pmatrix}
\)
\[I_V(X)\simeq 1.485\]
\[I_{V}(X)\simeq 0.515\]
On rappel que l'idée est de trouver une sous-espace vectoriel \( V\) tel que \( I_V(X)\) soit le plus grand possible (ou \( I_{V^{\bot}}(X)\) est le plus petit possible).
D'après les résultats précédent, si on considère les vecteurs propres \( \overrightarrow{v}_i\) de la matrices \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) associés aux valeurs propres ordonnées \( \lambda_1\geqslant\cdots\geqslant \lambda_p\) et \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) alors \( I_{V_1}=\lambda_1=max(\lambda_i)=max(I_{V_i}(X))\) . On appel usuellement cette droite
axe principale.
§
En pratique il y a deux manières de construire les axes.
- Ascendante.
- On choisit la valeur propre \( \lambda\) la plus grande. L'axe principale \( \overrightarrow{v}\) de cette valeur propre porte donc principalement l'inertie totale.
Dans notre exemple, l'axe principale est porté par le vecteur \( \overrightarrow{v}=\begin{pmatrix}
0.7071\\-0.7071
\end{pmatrix}\) . En particulier le calcul de \( d_i=0.7071\times Note_{Anglais, i}-0.7071\times Note_{Math, i}\) permet de garder l'essentiel de l'information d'un étudiant.
- Descendante.
- On choisit d'enlever la valeur propre \( \lambda\) la plus petite. Si \( \overrightarrow{v}\) est un vecteur propre de cette valeur propre et \( V={\texttt{Vect}}\left(\overrightarrow{v} \right)\) , on choisit de projeter sur \( V^{\bot}\) .
Définition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données, \( \lambda_1\) , \( \cdots\) , \( \lambda_p\) les valeurs propres de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) (comptées avec leur multiplicité), \( \overrightarrow{v}_i\) leur vecteurs propres associés et \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) .
On appel contribution relative de l'axe \( V_j\) le réel \( \dpl{cr_j = \dfrac{\lambda_i}{\sum_{i=1}^p\lambda_i}}\) .
Dans notre exemple la contribution relative de l'axe principale \( \overrightarrow{v}=\begin{pmatrix}
0.7071\\-0.7071
\end{pmatrix}\) est \( cr_1=\dfrac{1.485}{2}\simeq74, 25\%\) . Il faut donc comprendre que environ \( 75\%\) de l'information d'un individu se retrouve sur l'axe principale \( V={\texttt{Vect}}\left(\overrightarrow{v} \right)\) .
Définition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (\overrightarrow{e}_{i})_{i\in[\![1 ; n]\!]}\) , \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) (comptées avec leur multiplicité) et \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) les axes factoriels.
On appel contribution relative de l'individu \( \overrightarrow{e}_{i}\) sur l'axe \( V_j\) le nombre \( cr_{j}(\overrightarrow{e}_{i})=\dfrac{\left\langle {\overrightarrow{e}_{i}}_{\mathcal{B}} \left|\vphantom{{\overrightarrow{e}_{i}}_{\mathcal{B}} {\overrightarrow{v}_j}_{\mathcal{B}}}\right. {\overrightarrow{v}_j}_{\mathcal{B}} \right\rangle^2}{\norm{{\overrightarrow{e}_{i}}_{\mathcal{B}}}^2}\)
Reprenons notre exemple, la base \( \mathcal{B}\) de diagonalisation est \( \overrightarrow{f}_{1}=\begin{pmatrix}
-0.7071\\-0.7071
\end{pmatrix}\) et \( \overrightarrow{f}_{2}=
\begin{pmatrix}
0.7071\\-0.7071
\end{pmatrix}
\) . Considérons par exemple l'individu \( \overrightarrow{e}_{30}=\begin{pmatrix}
0.2504
\\
0.0464
\end{pmatrix}\) , dont on peut démontrer que \( \overrightarrow{e}_{30}\simeq -0.2099\overrightarrow{f}_{1}+0.1442\overrightarrow{f}_{2}\) . Ainsi on a
\( cr_1(\overrightarrow{e}_{30})\simeq \dfrac{
\left\langle
\begin{pmatrix}
-0.2099\\0.1442
\end{pmatrix}
\left|\vphantom{
\begin{pmatrix}
-0.2099\\0.1442
\end{pmatrix}
\begin{pmatrix}
1\\0
\end{pmatrix}
}\right.
\begin{pmatrix}
1\\0
\end{pmatrix}
\right\rangle ^2
}{\norm{\begin{pmatrix}
0.2099\\0.1442
\end{pmatrix}}^2}\simeq 0.6793\) . De même \( cr_2(\overrightarrow{e}_{30})\simeq 0.3207\)
Proposition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (\overrightarrow{e}_{i})_{i\in[\![1 ; n]\!]}\) , \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) (comptées avec leur multiplicité) et \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) les axes factoriels.
\[cr_j(\overrightarrow{e}_{i})=cos(\overrightarrow{e}_{i}, \overrightarrow{v}_{j})^2=\dfrac{\left\langle \overrightarrow{e}_{i} \left|\vphantom{\overrightarrow{e}_{i} \overrightarrow{v}_{j}}\right. \overrightarrow{v}_{j} \right\rangle^2}{\norm{\overrightarrow{e}_{i}}^2}\]
Démonstration
Notons \( P\) la matrice de passage de la base canonique à la base orthonormale des vecteurs propre. Alors \( P\) est une matrice orthogonale, c'est à dire \( {\vphantom{P}}^{t}{P}P=Id_p\) . De plus \( \overrightarrow{x}_{\mathcal{B}}=P\overrightarrow{x}\) .
\begin{eqnarray*}
cr_j(\overrightarrow{e}_{i})
&=& \dfrac{\left\langle {\overrightarrow{e}_{i}}_{\mathcal{B}} \left|\vphantom{{\overrightarrow{e}_{i}}_{\mathcal{B}} {\overrightarrow{v}_j}_{\mathcal{B}}}\right. {\overrightarrow{v}_j}_{\mathcal{B}} \right\rangle^2}{\norm{{\overrightarrow{e}_{i}}_{\mathcal{B}}}^2}\\
&=& \dfrac{{\vphantom{{\overrightarrow{e}_{i}}_{\mathcal{B}}}}^{t}{{\overrightarrow{e}_{i}}_{\mathcal{B}}}{{\overrightarrow{v}_j}_{\mathcal{B}}}^2}{{\vphantom{{\overrightarrow{e}_{i}}_{\mathcal{B}}}}^{t}{{\overrightarrow{e}_{i}}_{\mathcal{B}}}{\overrightarrow{e}_{i}}_{\mathcal{B}}}\\
&=& \dfrac{{\vphantom{{\left(P\overrightarrow{e}_{i}\right)}}}^{t}{{\left(P\overrightarrow{e}_{i}\right)}}{{\left(P\overrightarrow{v}_j\right)}}^2}{{\vphantom{{\left(P\overrightarrow{e}_{i}\right)}}}^{t}{{\left(P\overrightarrow{e}_{i}\right)}}{\left(P\overrightarrow{e}_{i}\right)}}\\
&=& \dfrac{{\vphantom{\overrightarrow{e}_{i}}}^{t}{\overrightarrow{e}_{i}}{\vphantom{P}}^{t}{P}{{P\overrightarrow{v}_j}}^2}{{\vphantom{\overrightarrow{e}_{i}}}^{t}{\overrightarrow{e}_{i}}{\vphantom{P}}^{t}{P}{P\overrightarrow{e}_{i}}}\\
&=& \dfrac{{\vphantom{\overrightarrow{e}_{i}}}^{t}{\overrightarrow{e}_{i}}{{\overrightarrow{v}_j}}^2}{{\vphantom{\overrightarrow{e}_{i}}}^{t}{\overrightarrow{e}_{i}}{\overrightarrow{e}_{i}}}\\
&=&\dfrac{\left\langle \overrightarrow{e}_{i} \left|\vphantom{\overrightarrow{e}_{i} \overrightarrow{v}_{j}}\right. \overrightarrow{v}_{j} \right\rangle^2}{\norm{\overrightarrow{e}_{i}}^2}\\
&=&\dfrac{\left\langle \overrightarrow{e}_{i} \left|\vphantom{\overrightarrow{e}_{i} \overrightarrow{v}_{j}}\right. \overrightarrow{v}_{j} \right\rangle^2}{\norm{\overrightarrow{e}_{i}}^2\norm{\overrightarrow{v}_j}^2}\\
&=&cos^2(\overrightarrow{e}_{i}, \overrightarrow{v}_j)
\end{eqnarray*}
Plus la (racine carré) contribution relative d'une donnée est proche de \( 1\) plus sa projection sur l'axe principale est proche de la donnée.
Définition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (\overrightarrow{e}_{i})_{i\in[\![1 ; n]\!]}\) , \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) et \( P\) la matrice de passage de la base canonique à \( \mathcal{B}\) .
Posons \( Y=XP\) . Les colonnes de \( Y\) sont appelées les composantes principales.
Les composantes principales correspondent donc aux caractères étudiés dans la base des axes factoriels.
Avec notre exemple, nous obtenons la matrice \( Y\)
\[
\begin{array}{cc}
-0.247 &-0.143 \\
1.718 &0.249 \\
1.279 &-0.081 \\
-0.132 &-0.157 \\
1.594 &0.052 \\
0.722 &-0.09 \\
-0.912 &-0.126 \\
-2.876 &-0.163 \\
1.536 &0.12 \\
-1.82 &-0.276 \\
-1.481 &-0.235 \\
1.035 &-0.214 \\
1.405 &0.091 \\
-2.511 &-0.282 \\
1.647 &-0.02 \\
1.653 &-0.04 \\
-3.063 &-0.297 \\
-2.069 &-0.443 \\
-0.6 &-0.141 \\
0.825 &-0.145
\end{array}
\]
\[\begin{array}{cc}
-1.828 &-0.287 \\
-1.019 &-0.301 \\
2.387 &0.094 \\
2.752 &-0.235 \\
-1.396 &-0.14 \\
1.088 &-0.109 \\
0.281 &0.131 \\
2.779 &-0.049 \\
0.064 &-0.107 \\
-0.144 &-0.21 \\
0.062 &1.149 \\
-0.027 &-0.428 \\
-0.528 &0.914 \\
0.768 &-0.015 \\
0.462 &0.942 \\
-0.152 &-1.046 \\
0.809 &-1.196 \\
-0.185 &-0.548 \\
0.39 &0.473 \\
-0.643 &2.123
\end{array}
\]
\[\begin{array}{cc}
-0.217 &1.123 \\
-0.077 &-1.335 \\
-0.511 &0.841 \\
0.242 &1.034 \\
-0.225 &-0.777 \\
-0.571 &-0.932 \\
0.102 &0.418 \\
-0.548 &1.244 \\
-0.118 &1.365 \\
-0.204 &-0.684 \\
-0.113 &-0.703 \\
-0.324 &0.287 \\
-0.713 &-0.303 \\
0.042 &-0.531 \\
-0.256 &-0.173 \\
0.242 &1.182 \\
0.222 &-0.311 \\
-0.935 &0.469 \\
-0.565 &1.134 \\
0.903 &-2.164
\end{array}
\]
Pur alléger les notations, nous noterons encore \( c_j\) la variable statistique des composantes principale (les colonnes de \( Y)\) .
Proposition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données, \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) , \( P\) la matrice de passage de la base canonique à \( \mathcal{B}\) et \( Y=XP=(c_1, \ldots, c_p)\) .
- \( (i)\) .
- \( \forall j \in [\![1 ; p]\!]\) , \( \overline{c_j}=0\)
- \( (ii)\) .
- \( \forall j \in [\![1 ; p]\!]\) , \( \sigma_{c_j}^2=\lambda_j\)
- \( (iii)\) .
- \( \forall i, j \in [\![1 ; p]\!]\) , \( i\neq j\) , \( cov(c_i, c_j)=0\)
Démonstration
- \( (i)\) .
- Par construction la \( i\) -ème coordonnée du vecteur \( c_j\) , est \( \dpl{\sum_{k=1}^p x_{i, k}P_{k, j}}\) alors
\begin{eqnarray*}
\overline{c_j}
&=& \dfrac{1}{n}\sum_{i=1}^n\sum_{k=1}^p x_{i, k}P_{k, j}\\
&=& \dfrac{1}{n}\sum_{k=1}^p\sum_{i=1}^n x_{i, k}P_{k, j}\\
&=& \sum_{k=1}^p\left(\dfrac{1}{n}\sum_{i=1}^n x_{i, k}\right)P_{k, j}\\
&=& \sum_{k=1}^p\left(0\right)P_{k, j}\\
&=& 0
\end{eqnarray*}
- \( (ii)\) et \( (iii)\) .
- Les vecteurs colonnes de la matrice \( P\) sont les vecteurs \( \overrightarrow{v}_j\) de la base orthonormale de vecteurs propres. En particulier \( c_j=X\overrightarrow{v}_j\) . Ainsi
\begin{eqnarray*}
cov(c_i, c_j)
&=&cov(X\overrightarrow{v}_i, X\overrightarrow{v}_j)\\
&=&\dfrac{1}{n}\left\langle X\overrightarrow{v}_i \left|\vphantom{X\overrightarrow{v}_i X\overrightarrow{v}_j}\right. X\overrightarrow{v}_j \right\rangle\\
&=&\dfrac{1}{n}{\vphantom{\left(X\overrightarrow{v}_i\right)}}^{t}{\left(X\overrightarrow{v}_i\right)}{\left(X\overrightarrow{v}_j\right)}\\
&=&\dfrac{1}{n}{\vphantom{\overrightarrow{v}_i}}^{t}{\overrightarrow{v}_i}{\vphantom{X}}^{t}{X}{X\overrightarrow{v}_j}\\
&=&{\vphantom{\overrightarrow{v}_i}}^{t}{\overrightarrow{v}_i}A{\overrightarrow{v}_j}\\
&=&\left\langle \overrightarrow{v}_i \left|\vphantom{\overrightarrow{v}_i A\overrightarrow{v}_j}\right. A\overrightarrow{v}_j \right\rangle\\
&=&\left\langle \overrightarrow{v}_i \left|\vphantom{\overrightarrow{v}_i \lambda_j\overrightarrow{v}_j}\right. \lambda_j\overrightarrow{v}_j \right\rangle\\
&=&\lambda_j\left\langle \overrightarrow{v}_i \left|\vphantom{\overrightarrow{v}_i \overrightarrow{v}_j}\right. \overrightarrow{v}_j \right\rangle
\end{eqnarray*}
où \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) est diagonale dans la base \( \mathcal{B}\) .
Proposition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données, \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) .
Pour tout \( i\) et \( j\) distinct entre \( 1\) et \( n\) , notons \( U_{i, j}=\left(V_i\overset{\bot}{\oplus} Vj\right)^{\bot}\) .
Pour tout \( \overrightarrow{x}\in \R^p\) , il existe des uniques \( \alpha_{i, j}(\overrightarrow{x})\in \R\) , \( \beta_{i, j}(\overrightarrow{x})\in \R\) et \( \overrightarrow{u}_{i, j}(\overrightarrow{x})\in U\) tel que
\[\overrightarrow{x}=\alpha_{i, j}(\overrightarrow{x})\overrightarrow{v}_{i}+\beta_{i, j}(\overrightarrow{x})\overrightarrow{v}_{j}+\overrightarrow{u}_{i, j}(\overrightarrow{x})\]
De plus \( \alpha_{i, j}(\overrightarrow{x})=\left\langle \overrightarrow{x} \left|\vphantom{\overrightarrow{x} \overrightarrow{v}_{i}}\right. \overrightarrow{v}_{i} \right\rangle\) et \( \beta_{i, j}(\overrightarrow{x})=\left\langle \overrightarrow{x} \left|\vphantom{\overrightarrow{x} \overrightarrow{v}_{j}}\right. \overrightarrow{v}_{j} \right\rangle\)
Démonstration
L'existence de la décomposition est une conséquence de l'égalité \( \R^p=V_i\overset{\bot}{\oplus} V_j\overset{\bot}{\oplus} U_{i, j}\) .
Finalement la description de \( \alpha_{i, j}\) est une conséquence de la définition de la projection
Théorème
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (\overrightarrow{e}_{k})_{k\in [\![1 ; n]\!]}\) , \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) et \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) les axes factoriels. Notons \( P\) la matrice passage de la base canonique à \( \mathcal{B}\) .
\[\alpha_{i, j}(\overrightarrow{e}_{k})=\sqrt{\lambda_i}P_{k, i}\qquad \beta_{i, j}(\overrightarrow{e}_{k})=\sqrt{\lambda_j}P_{k, j}\]
Démonstration
Distinguons les colonnes de \( X\) en les notant \( c_j\) et les colonnes des \( Y=XP\) en les notant \( d_j\) . On rappel que \( {\vphantom{P}}^{t}{P}AP=D\) ou encore \( AP=PD\) où \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) et \( D\) est la matrice diagonale des valeurs propres.
D'une part on a
\( \dpl{\alpha_{i, j}(\overrightarrow{e}_{k}) = \left\langle \overrightarrow{e}_{k} \left|\vphantom{\overrightarrow{e}_{k} \overrightarrow{v}_{i}}\right. \overrightarrow{v}_{i} \right\rangle=\sum_{a=1}^px_{k, a}P_{a, i}=(XP)_{k, i}= Y_{k, i}=corr(c_k, d_i)}\) . Calculons cette corrélation.
\begin{eqnarray*}
cov(c_i, d_j)
&=& cov(c_i,(XP)_j)\\
&=& \dfrac{1}{n}\sum_{k=1}^n x_{k, i} (XP)_{k, j}\\
&=& \dfrac{1}{n}\sum_{k=1}^n x_{k, i} \left(\sum_{a=1}^px_{k, a}P_{a, j}\right)\\
&=& \dfrac{1}{n}\sum_{a=1}^p\sum_{k=1}^n x_{k, i} x_{k, a}P_{a, j}\\
&=& \sum_{a=1}^p\left(\dfrac{1}{n}\sum_{k=1}^n x_{k, i} x_{k, a}\right)P_{a, j}\\
&=& \sum_{a=1}^pA_{i, a}P_{a, j}\\
&=& (AP)_{i, j}\\
&=& (PD)_{i, j}\\
&=& \sum_{a=1}^pP_{i, a}D_{a, j}\\
&=& P_{i, j}D_{j, j}\\
&=& \lambda_j P_{i, j}\\
\end{eqnarray*}
Ainsi \( corr(c_i, d_j)=\dfrac{cov(c_i, d_j)}{\sigma_{c_i}\sigma_{d_j}}=\dfrac{\lambda_j P_{i, j}}{\sqrt{\lambda_j}}=\sqrt{\lambda_j}P_{i, j}\)
Définition
Soient \( X\in\mathcal{Mat}_{n, p}(\R)\) une matrice des données de ligne \( (\overrightarrow{e}_{k})_{k\in [\![1 ; n]\!]}\) , \( \mathcal{B}=\{\overrightarrow{v}_1, \ldots, \overrightarrow{v}_p\}\) une base orthonormale de vecteur propre de \( A=\dfrac{1}{n}{\vphantom{X}}^{t}{X}X\) et \( V_i={\texttt{Vect}}\left(\overrightarrow{v}_i \right)\) les axes factoriels.
On appel cercle des corrélations suivant les axes \( V_i\) et \( V_j\) la représentation des vecteurs \( \begin{pmatrix}
\alpha_{i, j}(\overrightarrow{e}_{k})\\
\beta_{i, j}(\overrightarrow{e}_{k})
\end{pmatrix}\) dans \( \R^2\)
L'exemple fil rouge de ce chapitre a atteint ses limites car les données sont déjà en dimension \( 2\) . Le principe du cercle des corrélation est de projeter les points sur un plan significatif. Dans notre cas, il ne s'agit (malheureusement) que d'une rotation des données
1.
Généralement, on représente les anciennes variables en dimension 2, à l'aide de ce que l'on appelle un cercle des corrélations. Plus précisément, on choisit deux axes \( E_j \) et \( E_k \) , et l'on trace les points dont
les coordonnées sont les corrélations de chacune des variables avec les \( j \) ème et \( k \) ème composantes.
principales.
Remarque
\( \bullet\) Plus une variable est proche du cercle de corrélation, mieux elle est représentée par le plan
considérée.
\( \bullet\) Si deux variables proches du cercle de corrélation (et donc bien représentées dans le plan
considéré) sont proches l'une de l'autre, alors elles sont elle-mêmes fortement corrélées positivement.
\( \bullet\) Inversement, deux variables proches du cercle de corrélation mais symétriquement opposées par rapport à l'origine seront fortement corrélées négativement.
1On peut démontrer que les changements de base orthogonales dans \( \R^2\) sont soient des rotations soient des symétries.