{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# **
Décision dans l'incertain
**\n", "\n", "##
Le calcul du prix d'une option \"américaine\"
\n", "$\\newcommand\\indi[1]{{\\mathbf 1}_{\\displaystyle #1}}$\n", "$\\newcommand\\inde[1]{{\\mathbf 1}_{\\displaystyle\\left\\{ #1 \\right\\}}}$\n", "$\\newcommand{\\ind}{\\inde}$\n", "$\\newcommand\\E{{\\mathbf E}}$\n", "$\\newcommand\\Cov{{\\mathrm Cov}}$\n", "$\\newcommand\\Var{{\\mathrm Var}}$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Le cas européen (calcul d'espérance)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On considère le modèle de Cox-Ross:\n", "$$\n", "X_0=x_0, X_{n+1}= X_{n} \\left(d\\inde{U_{n+1}=P}+u\\inde{U_{n+1}=F}\\right).\n", "$$\n", "On choisit les valeurs numériques de la façon suivante\n", "$$\n", " x_0=100, r_0=0,1, \\sigma=0,3.\n", "$$\n", "et l'on définit $p$, $r$, $u$ et $d$ en fonction de $N$ de la façon suivante~:\n", "$$\n", "p=1/2,\\;r=r_0/N,\\;u=1+\\frac{\\sigma}{\\sqrt{N}}\\; \\mbox{ et }\\; d=1-\\frac{\\sigma}{\\sqrt{N}}.\n", "$$\n", "On cherche à évaluer $\\E(f(N,X_N))$ où \n", "$$\n", " f(N,x)=\\frac{1}{(1+r)^N}\\max(K-x,0),\n", "$$\n", "avec $K=x_0=100$ et $r=0,05$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 1.1.__ Calculer ces prix d'options européennes (call et put) se ramène\n", " à des calculs d'espérance d'une fonction d'une chaîne de Markov. On\n", " implémente ici la méthode de calcul d'espérance par ''programmation\n", " dynamique''." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import math\n", "import random\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "\n", "\n", "def prix_eu(x_0,r,u,d,p,N,gain):\n", "# Calcul du prix européen à l'instant 0\n", "\n", " U=np.zeros([N+1,N+1])\n", " # U[n,k] = u(n,x^n_k) avec x^n_k = x_0 * u**k * d**(n-k)\n", " \n", " # la condition finale en N\n", " for k in range(0,N+1): # range(0,N+1) = 0,1,2 ... , N\n", " U[N,k] = gain(x_0 * u**k * d**(N-k))/(1+r)**N;\n", " #le temps décroît de N-1 à 0\n", " for n in range(N-1,-1,-1): # range(N-1,-1,-1) = {N-1,N-2,...,0} !\n", " for k in range(n+1):\n", " # écrire l'équation de programmation dynamique\n", " # U[n,k] = u(n,x^n_k) avec x^n_k = x_0 * u**k * d**(n-k)\n", " \n", " ###### A vous de jouer .....\n", "\n", " return U[0,0]\n", "\n", "def prix_eu_n(n,x_0,r,u,d,p,N,gain):\n", "# Calcul du prix a l'instant n\n", "\n", " # Pour calculer ce prix on ne change rien si ce n'est N en N-n\n", " return prix_eu(x_0,r,u,d,p,N-n,gain)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " On peut vérifier que lorsque $p=1/2$ (ou $r=0$) et $K=x_0$ le prix\n", " des puts et des calls coïncident. On le vérifie.\n", " \n", " Pour le choix classique\n", " $p=(1+r-d)/(u-d)$ (et $r\\not=0$), les prix sont différents, ce que\n", " l'on vérifie aussi." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def main_1():\n", " r_0=0.05;sigma=0.3;\n", " N=50;\n", " d=1-sigma/math.sqrt(N);u=1+sigma/math.sqrt(N);\n", " r=r_0/N;\n", "\n", " x_0=100;K=100;\n", "\n", " # Lorsque p=1/2 et K=x_0 le prix du call = le prix du put (exercice!)\n", " p=1/2;K=x_0;\n", " \n", " def gain_put(x): return max(K-x,0) # Payoff du put \n", " def gain_call(x): return max(x-K,0) # Payoff du call \n", "\n", " p_put = prix_eu_n(0,x_0,r,u,d,p,N,gain_put);\n", " p_call = prix_eu_n(0,x_0,r,u,d,p,N,gain_call);\n", " if (abs(p_put - p_call) >= 0.000001) :\n", " print(\"WARNING: ces deux prix devrait coincider: \",p_put,\" <> \",p_call)\n", " else:\n", " print(\"Les deux prix coincident: \",p_put,\" <> \",p_call,end='')\n", " print(\". Parfait!\");\n", "\n", " p= (1+r-d)/(u-d)\n", " print(\"Prix du call : \",prix_eu_n(0,x_0,r,u,d,p,N,gain_call))\n", " print(\"Prix du put : \",prix_eu_n(0,x_0,r,u,d,p,N,gain_put))" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Les deux prix coincident: 11.402142946815882 <> 11.40214294681589. Parfait!\n", "Prix du call : 14.285050131985198\n", "Prix du put : 9.410369101110671\n" ] } ], "source": [ "main_1()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Le cas américain (arrêt optimal)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On s'intéresse au cas d'un option américaine qui promet (en valeur actualisée en $0$), si on l'exerce à l'instant $n$\n", "pour une valeur de $X_n$ valant $x$, une valeur $f(n,x)$\n", "$$\n", " f(n,x) = \\frac{1}{(1+r)^n}\\max(K-x,0).\n", "$$\n", "On cherche à calculer son prix donné par \n", "$$\n", "u(0,x_0)=\\sup_{\\tau \\mbox{ t.a.} \\leq N} \\E(f(\\tau,X_\\tau)).\n", "$$\n", "On sait (voir le cours) que $u$ se calcule grace à l'équation de programmation dynamique suivante\n", " \\begin{equation}\\label{eq:rec} \n", " \\left\\{\n", " \\begin{array}{l}\n", " u(n,x) = \\displaystyle \\max\\left[p u(n+1,xu)+(1-p) u(n+1,xd),\\frac{1}{(1+r)^n}(K-x)_+\\right], n 8.461120344261218. C'est parfait!\n" ] } ], "source": [ "def main_2():\n", " sigma=0.3; r_0=0.1;\n", " K=100;x_0=100;\n", "\n", " N=10;\n", " r=r_0/N;\n", " d=1-sigma/math.sqrt(N);\n", " u=1+sigma/math.sqrt(N);\n", " p= (1+r-d)/(u-d);#p=1/2;\n", " \n", " def gain_put(x): return max(K-x,0) # Payoff du put \n", " def gain_call(x): return max(x-K,0) # Payoff du call \n", "\n", " prix_am(x_0,r,u,d,p,N,gain_put)\n", " prix_slow_am(x_0,r,u,d,p,N,gain_put)\n", "\n", " # Les deux algos font ils le même chose ?\n", " # on verifie : prix_slow(x_0,N) \\approx prix(x_0,N)\n", " p1=prix_slow_am(x_0,r,u,d,p,N,gain_put);\n", " p2=prix_am(x_0,r,u,d,p,N,gain_put);\n", " print(\"Ces deux prix devrait coincider (ou presque) : \",p1,\" <> \",p2,end='');\n", " if (abs(p1 - p2) >= 0.00001):\n", " print(\"WARNING: ces deux prix devrait coincider : \",p1,\" <> \",p2);\n", " else:\n", " print(\". C'est parfait!\")\n", "\n", " N=1000;d=1-sigma/math.sqrt(N);u=1+sigma/math.sqrt(N);\n", " prix_am(x_0,r,u,d,p,N,gain_put)\n", "\n", "main_2()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " __Question 2.5.__ Tracer les courbes de prix américaines et européennes $x\\to v(0,x)$ pour $x\\in [80,120]$ et les\n", " supperposer au \"payoff\".\n", " \n", " On constate que le prix est toujours plus grand que le prix européen et que le gain immédiat." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3XdcleX/x/HXxQYHS9wD90JABMSNe6a5d87UzNSv7TLTbH/9tdRKc1umWe60NEc5UsG9Nwq5EFkqIOP6/XHQrybIUQ4cOHyejwcPOOfc43N38s3Nde77cymtNUIIIfI/K3MXIIQQwjQk0IUQwkJIoAshhIWQQBdCCAshgS6EEBZCAl0IISyEBLoQQlgICXQhhLAQEuhCCGEhbHJzZ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IISyEBLoQQlgICXQhhLAQ/w8Mcb6Lz2J+TQAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt;\n", "\n", "def main_3():\n", " # tracé de courbes\n", " N=50\n", " sigma=0.3\n", " p=1/2;d=1-sigma/math.sqrt(N);u=1+sigma/math.sqrt(N);\n", " K=100;x_0=100;\n", " r_0=0.1;\n", " r=r_0/N;\n", "\n", " def gain_put(x): return max(K-x,0) # Payoff du put \n", " def gain_call(x): return max(x-K,0) # Payoff du call \n", " \n", " vmin=50;\n", " vmax=150; \n", " courbe_am=np.zeros(vmax-vmin+1)\n", " courbe_eu=np.zeros(vmax-vmin+1)\n", " obstacle=np.zeros(vmax-vmin+1)\n", "\n", " n=0;\n", " x=range(vmin,vmax+1,1)\n", " for current_x in x:\n", " #courbe_am[n]= le prix américain en current_x\n", " #courbe_eu[n]= le prix européen en current_x\n", " #obstacle[n] = l'obstacle en current_x\n", " \n", " ###### A vous de jouer .....\n", "\n", " n=n+1; \n", " \n", " # On compare les courbes \"Américaines\" et \"Européennes\"\n", " plt.plot(x,courbe_eu,label='Prix \"européen\"')\n", " plt.plot(x,obstacle,label='Obstacle')\n", " plt.plot(x,courbe_am,color='red',label='Prix \"américain\"')\n", " plt.legend(loc='upper right')\n", "\n", "main_3()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 2.6.__ Regardez comment le prix évolue au fils du temps~: tracez les\n", " courbes $x\\to v(n,x)$, pour $n=0,2,5,20,50$. Ce prix est égal à $(K-x)_+$ en zéro, il croit avec $n$." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuM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II=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt\n", "\n", "def main_4():\n", " sigma=0.3;\n", " K=100;x_0=100;\n", "\n", " N=50;\n", " p=1/2;d=1-sigma/math.sqrt(N);u=1+sigma/math.sqrt(N);\n", " r_0=0.1;r=r_0/N;\n", "\n", " def gain_put(x): return max(K-x,0) # Payoff du put \n", " def gain_call(x): return max(x-K,0) # Payoff du call \n", "\n", " vmin=50;vmax=150;\n", " # évolution de la courbe en fonction de n\n", " liste=[0,2,5,20,50]\n", " courbe_am=np.zeros([np.size(liste),vmax-vmin+1])\n", " index_n=0\n", " x=range(vmin,vmax+1,1)\n", " for N in liste:\n", " i=0;\n", " # construction de la courbe de prix si l'echéance est N\n", " for current_x in x:\n", " \n", " # courbe_am[index_n,i] = prix du put en current_x si l'echéance est N\n", " \n", " ###### A vous de jouer .....\n", "\n", " i=i+1\n", " index_n=index_n+1\n", " \n", " for n in range(index_n):\n", " text='n = '+str(liste[n])\n", " plt.plot(x,courbe_am[n,:],label=text)\n", " plt.legend(loc='upper right')\n", " \n", "main_4()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 2.7__ Que constatez vous lorsque $N$ augmente ($N=10,100,200,500$) et\n", " que l'on choisit $r$, $u$ et $d$ en fonction de $N$ comme définis\n", " plus haut ($r=r_0/N$, $d=1-\\sigma/\\sqrt{N}$, $u=1+\\sigma/\\sqrt{N}$).\n", " \n", "__Commentaire:__ lorsque $N$ tend vers $+\\infty$ dans ces\n", " conditions, les prix convergent vers le prix d'un modèle continu (le\n", " célèbre modèle de Black et Scholes). Dans le cas européen, le\n", " résultat se prouve grâce au théorème de la limite centrale (cours \n", " du premier semestre). Dans le cas américain qui nous intéresse, c'est \n", " plus compliqué, mais ca reste vrai !" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAY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FgNnoOut5jJ9T/R5BBdV/qSee7XWl+p/is4D9wC6qVwAZfgw2OuYUqvvGO6w/79TY/ynrMScBg42u31bH/IfbDwFBzvQ61/yRT4oKIYSTkJaLEEI4CQl0IYRwEhLoQgjhJCTQhRDCSUigCyGEk5BAF0IIJyGBLoQQTkICXQghnMT/A7/kq21gXejzAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "def main_5():\n", " # Avec cet algorithme on peut augmenter N\n", " # mais il faut renormaliser convenablement u et d pour obtenir une convergence.\n", " # Essayer avec N=10,100,200,...,1000\n", "\n", " sigma=0.3\n", " K=100\n", " x_0=100\n", " r_0=0.1\n", " p=1/2\n", " N=50\n", "\n", " def gain_put(x): return max(K-x,0) # Payoff du put \n", "\n", " vmin=50;vmax=150;\n", " courbe=np.zeros(vmax-vmin+1)\n", " x=range(vmin,vmax+1,1)\n", " for N in [2,5,20,100]:\n", " # Une renormalisation convenable\n", " # pour converger vers un modèle de Black et Scholes\n", " r=r_0/N;\n", " d=1-sigma/math.sqrt(N);\n", " u=1+sigma/math.sqrt(N);\n", " n=0;\n", " for current_x in x:\n", " text='N = '+str(N)\n", " \n", " # courbe[n]= prix américain avec les paramètres r,d,u\n", "\n", " ###### A vous de jouer .....\n", "\n", " n=n+1; \n", " plt.plot(x,courbe,label=text);\n", " plt.legend(loc='upper right')\n", "\n", "main_5()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Simulation selon la loi du temps optimal" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On va chercher à se faire une idée du temps d'exercice optimal en simulant sa loi. On verra que cette loi a des formes variées en fonction de la valeur initiale." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 2.8__ Ecrire une fonction qui simule le vecteur\n", " $(Bin(0),Bin(1),\\ldots,Bin(N))$ du nombre de piles cumulé successif dans des $N$\n", " tirages à pile ou face $(p,1-p)$. Par convention $Bin(0)=0$.\n", "\n", " Le vecteur $Bin$ permet d'exprimer $X(n)$, la valeur en $n$ du modèle de Cox-Ross, sous la forme:\n", " $$\n", " X(n)=x_0 u^{Bin(n)} d^{n-Bin(n)}.\n", " $$" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0 1 1 2 3 4]\n" ] } ], "source": [ "def simul_bin(N,p):\n", "# sommes partielles du nombre de tirages \"up\" (=u) \n", "# dans N tirages à pile ou face (p,1-p)\n", "\n", " unif=np.random.rand(N+1) # N+1 tirages uniformes dans [0,1], on n'utilise pas le tirage \"0\"\n", " Bin=np.zeros(N+1,dtype=int) \n", " # Bin(0)=0, on commence donc a n=1 \n", " for n in range(1,N+1):# range(1,N+1) = 1, ..., N\n", " # tirages a pile ou face (p,1-p)\n", " \n", " # On cumule des tirages de Bernouilli successifs\n", "\n", " ###### A vous de jouer .....\n", "\n", " return Bin;\n", "\n", "# simul_bin(5,1/2) est un vecteur de dimension 6 : Bin(0),...,Bin(5). Bin(0) vaut toujours 0.\n", "print(simul_bin(5,1/2))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 2.9__ Calculer la prix américain en conservant dans un vecteur $V(n,k)$ les valeurs en l'instant $n$ et au point $X[k]=x_0 u^{k} d^{n-k}$. $k$ varie de $0$ à $n$. Il suffit de modifier legérement l'algorithme de la __question 2.3__ en stockant les valeurs." ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [], "source": [ "def prix_am_vect(x_0,r,u,d,p,N,gain):\n", "# On calcule les valeurs de \"v(n,x)\" (voir question précédente)\n", "# mais, ici, on les conserve dans un vecteur \"V\"\n", "# ce qui évitera d'avoir à les re-calculer un grand \n", "# nombre de fois lors des simulations.\n", " V=np.zeros([N+1,N+1])\n", " for k in range(N+1):\n", " x=x_0 * u**k * d**(N-k) # le point de calcul\n", " V[N,k]=gain(x) # Valeur de U en N\n", "\n", " for n in range(N-1,-1,-1): # le temps decroit de N-1 a 0\n", " for k in range(n+1): # k varie de 0 a n\n", " x = x_0 * u**k * d**(n-k) # le point de calcul\n", " \n", " # V[n,k]= ...\n", "\n", " ###### A vous de jouer .....\n", "\n", " return V" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 2.10__ A partir d'une trajectoire du modèle de Cox-Ross donnée par le vecteur\n", " $Bin$ et des valeurs de $V$ précédemment calculées, évaluer le\n", " temps d'arrêt optimal associé à cette trajectoire. \n", " \n", " Pour des raisons techniques, on est obligé de rajouter \"& (gain_immediat > 0)\" à la condition \n", " d'exercice classique (le gain immediat = la valeur courrante de $v$). Cette condition est naturelle, \n", " puisque si le gain immédiat est nul, on n'a aucun intérêt à exercer en cet instant, bien sûr." ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [], "source": [ "def temps_optimal_option(x_0,u,d,Bin,V,gain):\n", " # Bin est la somme cumulée de tirages de Bernouilli indépendants\n", " # Calcule le temps d'arrêt optimal associé à la trajectoire \n", " # (X(0),X(1),...,X(N)) où X(n) = x_0 * u**Bin(n) * d**(n-Bin(n))\n", "\n", " for n in range(np.size(Bin)):\n", " x_n=x_0 * u**Bin[n] * d**(n-Bin[n]) # Valeur de X(n) pour ce tirage\n", " Valeur = V[n,Bin[n]] # Calcul de V(n,X(n)) que l'on a pre-calculé\n", " gain_immediat = gain(x_n) # le gain si on exerce en n\n", " \n", " # condition d'exercice\n", " # if (...) & (gain_immediat > 0) : return n\n", " \n", " ###### A vous de jouer .....\n", "\n", " return N" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " Voici un programme qui permet de tracer des histogrammes. " ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [], "source": [ "def histo_discret(samples, maxsize,titre):\n", "# histogramme de tirages selon une loi discrète à valeurs entières\n", "# supposé prendre des valeurs entre 0 et maxsize.\n", " size, scale = 20000, 100\n", " my_histo = pd.Series(samples)\n", " my_histo.plot.hist(grid=True, bins=maxsize+1, rwidth=2, color='#607c8e',range=[0,maxsize])\n", " plt.title(' ')\n", " plt.xlabel(titre)\n", " plt.ylabel(' ')\n", " plt.grid(axis='y', alpha=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Simuler un grand nombre de trajectoires du modèle de Cox-Ross et\n", " les valeurs des temps d'arrêt associés à ces trajectoires. Tracer\n", " un histogramme de la loi du temps d'arrêt optimal. Faire varier les\n", " valeurs de $x_0$ ($x_0=60,70,80,100,120)$) et voir l'influence de\n", " ce choix sur le loi du temps d'arrêt optimal." ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [], "source": [ "def un_test(x_0,N):\n", " # paramètres du modèle et de l'option\n", " sigma=0.3\n", " p=1/2;d=1-sigma/math.sqrt(N);u=1+sigma/math.sqrt(N)\n", " K=100\n", " r_0=0.1\n", " r=r_0/N\n", " # payoff (ou gain) de l'option put\n", " def gain_put(x): return max(K-x,0) \n", "\n", " # calcul de la fonction v\n", " V=prix_am_vect(x_0,r,u,d,p,N,gain_put)\n", "\n", " # \"Nbre\" tirages selon la loi du temps d'arrêt optimal\n", " Nbre=1000;\n", " tau=np.zeros(Nbre,dtype=int)\n", " for j in range(Nbre):\n", " \n", " # commencez par simuler des Bernouillis cumulées (voir plus haut),\n", " # puis en déduire un tirage selon la loi du temps d'arrêt optimal\n", " \n", " ###### A vous de jouer .....\n", "\n", " histo_discret(tau,N,'Temps optimal')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Expérimenter pour diverses valeurs de $x_0$. On vous suggère $x_0=K=100$, puis $x_0=60, 70, 80, 100, 120$. Vous constaterez que la loi de $\\tau$ varie considérablement." ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHR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ojyA0yf4E+Nkkp8HonX2SHz/CfbwxyaokL2L0C17/M8kZjE6EfwL4IKPpp79VVY8D30/yutb0VuBPx7r8XKtnFnisHZ18B3jxEdY27mTgiRYO/4jRkZN0VDyC0MSqqnuTvA/4kyTPA/4vo7n7I/mtgDuATzGarvlEVd3dTmJfl+QZRkciv9i531uBj7TLcO8CNo1t+3aSP2cUCPPtNwH/Lcm/BK4+gvrm/Q9G5yO+BnyD0VVspaPi1Vylg2ifBDq7qt51DPd5B/COqrr7WO1TGopTTJKkLo8gJEldHkFIkroMCElSlwEhSeoyICRJXQaEJKnr/wHwuTX7hHkSWgAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# un test simple \"at the money\" |$(K=x_0)$|\n", "N=50\n", "x_0=100;tau=un_test(x_0,N)" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEWCAYAAABxMXBSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAE89JREFUeJzt3X+w5XV93/HnS1YlsoTlR9giu+kSs9NqaaR4C0TS5C44FogTaEeoIdXFwdnJDEkxJK0k0wzGxhbHjhhnUmd2hLKm4rpBDdRqlSxcDE2gAUV+uDqs1OICZYVdlFWIEN/943w2HHcvsp+7e8/Ze8/zMXPnfL/v7+d8z+dz9+x9ne/3e87npKqQJGlfvWTcHZAkLSwGhySpi8EhSepicEiSuhgckqQuBockqYvBIUnqYnBIkroYHJKkLgaHJKmLwSFJ6mJwSJK6GBySpC4GhySpi8EhSepicEiSuhgckqQuBockqYvBIUnqYnBIkroYHJKkLkvG3YH5cMwxx9SqVavmfP/vfe97HHbYYQeuQwe5SRsvOOZJ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Hm93NOk8VaWJlWRt+86Ku5P8lyQvSbIkyZNJ3p/kS0k+n+TUJLcmebB9SJQk70jy6bb960n+fasfnuRz7Xsw7kvy5lke9+T2HRH3JPlkkiNa/bYkH0zyV+07FqaSvAp4B/BvWz9fn+QPk7xz6D4fSPIXSb7a7vPp9l0M7x56zP/eJsK7P8k7RvDr1SJmcGgiJTkR+BfA66vqJAZH329pm48AvlBVJwM/AN4NnAmcD7xnaDentPucDFyY5CTgHOCbVfXaqjqRway0e/pvDL4f5OeArwO/P7Tt5VX18wy+V+IjVfUNBtOEv79958JfzrK/p6vqnzGYVuXPgF8H/jGwbve0I8Daqnod8E+By+bjy300OQwOTao3MPgjemebevyXgFe1bU9X1e4/+PcCM21q7nuBVUP7+HxV7ayq7zH4g/0LwD0MvjTpyiSnV9V3hh+0XXM5tKpua6UNwC8ONfk4QFXdDBzbZvR9MbvnVLsXuLeqHquqZ4BvMpjYD+C3knwF+KtWe9Vee5H2kdc4NKnCYD6y3/+R4mAm1eEL5j9k8G16u5eH/8/sOV9PVdWWJFMMjjzen+QzVfUf93jcH2evfb5Ie/bo3/A8TD8EliR5A4NwOq2qnk5yG3DoPuxXmpVHHJpUfw5ckOQYGBwJJPnpzn28McmyJK9g8K1r/yvJ8QwuwP8J8AEGp7H+TlU9Djyd5PWt9Fbg1qEm/6r1Zxp4rB3NPAUc3tm3YUcAO1po/CMGR1rSnHnEoYlUVfcm+QPgz5O8BHiWwbWBnu9ruA24jsFpnz+pqrvbxfMrk/yQwZHLr89yv7cCH27TnW8F3j607btJ/pJBUOyu3wD8aZJ/CVzS0b/d/geD6x1fAb7GYFZgac6cHVeag/bOpBOr6p0HcJ+3Ab9RVXcfqH1K88FTVZKkLh5xSJK6eMQhSepicEiSuhgckqQuBockqYvBIUnq8v8BtYUBVAZgJyoAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ " N=50\n", " x_0=60;tau=un_test(x_0,N) # lorsque x_0 << K, on exerce toujours en 0" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFCFJREFUeJzt3X+QXWd93/H3B5tC43WxHaOtf6VLGbWDcYOwt46L02ZlU2KcTAwd7Bq3juzAKJkxHSC0qWHqwYnr1hkSO80k8YyCASX82LiAY9WBglEQxE0MSI5ANooHhahEkUYqwcYWUFLb3/5xz4Zr8ejHrvbu3b33/ZrZufc89znnfB97tZ/7nHPuuakqJEk61HOGXYAkaXkyICRJTQaEJKnJgJAkNRkQkqQmA0KS1GRASJKaDAhJUpMBIUlqMiAkSU0GhCSpyYCQJDUZEJKkJgNCktRkQEiSmgwISVKTASFJajIgJElNBoQkqcmAkCQ1GRCSpKYTh13A8Tj99NNrampqQet+61vf4qSTTlrcgpY5xzweHPN4OJ4xb9u27etV9cKj9VvRATE1NcXWrVsXtO6WLVuYmZlZ3IKWOcc8HhzzeDieMSf538fSz0NMkqQmA0KS1GRASJKaDAhJUpMBIUlqMiAkSU0GhCSpyYCQJDUZEJKkphX9SeqldP1NdzTb33vLW5e4EklaGs4gJElNAwuIJOck+XSSnUkeSfLmrv3mJH+VZHv3c3nfOm9PsivJo0l+fFC1SZKObpCHmJ4C3lZVDyU5GdiW5P7utTuq6lf6Oyc5F7gaeClwJvCpJP+oqp4eYI2SpMMY2AyiqvZV1UPd8yeBncBZR1jlCmC2qr5bVX8B7AIuHFR9kqQjS1UNfifJFPBZ4Dzg54HrgCeArfRmGY8l+Q3gwap6f7fOXcDHq+rDh2xrPbAeYHJy8oLZ2dkF1XTw4EEmJiaOuf/uvQea7VNnrlrQ/odhvmMeBY55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/fS+n+KHgUeBm/pee15V/TN632vw7qr6c3q3r35Xd8//P25s7ztV9c/p3U7k94GfA/4JsH7udhvAuqq6APinwM8P4ktkND4MCI26V9L7Y7m1uyX2jwEv7l77TlXN/WHfAWzpbhm9A5jq28YnquqxqvoWvT/MPwp8id6X89yW5OKq+mb/TrtzIs+vqge6po3Av+jr8iGAqvpDYFV3B9qjmbtn2A5gR1Xtr6r/C+ymd4M6gLcm+SLwJ13bi79vK9Ix8hyERl3o3W/rpmc19u782X/i+hl6384297z/38ah96OpqtqZZJreTOJdSe6rqv9yyH6P5Pu2eZT+HFJf/32GngFOTPJKeiF0UVV9J8kDwPOPYbtSkzMIjbpPAVclOR167+yT/NA8t/GqJKck+QF63+L1v5KcRe9E+O8Ct9M7/PS3qurrwHeSvKJruhb4TF+Xf93VMwPs72YnTwInz7O2fi8AvtGFw0vpzZykBXMGoZFWVTuS/CLwqSTPAf4fvWP38/m+gAeAD9I7XPO7VbW9O4l9W5Jn6M1Efq6x3rXAnd1tuHcB1/e99kSSP6YXCHPt9wL/Pcm/Am6YR31z/oDe+YgvAn9G7y620oJ5N1fpCLorgc6rqrcs4jYfAN5UVdsXa5vSIHiISZLU5AxCktTkDEKS1GRASJKaDAhJUpMBIUlqMiAkSU3/H8nCfAzPPs54AAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ " N=50\n", " x_0=70;tau=un_test(x_0,N) # on augmente x_0, on n'exerce plus (jamais) en 0" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFflJREFUeJzt3X+w5X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_background": "light" }, "output_type": "display_data" } ], "source": [ "N=50\n", "x_0=80;tau=un_test(x_0,N) # On exerce de plus en plus tard ..." ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAE+RJREFUeJzt3X/sXXd93/HnixhIE4c4weBFsTszsKawrOTHdyEj3bBjhkKKmmxKNroOPCvIqhQkKO1GWi0qdO0WxIQZEkOzCKthgMmgabIMRlMn39KsDcWGkB8EFJNlmeUoXhoHML+6wHt/3M+3fOd8/Otrn++Pe58P6at7zud8zrmfd3J9X/ecc8+5qSokSTrU8xZ6AJKkxcmAkCR1GRCSpC4DQpLUZUBIkroMCElSlwEhSeoyICRJXQaEJKnLgJAkdRkQkqQuA0KS1GVASJK6DAhJUpcBIUnqMiAkSV0GhCSpy4CQJHUZEJKkLgNCktRlQEiSupYt9ABOxMqVK2vt2rVzWvd73/sep59++skd0CJnzZPBmifDidS8e/fup6rqJUfrt6QDYu3atezatWtO605PT7N+/fqTO6BFzpongzVPhhOpOcn/OpZ+HmKSJHUZEJKkLgNCktRlQEiSugYNiCSPJXkgyX1JdrW2s5PcmeSR9nhWa0+SDybZk+T+JBcNOTZJ0pHNxx7Ehqq6oKqm2vwNwM6qWgfsbPMAbwDWtb8twIfnYWySpMNYiENMVwHb2/R24OpZ7R+rkXuBFUnOWYDxSZKAVNVwG0/+J3AAKOA/VtW2JM9U1YpZfQ5U1VlJ7gBuqqp7WvtO4F1VteuQbW5htIfBqlWrLt6xY8ecxnbw4EGWL18+p3WXKmueDNY8GU6k5g0bNuyedVTnsIa+UO6yqtqX5KXAnUm+cYS+6bQ9J72qahuwDWBqaqrme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/g7wziF+QEaTxYDQOHsdozfLXe2W2K8FXt6W/aCqZt7YHwCm2+2iHwDWztrGF6rqQFV9j9Eb888D9zP6cZ6bklxWVd+e/aTtnMipVXVPa9oO/P1ZXT4FUFV3AS9td6A9mpn7hT0APFBVT1bVD4HHGN2cDuBXk3wN+LPW9vLnbEU6Dp6D0DgLo3tt3fj/NY7u+jn7xPVPGP0628z07H8Xh96Lpqrq4SRTjPYk3pfkjqr6N4c875E8Z5tH6c8h45t9j6GfAMuSvI5RCF1aVT9Icg9w6jFsVzos9yA0zv4I+MdJVsLok32Snz3Obbw+yYokpzH6Ba//keRcRifCPw68n9Hhp79SVU8BP0jymtb0ZuCPZ3X5J20864En297Jd4EzjnNss50JPN3C4W8x2nOSToh7EBpbVfVAkvcAf5TkecD/ZXTs/nh+K+Ae4JOMDtd8vKruayexb0ryE0Z7Ir/SWe/NwIfbbbj3AJtnLftOkj9lFAgz7bcB/yXJPwKuP47xzfhvjM5HfA34BqO72EonxLu5SofRvgl0flW94yRu8x7gbVV138napjQUDzFJkrrcg5AkdbkHIUnqMiAkSV0GhCSpy4CQJHUZEJKkrv8HB6sxWkjnMPMAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "N=50\n", "x_0=100;tau=un_test(x_0,N)" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFqhJREFUeJzt3X+QXWd93/H3B4sfMcLItmDrsZyKEg01dYN/bI2D07CyCGM7DHI7uIWmsNWYUTNjMhCS1iZTTyBNWjPJIGCaeqrBNIICwjVxrLokxBFs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tm3fetJH/BKBBmxm8F/muSfwxcfQz1zfjvjF6P+DzwZUZXsZWeEq/mKh1CeyfQOVX1luO4zzuAN1XV3cdrn9JQPMUkSeryCEKS1OURhCSpy4CQJHUZEJKkLgNCktRlQEiSuv4fnNpeZvFdZHsAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "N=50\n", "x_0=120;tau=un_test(x_0,N) # Le plus souvent en N" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " __Question 2.11__ Le cas du call (l'option dont le gain instantané vaut $(x-K)_+$) est très particulier. On peut montrer que dans ce cas, l'option ne s'exerce qu'à échéance. On le vérifie, ici, par simulation." ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [], "source": [ "# Teste le cas du call (x-K)_+\n", "# qui ne s'exerce jamais avant l'écheance N.\n", "# Le fait que le prix eu du call soit toujours plus grand \n", "# que l'obstacle permet de le prouver rigoureusement (pourquoi?).\n", " \n", "def main_8():\n", " sigma=0.3; r_0=0.1\n", " K=100;x_0=100\n", " N=50\n", " r=r_0/N\n", " u=(1+r)*math.exp(sigma/math.sqrt(N));d=(1+r)*math.exp(-sigma/math.sqrt(N))\n", " p=1/2; #p= (1+r-d)/(u-d); # en principe pour Cox-Ross\n", " \n", " def gain_call(x): return max(x-K,0) # Payoff du call \n", " \n", " V_call=prix_am_vect(x_0,r,u,d,p,N,gain_call)\n", " Nbre=1000\n", " tau=np.zeros(Nbre)\n", " for j in range(Nbre):\n", " Bin=simul_bin(N,p)\n", " tau[j]=temps_optimal_option(x_0,u,d,Bin,V_call,gain_call)\n", " histo_discret(tau,N,'Temps optimal')" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEWCAYAAABxMXBSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAb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JVsLgTCDJj3Ue43VJViQ5jsG3rv3PJKczuAH/h8B7GFzG+jtV9RjwVJLXtKY3AX821OVftPFMA4+2s5lvAS/rHNuwE4HHW2j8QwZnWtK8ecahiVRVu5L8DvCnSV4E/A2DewM939dwJ/BHDC77/GFV3dtunl+f5PsMzlx+ZY793gS8v013vge4fGjbN5P8BYOgmG2/BfjjJP8MuLJjfLP+O4P7HV8EvsxgVmBp3pwdV5qH9s6kM6vqrUfxmHcCv1pV9x6tY0oLwUtVkqQunnFIkrp4xiFJ6mJwSJK6GBySpC4GhySpi8EhSery/wGeZO42sPssQgAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "main_8() # un call sans dividende s'exerce toujours à l'instant N" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 2.12__ Probabilité d'exercice anticipé." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " Évaluer la probabilité d'exercice anticipé (i.e. $\\P(\\tau < N)$,\n", " si $\\tau$ est le temps d'arrêt optimal. Vérifier par simulation que\n", " cette probabilité est strictement positive (pour le put). Elle décroit en fonction de $x_0$." ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [], "source": [ "def compute_proba(x_0,N):\n", " # Proba que tau (K-x)_+$ si et seulement si $x>s(n)$. Autrement \n", "dit le point où $V(n,x)$ se détache de $(K-x)_+$.\n", "\n", "On doit exercer l'option lorsque $X_n < s(n)$, attendre sinon.\n", "\n", "Pour mieux comprendre, consulter le dessin correspondant à la __question 2.5__." ] }, { "cell_type": "code", "execution_count": 88, "metadata": {}, "outputs": [], "source": [ "def frontiere(N,x_0,u,d,V,gain):\n", " # Calcule la frontière d'exercice t -> s(t) t\\in[0,N]\n", " # à partir du tableau V[n,j]\n", " s=np.zeros(N+1);\n", " for n in range(N):\n", " for k in range(n+1):\n", " # Dans le cas du put, on cherche le premier point ou le prix est strictement \n", " # supérieur au gain immédiat. \n", " x=x_0*u**k *d**(n-k);\n", " \n", " ###### A vous de jouer .....\n", "\n", " # Le cas n=N est particulier (puisque V[N,j] est exactement égal à gain(x_j)),\n", " # on prolonge avec la valeur précédente pour avoir un beau dessin.\n", " s[N]=s[N-1] \n", " return s\n", "\n", "def main_10(): \n", " N=1000;\n", " r_0=0.05;r=r_0/N;\n", " sigma=0.3;\n", " K=100;\n", " x_0=60;# pour avoir un joli dessin sans artéfacts, \n", " # il est préférable de partir d'une valeur x_0 proche de la valeur de la fontière en 0.\n", " # Vous pouvez expérimenter avec d'autres valeurs plus petites et plus grande \n", " # chercher à interpréter ce qui se passe. Ce n'est pas si facile ...\n", " p=1/2;d=1-sigma/math.sqrt(N);u=1+sigma/math.sqrt(N);\n", " def gain_put(x): return max(K-x,0) # Payoff du put \n", "\n", " V=prix_am_vect(x_0,r,u,d,p,N,gain_put);\n", " front=frontiere(N,x_0,u,d,V,gain_put);\n", " plt.plot(front,label='frontière');\n", " plt.legend(loc='upper right')\n" ] }, { "cell_type": "code", "execution_count": 89, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xt8VOW97/HPL5ncEwgJAZG7FrkcRMDo9lKtFqVeWm17tC/d3ZVaW/Ro2ba7Z1ttd2u7694Ht1ovxx4trRXb+rLa2/bSeq+yt9VqQVEpyEVBCCCXQBJyn0l+549ZiQEGksxMZjKT7/v1ymuynnnWWr81C3555llrPY+5OyIikr1y0h2AiIgMLCV6EZEsp0QvIpLllOhFRLKcEr2ISJZTohcRyXJK9CIiWU6JXkQkyynRi4hkuVC6AwAYOXKkT5o0Kd1hiIhklBUrVux296re6g2KRD9p0iSWL1+e7jBER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i+qs4BXuWASdeBrknXs+VzuAO4DugMliuBOnePBMs9j6v7mIP364P6meQoYBdwf9Bd9VMzKyGLz7O7bwVuJToh0Xai520F2X2eu/T3vCb1fGdyorcYZVlzC5GZlQK/Bb7m7g2HqxqjLKM+BzP7JLDT3Vf0LI5R1fvwXqYIAXOBe9x9DtDEh1/nY8n4Yw66Hi4EJgNHAiVEuy4OlE3nuTeHOsakHnsmJ/oaYHyP5XHAtjTFklRmlkc0yT/o7r8LincEk60TvO4MyrPhczgVuMDMNgG/Itp9cwdQbmZds6D1PK7uYw7eHw7sSWXASVAD1Lj7q8Hyb4gm/mw+z2cBG919l7uHgd8Bp5Dd57lLf89rUs93Jif6vwJTgiv2+UQv6jyW5pgSZmYG3Aescfcf9njrUJOuPwZcFly9Pwmo7/qKmCnc/QZ3H+fuk4iexz+5++eBF4CLgmoHHnPXZ3FRUD+jWnru/gGwxcymBkXzgNVk8Xkm2mVzkpkVB//Ou445a89zD/09r08D881sRPBNaH5QFp90X7RI8ILHecA64F3g2+mOJ0nH9FGiX9HeAlYGP+cR7Zt8HlgfvFYE9Y3o3UfvAm8TvaMh7ceRwPGfATwR/H4U8BqwAfg1UBCUFwbLG4L3j0p33HEe62xgeXCu/xMYke3nGfg+8A6wCvgFUJBt5xl4iOg1iDDRlvkV8ZxX4EvBsW8ALk8kJj0ZKyKS5TK560ZERPpAiV5EJMsp0YuIZDklehGRLKdELyKS5ZToRUSynBK9iEiWU6IXEcly/x+Rjx1bghzlXwAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "main_10()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 3. Un problème de recrutement" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On reçoit, consécutivement, $N$ candidats à un poste. Les\n", "circonstances m'imposent de décider tout de suite du recrutement (soit\n", "on recrute la personne que l'on vient de recevoir, soit on la refuse\n", "définitivement). On cherche à maximiser la proabilité de recruter le\n", "meilleur candidat. Quelle est la meilleure stratégie ?\n", "\n", "On a vu en cours que l'on peut se ramener à $(S_1,\\ldots,S_N)$ est une\n", "suite de variables aléatoires indépendantes de Bernouilli $1/n$, qui\n", "est une chaîne de Markov sur l'espace $E=\\{0,1\\}$, non homogène, de\n", "matrice de transition, dépendant du temps, $P_n$\n", "$$\n", "\\begin{array}{lcl}\n", " P_n(0,0)&=&P_n(1,0)=1-\\frac{1}{n+1}=\\frac{n}{n+1},\\\\\n", " P_n(0,1)&=&P_n(1,1)=\\frac{1}{n+1}.\n", "\\end{array}\n", "$$\n", "On chercher à maximiser $\\P(\\tau\\;\\mbox{ est le\n", " meilleur})=\\E\\left(\\frac{\\tau}{N} S_\\tau\\right)$ (voir les transparents pour une preuve) parmi tous les\n", "temps d'arrêt." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 3.1__ Ecrire un programme _Python_ qui calcule la solution\n", " $(u(n,0\\mbox{ ou } 1),0\\leq n \\leq N)$ de l'équation de\n", " programmation dynamique donnée par (voir cours)\n", " $$\n", " \\left\\{\n", " \\begin{array}{l}\n", " u(n,x) = \\max\\Big\\{ \\frac{n}{n+1} u(n+1,0) + \\frac{1}{n+1} u(n+1,1),\\frac{n}{N} x\\Big\\}, n" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "main_11()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Question 3.3__ Interprétez $u(n=0,s=1)$ comme la probabilité de choisir\n", "le meilleur candidat avec la stratégie optimale. Tracer la courbe\n", "$N$ donne\n", "$$\n", " \\P(\\mbox{Le candidat choisi par une stratégie optimale est le\n", " meilleur}),\n", "$$\n", "pour $N=10,25,50,100,250,500,1000$. Vérifier numériquement qu'elle converge vers $1/e\\approx 37\\%$.\n", " " ] }, { "cell_type": "code", "execution_count": 180, "metadata": {}, "outputs": [], "source": [ "def main_12():\n", " # u(0,1) = P(succés pour la stratégie optimale)\n", " # On vérifie que cette proba tends vers 1/e ~ 37\\%\n", " valeurs=[10,15,20,25,30,40,50,60,70,80,100,150,200,250,500,1000];\n", " courbe=np.zeros(np.size(valeurs));\n", "\n", " i=0;\n", " for N in valeurs:\n", " \n", " # calculer la probabilité d'obtenir le meilleur, avec la stratégie optimale, pour N candidats\n", " \n", " ###### A vous de jouer .....\n", "\n", " i=i+1;\n", "\n", " plt.plot(valeurs,courbe)" ] }, { "cell_type": "code", "execution_count": 181, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAH4VJREFUeJzt3X90XOV95/H3Z2Y0siXZWMayAf/AJihpXEgMaB1oaE42C60pWcz2JKcQNmEbGjYtXtg23Q1s0/SU7tkfOdk0m66bhqZAuqfgtmnSuNTEm589haTBIjExP2sZHFv8sohtbMtYP7/7x9yRr8YjzdiSPbbu53XOHM197nOvnscD89HzPHfuKCIwMzPLNboBZmZ2enAgmJkZ4EAwM7OEA8HMzAAHgpmZJRwIZmYGOBDMzCxRVyBIWiPpOUk9ku6cpN77JIWkrlTZXclxz0n6xeM9p5mZnRqq9cE0SXngn4GrgV5gC3BjRDxdUW8O8PdAEVgXEd2SVgIPAquB84BvAm9ODql5TjMzO3UKddRZDfRExPMAkjYAa4HKN+8/AD4F/HaqbC2wISIGgBck9STno85zjrNgwYJYvnx5HU02M7Oyxx9//LWI6KhVr55AWAzsTm33Au9IV5B0CbA0Ih6S9NsVx/5TxbGLk+eTnrOa5cuX093dXUeTzcysTNJP6qlXzxqCqpSNzTNJygF/CHzsOI6d9JzjTiDdKqlbUndfX18dzTUzsxNRTyD0AktT20uAl1Lbc4CLgO9K2glcDmxMFpYnOrbWOcdExD0R0RURXR0dNUc8ZmZ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bX6YUEDP5tb4KeCEi+iJiCPgK8HPM/Ne67Hhf22l9zWdiIGwBOpOrEoqUFqQ2NrhN00aSgD8DnomIz6R2bQTKVxjcTGltoVz+oeQqhcuB18tD0jNFRNwVEUsiYjml1/PbEXET8B3gfUm1yj6X/y3el9Q/4/5qjIhXgN2S3pIU/SvgaWbwa01pquhySS3Jf+vlPs/o1zrleF/bzcAvSGpPRle/kJSdmEYvqpykhZpfAv4Z2AH8TqPbM819u5LSkPDHwNbk8UuU5k2/BWxPfs5P6ovSVVc7gG2Urt5oeD+m0P93Aw8lzy8AHgN6gL8GmpPyWcl2T7L/gka3ewr9XQV0J6/33wLtM/21Bn4feBZ4Evi/QPNMfK2BBymtkwxR+kv/lhN5bYEPJ/3vAX51Km3yJ5XNzAyYmVNGZmZ2AhwIZmYGOBDMzCzhQDAzM8CBYGZmCQeCmZkBDgQzM0s4EMzMDID/Dycm1XQyOkeAAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "main_12()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Calcul et simulation du temps d'arrêt optimal" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Vérifier que l'on a $u(n,0) > 0$ pour tout $n 0 = f(n,0)$, et le temps optimal ne peut donc être atteint avec $S_n=0$ lorsque $n" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "def main_13():\n", " # Vérification que temps_min vaut environ |$N/e$|.\n", " Taille=1000;\n", " x=np.zeros(Taille+1)\n", " for N in range(1,Taille+1):\n", " x[N]=temps_min(N)/N;\n", " e=math.exp(1)\n", " x=x-1/e;\n", " plt.plot(range(Taille+1),x);\n", " \n", "main_13()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Ecrire une fonction qui calcule la suite des rangs d'insertion ($R$ dans le cours)\n", " d'une permutation et une fonction qui calcule la permutation\n", " définie par ses rangs d'insertion successifs." ] }, { "cell_type": "code", "execution_count": 184, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "rangs d'insertion: [1 2 2 1 1 6 3 7 9 1]\n", "[ 5 7 6 3 2 9 4 8 10 1] ?=? [ 5 7 6 3 2 9 4 8 10 1]\n" ] } ], "source": [ "def Omega2R(omega):\n", "# Calcule les rangs d'insertion d'une permutation omega donnée\n", " R=np.zeros(np.size(omega),dtype=int) # crée u tableau d'entier\n", " for n in range(np.size(omega)):\n", " # classe le vecteur omega[1,...,n] en croissant\n", " y=np.sort(omega[0:n+1]);\n", " # R(n) = le classement de omega(n) parmi les n premiers\n", " R[n]=np.where(y==omega[n])[0][0]+1\n", " return R\n", "\n", "def R2Omega(R):\n", " # Calcule omega connaissant les rangs d'insertion\n", " iomega=np.zeros(0,dtype=int);# crée u tableau d'entier\n", " for n in range(np.size(R)):\n", " # J'insére n à l'indice R[n]\n", " iomega=np.concatenate([iomega[0:int(R[n]-1)],[n+1],iomega[int(R[n]-1):n+1]])\n", " # On inverse la permutation\n", " omega=np.zeros(np.size(R),dtype=int)# crée u tableau d'entier\n", " for n in range(np.size(omega)):\n", " omega[int(iomega[n]-1)]=int(n+1)\n", " return omega\n", "\n", "def main_14():\n", " # test sur une permutation\n", " N=10\n", " omega=np.random.permutation(N)+1# tirage d'une permutation aléatoire.\n", " R=Omega2R(omega)\n", " print(\"rangs d'insertion: \",R)\n", " \n", " # Retrouve t'on omega ?\n", " omega2=R2Omega(R)\n", " print(omega,end='')\n", " print(' ?=? ',end='')\n", " print(omega2)\n", "\n", "main_14()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " __Question 3.6__ Vérifier par simulation que la probabilité d'obtenir le meilleur\n", " candidat, lorsque l'on utilise la stratégie optimale, est de l'ordre\n", " de $1/e\\approx 37\\%$. Ce qui n'est pas génial, mais c'est le mieux\n", " que l'on puisse faire (sans connaitre l'avenir!)." ] }, { "cell_type": "code", "execution_count": 185, "metadata": {}, "outputs": [], "source": [ "def temps_optimal(omega,N):\n", "# Calcule le temps d'arret optimum\n", "# pour la permutation |$\\omega$| \n", "\n", " # Calcule la suite R à partir de omega (omega->R)\n", " R=Omega2R(omega);\n", " # calcul de tau_min\n", " u=compute_u(N);\n", " tau_min=temps_min(N);\n", " # Le temps optimal se situe après tau_min et c'est le premier instant\n", " # où R(n)=S(n)=1 apres ce temps, sauf si n=N, auquel cas on est oblige\n", " # de prendre le dernier candidat.\n", " for n in range(tau_min,N+1): # = tau_min, tau_min+1, ... , N\n", " if R[n-1]==1: # n-1 parce que les indices de R varie de 0 a n-1\n", " if u[n,1] == n/N: # à vrai dire cette condition n'est pas indispensable\n", " # car après tau_min, cette égalité est forcément vérifiée\n", " break\n", " # Si on sort de cette boucle avec n=N et N est bien optimal.\n", " return n\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On teste dans un cas particulier." ] }, { "cell_type": "code", "execution_count": 186, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "probabilité d'obtenir le meilleur: 0.363 ~ 1/e = 0.36787944117144233\n", "erreur : 0.004879441171442345 erreur Monte-Carlo maximum probable : 0.02988882127355379\n" ] } ], "source": [ "def main_15():\n", " # Verification que la probabilité d'obtenir\n", " # le meilleur est de l'ordre de 1/e\n", " N=100;\n", " Taille=1000;\n", " \n", " ss=0;\n", " for i in range(Taille):\n", " omega=np.random.permutation(N)+1 # on rajoute 1 pour avoir la notation classique d'une permutation\n", " tirages=temps_optimal(omega,N) \n", " # tirages(i) est il le meilleur ?\n", " if (omega[int(tirages-1)]==1): ss=ss+1;\n", " proba=ss/Taille;\n", " \n", " e=math.exp(1)\n", " p=1/e;\n", " print(\"probabilité d'obtenir le meilleur: \",proba,\"~ 1/e = \",p);\n", " print('erreur :',abs(proba-p),'erreur Monte-Carlo maximum probable :', 1.96*math.sqrt(p*(1-p)/Taille))\n", " \n", "main_15()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Thème de réflexion 1.__ Pourquoi le problème posé avec la\n", " chaîne de Markov $(R_n,0\\leq k\\leq N)$ en lieu et place de\n", " $(S_n,0\\leq k\\leq N)$ donnerait il le même résultat ?\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Thème de réflexion 2.__ Pourquoi le fait de donner une note\n", " suivant une loi uniforme entre l'intervalle réel $[0,20]$ change le\n", " résultat et augmente la probabilité d'obtenir le meilleur candidat\n", " (bien que la loi induite sur les permutations reste la loi\n", " uniforme) ?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.7" } }, "nbformat": 4, "nbformat_minor": 2 }