Suites et matrices Méthode

Calculer la distribution à l’étape n d’une chaîne de Markov

Durée estimée
10 minutes
Votre progression

Créez un compte gratuit pour suivre votre avancement et reprendre où vous avez laissé.

Créer un compte

Méthode

Soit $ P $ la matrice de transition d'une chaîne de Markov et $ X_0 $ la distribution initiale (matrice ligne).

Pour calculer la distribution $ X_n $ à l'étape $ n $ :

  1. Étape 1 : écrire la distribution initiale $ X_0 $ comme une matrice ligne dont les coefficients somment à $ 1 $.
  2. Étape 2 : pour un $ n $ petit, calculer par itération successive : $ X_1 = X_0\,P $, puis $ X_2 = X_1\,P $, etc. Chaque coefficient s'obtient par produit ligne par colonne.
  3. Étape 3 : pour un $ n $ quelconque, utiliser $ X_n = X_0\,P^n $. Calculer $ P^n $ (par conjecture et récurrence, ou avec la calculatrice), puis effectuer le produit final.

Remarque

Le coefficient en position $ \left(i, j\right) $ de $ P^n $ représente la probabilité de passer de l'état $ E_i $ à l'état $ E_j $ en exactement $ n $ étapes. Cette interprétation permet de répondre directement à des questions du type « quelle est la probabilité d'être dans tel état au bout de $ n $ étapes en partant de tel état ? » sans repasser par la distribution.

À chaque étape, la somme des coefficients de $ X_n $ doit rester égale à $ 1 $ : c'est un moyen rapide de détecter une erreur de calcul.

Itération directe sur 2 étapes

On considère la matrice $ P = \begin{pmatrix} 0{,}8 & 0{,}2 \\ 0{,}5 & 0{,}5 \end{pmatrix} $ et $ X_0 = \begin{pmatrix} 1 & 0 \end{pmatrix} $ (l'individu est dans l'état $ E_1 $ à l'instant $ 0 $).

Étape 1 : $ X_0 = \begin{pmatrix} 1 & 0 \end{pmatrix} $, somme $ 1 $ : valide.

Étape 2 : calcul de $ X_1 = X_0\,P $.

$ X_1 = \begin{pmatrix} 1 & 0 \end{pmatrix} \begin{pmatrix} 0{,}8 & 0{,}2 \\ 0{,}5 & 0{,}5 \end{pmatrix} = \begin{pmatrix} 1 \times 0{,}8 + 0 \times 0{,}5 & 1 \times 0{,}2 + 0 \times 0{,}5 \end{pmatrix} = \begin{pmatrix} 0{,}8 & 0{,}2 \end{pmatrix} $

Calcul de $ X_2 = X_1\,P $.

$ X_2 = \begin{pmatrix} 0{,}8 & 0{,}2 \end{pmatrix} \begin{pmatrix} 0{,}8 & 0{,}2 \\ 0{,}5 & 0{,}5 \end{pmatrix} = \begin{pmatrix} 0{,}8 \times 0{,}8 + 0{,}2 \times 0{,}5 & 0{,}8 \times 0{,}2 + 0{,}2 \times 0{,}5 \end{pmatrix} $

Détail : $ 0{,}64 + 0{,}1 = 0{,}74 $ et $ 0{,}16 + 0{,}1 = 0{,}26 $.

D'où $ X_2 = \begin{pmatrix} 0{,}74 & 0{,}26 \end{pmatrix} $. Vérification : $ 0{,}74 + 0{,}26 = 1 $.

À l'étape $ 2 $, l'individu est dans l'état $ E_1 $ avec probabilité $ 0{,}74 $.

Calcul via $ P^n $ (matrice diagonale)

On considère la matrice $ P = \begin{pmatrix} 0{,}9 & 0{,}1 \\ 0 & 1 \end{pmatrix} $ (dite « absorbante » : depuis $ E_2 $, on reste en $ E_2 $) et $ X_0 = \begin{pmatrix} 1 & 0 \end{pmatrix} $.

On admet que pour tout $ n \geqslant 1 $ :

$ P^n = \begin{pmatrix} 0{,}9^n & 1 - 0{,}9^n \\ 0 & 1 \end{pmatrix} $

(résultat à conjecturer puis à démontrer par récurrence — voir la méthode sur les puissances de matrices).

Étape 3 : $ X_n = X_0\,P^n = \begin{pmatrix} 1 & 0 \end{pmatrix} \begin{pmatrix} 0{,}9^n & 1 - 0{,}9^n \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 0{,}9^n & 1 - 0{,}9^n \end{pmatrix} $.

Pour $ n = 10 $ : $ 0{,}9^{10} \approx 0{,}349 $, donc $ X_{10} \approx \begin{pmatrix} 0{,}349 & 0{,}651 \end{pmatrix} $.

À long terme, $ 0{,}9^n \to 0 $ donc $ X_n \to \begin{pmatrix} 0 & 1 \end{pmatrix} $ : l'individu finit toujours dans l'état $ E_2 $.

Attention

Erreurs fréquentes :

  • inverser l'ordre du produit et écrire $ X_{n+1} = P\,X_n $ : avec la convention « ligne = départ », c'est $ X_n\,P $ (matrice ligne à gauche, matrice carrée à droite) ;
  • transposer $ X_0 $ en matrice colonne : la formule $ X_{n+1} = X_n\,P $ exige une matrice ligne ;
  • multiplier $ X_0 $ par $ P $ pour calculer $ X_2 $ au lieu d'utiliser $ X_1 $ : il faut itérer ;
  • oublier de vérifier que les coefficients somment à $ 1 $ après chaque calcul : un écart révèle une erreur.

Pour s'entraîner