<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Arthur Charpentier</title>
  <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/</link>
  <atom:link href="http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/feed/rss2" rel="self" type="application/rss+xml"/>
  <description>L;ancien blog de Arthur Charpentier, maître de conférence à la Faculté des Sciences Économiques de l'Université de Rennes 1. Le nouveau est http://freakonometrics.blog.free.fr/</description>
  <language>fr</language>
  <pubDate>Mon, 21 Feb 2011 14:37:47 +0100</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Blog transfert</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/10/01/Blog-transfert</link>
    <guid isPermaLink="false">urn:md5:8cff7d9307a6436b4236e122e8298d1b</guid>
    <pubDate>Fri, 01 Oct 2010 00:01:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>liens externes</category>
        <category>freakonometrics</category>    
    <description>    As
mentioned during the past few weeks, the blog has been transfered (please
update links and bookmarks). You will be redirected (shortly) to&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php/&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;http://freakonometrics.blog.free.fr&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Statistique de l'assurance STT6705V, partie 5</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/29/Statistique-de-l-assurance-STT6705V%2C-partie-5</link>
    <guid isPermaLink="false">urn:md5:a05f17d34dc66db7d6941973a02bcd84</guid>
    <pubDate>Wed, 29 Sep 2010 02:54:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>actuariat 10/11 STT6705V</category>
        <category>actuariat</category><category>Box</category><category>Cox</category><category>gamma</category><category>log</category><category>lognormal</category>    
    <description>    &lt;p&gt;Pour la cinquième séance de cours, nous allons continuer sur la modélisation des coûts, à partir des transparents en
ligne &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-udm-220910.pdf&quot;&gt;ici&lt;/a&gt;.
La première partie portera sur la comparaison du modèle Gamma et du
modèle lognormal, et la seconde sur l&amp;rsquo;écrêtement des gros sinistres.&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;Il convient de faire attention à la transformation logarithmique. Un modèle de la forme&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm01.png&quot; /&gt;&lt;/div&gt;paraîtra toujours &quot;&lt;em&gt;meilleur&lt;/em&gt;&quot; qu&amp;rsquo;un modèle&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm02.png&quot; /&gt;&lt;/div&gt;(pour peu que les&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm03.png&quot; /&gt; soient bien plus grands que 1). Regardons un jeu de données classique, liant vitesse du véhicule et distance de freinage.&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; summary(lm(dist~speed,data=cars))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;lm(formula = dist ~ speed, data = cars)&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept) -17.5791&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.7584&amp;nbsp; -2.601&amp;nbsp;&amp;nbsp; 0.0123 *&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;speed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.9324&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.4155&amp;nbsp;&amp;nbsp; 9.464 1.49e-12 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Residual standard error: 15.38 on 48 degrees of freedom&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Multiple R-squared: 0.6511,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Adjusted R-squared: 0.6438 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;F-statistic: 89.57 on 1 and 48 DF,&amp;nbsp; p-value: 1.490e-12 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.cars-log-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; summary(lm(log(dist)~speed,data=cars))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;lm(formula = log(dist) ~ speed, data = cars)&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept)&amp;nbsp; 1.67612&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.19614&amp;nbsp;&amp;nbsp; 8.546 3.34e-11 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;speed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.12077&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01206&amp;nbsp; 10.015 2.41e-13 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Residual standard error: 0.4463 on 48 degrees of freedom&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Multiple R-squared: 0.6763,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Adjusted R-squared: 0.6696 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;F-statistic: 100.3 on 1 and 48 DF,&amp;nbsp; p-value: 2.413e-13 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.cars-log-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Le R2 est plus faible, l&amp;rsquo;écart type des résidus aussi, la log-vraisemblance si on l&amp;rsquo;avait, etc.&lt;br /&gt;Il
ne faut jamais oublier qu&amp;rsquo;on doit ensuite prendre l&amp;rsquo;exponentiel sur
modèle en log. C&amp;rsquo;est d&amp;rsquo;ailleurs ce qui est fait par exemple dans la
transformation de Box Cox, où l&amp;rsquo;on compare les sommes des carrés des
résidus sur les&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm03.png&quot; /&gt;, i.e.&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm04.png&quot; /&gt;&lt;/div&gt;et&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm05.png&quot; /&gt;&lt;/div&gt;où&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/lognorm06.png&quot; /&gt;.&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.cars-log-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; s=summary(lm(log(dist)~speed,data=cars))$sigma&lt;br /&gt;&amp;gt;&amp;nbsp; mean((cars$dist-predict(lm(dist~speed,data=cars)))^2) &lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 227.0704&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp; mean((cars$dist-exp(predict(lm(log(dist)~speed,data=cars))+.5*s^2))^2) &lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 296.2027&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Tout ça pour conclure que le modèle linéaire n&amp;rsquo;est peut être pas si mauvais que ça....</description>
    
    
    
      </item>
    
  <item>
    <title>EM and mixture estimation, with R (part 2)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/25/EM-and-mixture-estimation%2C-with-R-%28part-2%29</link>
    <guid isPermaLink="false">urn:md5:50ce9025db8b39e6584217173c3a5b50</guid>
    <pubDate>Sat, 25 Sep 2010 02:56:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Informatique / R</category>
        <category>CRAN</category><category>EM</category><category>gaussians</category><category>mixture</category><category>optimization</category><category>R</category><category>rstats</category>    
    <description>    &lt;p&gt;
Following my previous post on optimization and mixtures (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/09/23/Optimization-and-mixture-estimation%2C-with-R&quot;&gt;here&lt;/a&gt;), Nicolas told me that my idea was probably not the most clever one (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/09/23/Optimization-and-mixture-estimation%2C-with-R#c147920&quot;&gt;there&lt;/a&gt;).&lt;br /&gt;
So, we get back to our simple mixture model,&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM01.png&quot; /&gt;&lt;/div&gt;
In order to describe how EM algorithm works, assume first that both&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; /&gt; and &amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; /&gt; are perfectly known, and the mixture parameter is the only one we care about.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;The simple model, with only one parameter that is unknown&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Here, the likelihood is&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM04.png&quot; /&gt;&lt;/div&gt;
so that we write the log likelihood as&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM05.png&quot; /&gt;&lt;/div&gt;
which might not be simple to maximize. Recall that the mixture model can interpreted through a latent variate&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM06.png&quot; /&gt;&amp;nbsp;(that cannot be observed), taking value when&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM07.png&quot; /&gt; is drawn from&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; /&gt;, and 0 if it is drawn from&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; /&gt;. More generally (especially in the case we want to extend our model to 3, 4, ... mixtures),&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM08.png&quot; /&gt; and&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM09.png&quot; /&gt;.&lt;br /&gt;
With that notation, the likelihood becomes&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM10.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM10.png&quot; /&gt;&lt;/div&gt;
and the log likelihood&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM11.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM11.png&quot; /&gt;&lt;/div&gt;
the term on the right is useless since we only care about p, here. From here, consider the following iterative procedure,&lt;br /&gt;
Assume that the mixture probability&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM13.png&quot; /&gt; is known, denoted&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM12.png&quot; /&gt;. Then I can predict the value of&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM06.png&quot; /&gt; (i.e.&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM08.png&quot; /&gt; and&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM09.png&quot; /&gt;) for all observations,&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM14.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM14.png&quot; /&gt;&lt;/div&gt;
So I can inject those values into my log likelihood, i.e. in&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM15.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM15.png&quot; /&gt;&lt;/div&gt;
having maximum (no need to run numerical tools here)&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM16.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM16.png&quot; /&gt;&lt;/div&gt;
that will be denoted&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM17.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM17.png&quot; /&gt;. And I can iterate from here.&lt;br /&gt;
Formally, the first step is where we calculate an expected (&lt;span style=&quot;font-weight: bold; color: rgb(153, 0, 0);&quot;&gt;E&lt;/span&gt;) value, where&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt; is the best predictor of&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM19.png&quot; /&gt; given my observations&amp;nbsp;(as well as my belief in&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM13.png&quot; /&gt;). Then comes a maximization (&lt;span style=&quot;font-weight: bold; color: rgb(153, 0, 0);&quot;&gt;M&lt;/span&gt;) step, where using&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM06.png&quot; /&gt;, I can estimate probability &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM13.png&quot; /&gt;.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;A more general framework, all parameters are now unkown&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
So far, it was simple, since we assumed that&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; /&gt; and &amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; /&gt; were perfectly known. Which is not reallistic. An there is not much to change to get a complete algorithm, to estimate&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM30.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM30.png&quot; /&gt;. Recall that we had&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt; which was the expected value of Z_{1,i}, i.e. it is a probability that observation i has been drawn from&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; /&gt;. &lt;br /&gt;
If&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt;, instead of being in the segment&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM31.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM31.png&quot; /&gt; was in&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM32.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM32.png&quot; /&gt;, then we could have considered mean and standard deviations of observations such that&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt;=0, and similarly on the subset of observations such that&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt;=1.&lt;br /&gt;
But we can&amp;rsquo;t. So what can be done is to consider&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt; as the weight we should give to observation i when estimating parameters of&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM02.png&quot; /&gt;, and similarly, 1-&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM18.png&quot; /&gt; would be weights given to observation i when estimating parameters of&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM03.png&quot; /&gt;.&lt;br /&gt;
So we set, as before&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM33.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM33.png&quot; /&gt;&lt;/div&gt;
and then&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM34.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM34.png&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM35.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM35.png&quot; /&gt;&lt;/div&gt;
and for the variance, well, it is a weighted mean again,&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM36.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM36.png&quot; /&gt;&lt;br /&gt;
&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM37.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM37.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
and this is it.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Let us run the code on the same data as before&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Here, the code is rather simple: let us start generating a sample&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; X1 = rnorm(n,0,1)&lt;br /&gt;
&amp;gt; X20 = rnorm(n,0,1)&lt;br /&gt;
&amp;gt; Z&amp;nbsp; = sample(c(1,2,2),size=n,replace=TRUE)&lt;br /&gt;
&amp;gt; X2=4+X20&lt;br /&gt;
&amp;gt; X = c(X1[Z==1],X2[Z==2])&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;then, given a vector of initial values (that I called&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM12.png&quot; /&gt; and then&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM99.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM99.png&quot; /&gt; before),&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; s = c(0.5, mean(X)-1, var(X), mean(X)+1, var(X))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
I define my function as,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; em = function(X0,s) {&lt;br /&gt;
+&amp;nbsp; Ep = s[1]*dnorm(X0, s[2], sqrt(s[4]))/(s[1]*dnorm(X0, s[2], sqrt(s[4])) +&lt;br /&gt;
+&amp;nbsp; (1-s[1])*dnorm(X0, s[3], sqrt(s[5])))&lt;br /&gt;
+&amp;nbsp; s[1] = mean(Ep)&lt;br /&gt;
+&amp;nbsp; s[2] = sum(Ep*X0) / sum(Ep)&lt;br /&gt;
+&amp;nbsp; s[3] = sum((1-Ep)*X0) / sum(1-Ep)&lt;br /&gt;
+&amp;nbsp; s[4] = sum(Ep*(X0-s[2])^2) / sum(Ep)&lt;br /&gt;
+&amp;nbsp; s[5] = sum((1-Ep)*(X0-s[3])^2) / sum(1-Ep)&lt;br /&gt;
+&amp;nbsp; return(s)&lt;br /&gt;
+&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Then I get&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM12.png&quot; /&gt;, or&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM99.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mixEM99.png&quot; /&gt;.
So this is it&amp;thinsp;! We just need to iterate (here I stop after 200
iterations) since we can see that, actually, our algorithm converges
quite fast,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; for(i in 2:200){&lt;br /&gt;
+ s=em(X,s)&lt;br /&gt;
+ }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.convergence-EM-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Let us run the same procedure as before, i.e. I generate samples of
size 200, where difference between means can be small (0) or large (4),&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.convergence-EM_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Ok, Nicolas, you were right, we&amp;rsquo;re doing much better&amp;thinsp;! Maybe we should
also go for a Gibbs sampling procedure&amp;thinsp;?... next time, maybe....</description>
    
    
    
      </item>
    
  <item>
    <title>Optimization and mixture estimation, with R</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/23/Optimization-and-mixture-estimation%2C-with-R</link>
    <guid isPermaLink="false">urn:md5:8b0ab673b4071ed40a1b40eeb0634788</guid>
    <pubDate>Thu, 23 Sep 2010 23:09:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Informatique / R</category>
        <category>CRAN</category><category>mixture</category><category>nlm()</category><category>optimize()</category><category>R</category><category>rstats</category>    
    <description>    &lt;p&gt;Recently, one&amp;nbsp;of my students asked me&amp;nbsp;about optimization routines in R.
He told me he that R performed well on the estimation of a time series
model with different regimes, while he had trouble with a (simple)
GARCH process, and he was wondering if R was good in optimization
routines. Actually, I always thought that mixtures (and regimes) was
something difficult to estimate, so I was a bit surprised...&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.50948-hamac-la-siesta-baiana_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Indeed, it reminded me some trouble I experienced once, while I was talking about &lt;em&gt;maximum likelihooh estimation&lt;/em&gt;,
for non standard distribution, i.e. when optimization had to be done
on the log likelihood function. And even when generating nice samples, giving appropriate
initial values (actually the &lt;em&gt;true&lt;/em&gt; value used in random generation), each time I tried to optimize my log likelihood, it
failed. So I decided to play a little bit with standard optimization
functions, to see which one performed better when trying to estimate
mixture parameter (from a mixture based sample). Here, I generate a
mixture of two gaussian distributions, and I would like to see how
different the mean should be to have a high probability to estimate
properly the parameters of the mixture.
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/melange-optimize.gif&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
The density is here&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-01.png&quot; /&gt; proportional to&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-02.png&quot; /&gt;&lt;/div&gt;The true model is&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-03.png&quot; /&gt;, and&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-04.png&quot; /&gt; being a parameter that will change, from 0 to 4.&lt;br /&gt;The log likelihood (actually, I add a minus since most of the optimization functions actually &lt;em&gt;minimize&lt;/em&gt; functions) is&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; logvraineg &amp;lt;- function(param, obs) {&lt;br /&gt;+ p &amp;lt;- param[1]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+ &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;m1 &amp;lt;- param[2]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+ &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;sd1 &amp;lt;- param[3]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+ &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;m2 &amp;lt;- param[4]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;sd2 &amp;lt;- param[5]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+ &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;-sum(log(p * dnorm(x = obs, mean = m1, sd = sd1) + (1 - p) *&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+ &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;dnorm(x = obs, mean = m2, sd = sd2)))&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;+ &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The code to generate my samples is the following,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;X1 = rnorm(n,0,1)&lt;br /&gt;&amp;gt; X20 = rnorm(n,0,1)&lt;br /&gt;&amp;gt; Z&amp;nbsp; = sample(c(1,2,2),size=n,replace=TRUE)&lt;br /&gt;&amp;gt; X2=m+X20&lt;br /&gt;&amp;gt; X = c(X1[Z==1],X2[Z==2])&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Then I use two functions to optimize my log likelihood, with identical intial values,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; O1=nlm(f = logvraineg, p = c(.5, mean(X)-sd(X)/5, sd(X), mean(X)+sd(X)/5, sd(X)), obs = X)&lt;br /&gt;&amp;gt; logvrainegX &amp;lt;- function(param) {logvraineg(param,X)}&lt;br /&gt;&amp;gt; O2=optim( par = c(.5, mean(X)-sd(X)/5, sd(X), mean(X)+sd(X)/5, sd(X)), &lt;br /&gt;+&amp;nbsp;&amp;nbsp; fn = logvrainegX)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Actually, since I might have identification problems, I take either&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-05.png&quot; /&gt; or&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-06.png&quot; /&gt;, depending whether&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-07.png&quot; /&gt; or&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-08.png&quot; /&gt; is the smallest parameter.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.opt1P02a_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On the graph above, the x-axis is the difference between means of the mixture (as on the animated grap above). Then, the &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;red&lt;/span&gt; point is the median of estimated parameter I have (here&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-05.png&quot; /&gt;), and I have included something that can be interpreted as a &lt;em&gt;confidence interval&lt;/em&gt;, i.e. where I have been in 90% of my scenarios: the &lt;strong&gt;black&lt;/strong&gt; vertical segments. Obviously, when the sample is not enough heterogeneous (i.e.&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-09.png&quot; /&gt; and&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mix-ml-04.png&quot; /&gt;
rather different), I cannot estimate properly my parameters, I might
even have a probability that exceed 1 (I did not add any constraint).
The &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;blue&lt;/span&gt; plain horizontal line is the &lt;em&gt;true&lt;/em&gt; value of the parameter, while the &lt;span style=&quot;font-weight: bold; color: rgb(51, 204, 255);&quot;&gt;blue&lt;/span&gt;
dotted horizontal line is the initial value of the parameter in the
optimization algorithm (I started assuming that the mixture probability
was around 0.2).&lt;br /&gt;The graph below is based on the second optimization
routine (with identical &amp;nbsp;starting values, and of course on the same
generated samples), &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.opt2P02a_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
(just
to be honest, in many cases, it did not converge, so the loop stopped,
and I had to run it again... so finally, my study is based on a bit
less than 500&amp;nbsp;samples (times 15 since I considered several values for
the mean of my second underlying distribution), with 200 generated
observations from a mixture).&lt;br /&gt;The graph below compares the two (empty circles are the first algorithm, while plain circles the second one),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img style=&quot;width: 448px; height: 190px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.opt12P02a_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On
average, it is not so bad.... but the probability to be far away from
the tru value is not small at all... except when the difference between
the two means exceeds 3...&lt;br /&gt;If I change starting values for the
optimization algorithm (previously, I assumed that the mixture
probability was 1/5, here I start from 1/2), we have the following graph&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.opt12P05a_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
which
look like the previous one, except for small differences between the
two underlying distributions (just as if initial values had not impact
on the optimization, but it might come from the fact that the surface
is nice, and we are not trapped in regions of local minimum).&lt;br /&gt;Thus, I am far from being an expert in optimization routines in R (see &lt;a href=&quot;http://cran.r-project.org/web/views/Optimization.html&quot;&gt;here&lt;/a&gt;
for further information), but so far, it looks like R is not doing so
bad... and the two algorithm perform similarly (maybe the first one
being a bit closer to the &lt;em&gt;true&lt;/em&gt; parameter).</description>
    
    
    
      </item>
    
  <item>
    <title>Statistique de l'assurance STT6705V, partie 4b</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/23/Statistique-de-l-assurance-STT6705V%2C-partie-4b</link>
    <guid isPermaLink="false">urn:md5:d8b8b5a62a74fca3cea0a2a7a2dc2a3d</guid>
    <pubDate>Thu, 23 Sep 2010 21:17:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>actuariat 10/11 STT6705V</category>
        <category>actuariat</category><category>devoir maison</category><category>DM1</category><category>projet</category><category>tarification</category><category>UdM</category>    
    <description>    &lt;p&gt;
Avant toute autre chose, pour revoir le dernier cours, il suffit
d&amp;rsquo;aller &lt;a href=&quot;http://www.diffusionvideo.umontreal.ca/statistiques/22sept2010/1/&quot;&gt;ici&lt;/a&gt;
et &lt;a href=&quot;http://www.diffusionvideo.umontreal.ca/statistiques/22sept2010/2/&quot;&gt;là&lt;/a&gt;.
&lt;br /&gt;
Bon, sinon, comme promis, les bases de données pour les
projets sont en
ligne ici. Le principe est simple. Il y a 28 bases de
données,
toutes semblables (mais bien sûr différentes), par
les
numéros ci-dessous. Comme toujours, premier
arrivé,
premier servi, donc les bases vont être attribuées
au fur
et à mesure&lt;/p&gt;
&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;étape
1: choisir une base&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
Vous choisissez un numéro et &lt;span style=&quot;color: rgb(153, 0, 0); font-weight: bold;&quot;&gt;cliquez
dessus&lt;/span&gt;, afin de me
prévenir (par courriel, à l&amp;rsquo;aide du tableau
ci-dessous) de votre choix. Les projets se font par
deux, merci de mettre dans le corps du message les noms des deux
personnes qui travailleront sur le projet.&amp;nbsp;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;table style=&quot;text-align: left; width: 100px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=satistique%20de%20l%27actuariat,%20tarification,%20base%20no1&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no1.PNG&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no2&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no2.PNG&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no3&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no3.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no4&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no4.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no5&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no5.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no6&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no6.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no7&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no7.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no8&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no8.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no9&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no9.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no10&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no10.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no11&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no11.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no12&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no12.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no13&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no13.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no14&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no14.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no15&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no15.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no16&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no16.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no17&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no17.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no18&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no18.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no19&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no19.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no20&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no20.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no21&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no21.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no22&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no22.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no23&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no23.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no24&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no24.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no25&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no25.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no26&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no26.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no27&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no27.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:arthur.charpentier@univ-rennes1.fr?subject=statistique%20de%20l%27actuariat,%20tarification,%20base%20no28&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 50px; height: 35px;&quot; alt=&quot;&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/no28.PNG&quot; /&gt;
&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;étape
2: récupérer les données&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
une fois que j&amp;rsquo;aurais confirmé que personne n&amp;rsquo;a choisi la
même base, vous pouvez les récupérer
sous R à &amp;nbsp;l&amp;rsquo;aide du code suivant,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;
k=1&lt;br /&gt;
&amp;gt;
nom=paste(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/UdM-baseC-&quot;,&lt;br /&gt;
+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k,&quot;.txt&quot;,sep=&quot;&quot;)&lt;br /&gt;
&amp;gt; baseC=read.table(nom,header=TRUE)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
pour la base de contrats (et pour le groupe qui aurait choisi la base
1) et pour la base des sinistres,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;
nom=paste(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/6705V/UdM-baseS-&quot;,&lt;br /&gt;
+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k,&quot;.txt&quot;,sep=&quot;&quot;)&lt;br /&gt;
&amp;gt; baseS=read.table(nom,header=TRUE)&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;Ensuite, c&amp;rsquo;est parti, il s&amp;rsquo;agit de me
proposer différents
modèles de tarification, et de calculer les primes pures
avec les différents modèles, pour une personne
parmi les listes des personnes ayant les caractéristiques
suivantes,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;
client=data.frame(&lt;br /&gt;
+ exposition=rep(1,9),&lt;br /&gt;
+ zone=c(&quot;A&quot;,&quot;A&quot;,&quot;A&quot;,&quot;C&quot;,&quot;D&quot;,&quot;E&quot;,&quot;F&quot;,&quot;F&quot;,&quot;F&quot;),&lt;br /&gt;
+ puissance=c(6,7,11,6,7,11,6,7,11),&lt;br /&gt;
+ agevehicule=c(0,1,5,10,5,1,0,6,10),&lt;br /&gt;
+ ageconducteur=c(25,18,55,55,55,40,21,20,18),&lt;br /&gt;
+ bonus=c(80,100,50,60,55,50,100,125,100),&lt;br /&gt;
+ marque=c(1,2,12,12,12,1,1,1,2),&lt;br /&gt;
+ carburant=c(&quot;D&quot;,&quot;E&quot;,&quot;E&quot;,&quot;D&quot;,&quot;D&quot;,&quot;E&quot;,&quot;E&quot;,&quot;D&quot;,&quot;D&quot;),&lt;br /&gt;
+ densite=rep(3000,9),&lt;br /&gt;
+ client=rep(baseC$region[1],9))&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;(si
certains modalités ne sont pas présentes dans
la base, il faut choisir quelqu&amp;rsquo;un d&amp;rsquo;autre.... sur les neuf, il doit
bien en avoir un(e) qui pourrait être présent(e)
dans votre base de données). En cas de problème,
vous avez mon adresse électronique.... Et je reviendrais
ultérieurement sur la forme de ce que j&amp;rsquo;attends.&lt;/div&gt;&lt;/div&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Soccer, probabilité (et assurance) partie 3</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/23/Soccer%2C-probabilit%C3%A9-%28et-assurance%29-partie-3</link>
    <guid isPermaLink="false">urn:md5:de3d667c4ae14bdb1ee56e14995084e6</guid>
    <pubDate>Thu, 23 Sep 2010 17:54:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Risques</category>
        <category>coupe du monde</category><category>foot</category><category>France</category><category>probabilité</category><category>risque neutre</category><category>soccer</category>    
    <description>    &lt;p&gt;
La dernière fois (il y a quelques mois, &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/06/03/Foot%2C-probabilit%C3%A9%2C-et-assurance%2C-partie-2&quot;&gt;ici&lt;/a&gt;)
on avait évoqué le lien entre cote et probabilités
risques neutres (induites). &lt;img style=&quot;width: 225px; height: 240px; float: right;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.819_s.jpg&quot; alt=&quot;&quot; /&gt;J&amp;rsquo;avais évoqué les cotes
à un instant donné donné, et montré comment
on pouvait construire la probabilité risque neutre
associée. L&amp;rsquo;idée est ici de suivre l&amp;rsquo;évolution des
probabilités pendant la coupe du monde, au fur et à
mesure que les matchs révèlent de l&amp;rsquo;information sur le &lt;em&gt;vrai&lt;/em&gt; niveau des équipes...&lt;br /&gt;
A l&amp;rsquo;aide des données &quot;&lt;strong&gt;World Cup Group A Betting&lt;/strong&gt;&quot; (&quot;&lt;strong&gt;Win Market&lt;/strong&gt;&quot;)
sur http://www.oddschecker.com/ (Vincent, alias &lt;a href=&quot;http://twitter.com/Vicnent&quot;&gt;@Vicnent&lt;/a&gt;, avait fait des sauvegarde
régulières des pages html), on peut suivre les cotes
toutes les 30 minutes, entre le 10 juin et le 22 juin, au sein du
groupe de l&amp;rsquo;équipe de France.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.bet-noms_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pour le premier site de pari (bet365), on a les probabilités
suivantes, avec les probabilités associées à
l&amp;rsquo;équipe de France (en &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;bleu&lt;/span&gt;), à l&amp;rsquo;Afrique du Sud (en &lt;span style=&quot;font-weight: bold; color: rgb(255, 255, 0);&quot;&gt;jaune&lt;/span&gt;), l&amp;rsquo;Uruguay (en &lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt;) et le Mexique (en &lt;span style=&quot;font-weight: bold; color: rgb(51, 204, 0);&quot;&gt;vert&lt;/span&gt;),
&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.foot-proba-groupe-france-bet-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On note que les probabilités sont stables en dehors des matchs,
autrement dit seul le comportement sur le terrain semble
intéresser les parieurs (les matchs ont lieu pendant les date
où l&amp;rsquo;on observe des traits &lt;span style=&quot;color: rgb(51, 204, 255); font-weight: bold;&quot;&gt;bleus clairs&lt;/span&gt; verticaux).&lt;br /&gt;
Pour le troisième, on observe quelque chose de très proche (les valeurs
manquants signifient que le tableau en ligne était vide, ou que j&amp;rsquo;ai
raté ma lecture du fichier html sous R), avec des variations du même
ordre à la fin des matchs,&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.foot-proba-groupe-france-bet-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pour le sixième on a&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.foot-proba-groupe-france-bet-6_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
pour le neuvième, &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.foot-proba-groupe-france-bet-9_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et pour le douzième (je n&amp;rsquo;ai pas affiché tous les graphs)&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.foot-proba-groupe-france-bet-12_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On
notera qu&amp;rsquo;à la fin, après les seconds matchs plus personnes ne semblait
croire à l&amp;rsquo;équipe de France (en France en tous les cas), sa probabilité
de gagner pour les parieurs est resté élevée, et ce, chez tous les
sites de paris.... il aurait probablement été intéressant de parier à
la fin sur le Mexique (même si je sais que rétrospectivement, il est
toujours facile de dire ce qu&amp;rsquo;il fallait alors faire). Attendre le
dernier moment pour faire des paris n&amp;rsquo;est pas forcément stupide...&lt;br /&gt;La prochaine étape c&amp;rsquo;est de regarder non pas les pronostiques
par poule, mais globalement, sur le futur vainqueur. Nous verrons en
particulier comment les matchs des autres influences les
probabilités d&amp;rsquo;une équipe....</description>
    
    
    
      </item>
    
  <item>
    <title>Qui peut m'aider à comprendre les sorties de SAS ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/23/Qui-peut-m-aider-%C3%A0-comprendre-les-sorties-de-SAS</link>
    <guid isPermaLink="false">urn:md5:b5ff169d32eb5381bce044c9895f6531</guid>
    <pubDate>Thu, 23 Sep 2010 01:05:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>C, VB,SQL...</category>
        <category>genmod</category><category>logistic</category><category>proc</category><category>SAS</category>    
    <description>    &lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.sas-villliers_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Je
m&amp;rsquo;étais promis que j&amp;rsquo;évoquerais une bizarrerie rencontrée avec SAS lors
d&amp;rsquo;une formation.... Écrire ce billet permettra à ceux qui auraient des
éléments d&amp;rsquo;explication de poster un commentaire.&lt;br /&gt;Pour cela, comparons une régression logistique faite avec deux outils différents, sous SAS,&lt;br style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;ul&gt;&lt;li style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;avec la procédure logistique&lt;/li&gt;
&lt;/ul&gt;
Le code pour faire une régression logistique ressemble à ça&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;PROC LOGISTIC DATA=base_logistq;&lt;br /&gt;FORMAT age_soc f2_ageso.;&lt;br /&gt;CLASS sexe_soc age_soc fract_paiemt;&lt;br /&gt;MODEL SPOCAM = sexe_soc age_soc fract_paiemt / selection=stepwise;&lt;br /&gt;RUN; QUIT;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;ce qui donne la sortie suivante (je passe l&amp;rsquo;introduction pour insister sur les coefficients)&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The LOGISTIC Procedure&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Analyse des estimations de la vraisemblance maximum&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Erreur&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Khi 2&lt;br /&gt;&amp;nbsp; Paramètre&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DF&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimation&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; std&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; de Wald&amp;nbsp;&amp;nbsp;&amp;nbsp; Pr &amp;gt; Khi 2&lt;br /&gt;&lt;br /&gt;&amp;nbsp; Intercept&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.7833&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0676&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 696.9022&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;.0001&lt;br /&gt;&amp;nbsp; sexe_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Femme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.2429&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0619&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15.4237&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;.0001&lt;br /&gt;&amp;nbsp; age_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1_AGESOC_-60&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.4578&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0667&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 47.1020&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;.0001&lt;br /&gt;&amp;nbsp; fract_paiemt Annuel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6021&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0997&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36.4862&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;.0001&lt;br /&gt;&amp;nbsp; fract_paiemt Mensuel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.5410&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0842&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 41.2342&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;.0001&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;avec la procédure genmod (car la régression logistique est un glm)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
On peut faire exactement la même chose (théoriquement) en ajustement un modèle&amp;nbsp;GLM,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;PROC GENMOD DATA=base_logistq;&lt;br /&gt;FORMAT age_soc f2_ageso.;&lt;br /&gt;CLASS sexe_soc age_soc fract_paiemt;&lt;br /&gt;MODEL SPOCAM = sexe_soc age_soc fract_paiemt / dist = binomial;&lt;br /&gt;RUN;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;et la sortie ressemble à ça&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The GENMOD Procedure&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Analyse des résultats estimés de paramètres&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Erreur&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wald 95Limites&lt;br /&gt;Paramètre&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DF&amp;nbsp;&amp;nbsp; Estimation&amp;nbsp;&amp;nbsp; standard&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; de confiance %&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Khi 2&lt;br /&gt;Intercept&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.5073&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1501&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.2131&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.8014&amp;nbsp;&amp;nbsp;&amp;nbsp; 100.85&lt;br /&gt;sexe_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Femme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.4859&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1237&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.7284&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.2434&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15.42&lt;br /&gt;sexe_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Homme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;br /&gt;age_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1_AGESOC_-60&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.9156&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1334&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6542&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.1771&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 47.10&lt;br /&gt;age_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Z_AGESOC_+60&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;br /&gt;fract_paiemt&amp;nbsp;&amp;nbsp; Annuel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6634&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1770&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3165&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0104&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14.05&lt;br /&gt;fract_paiemt&amp;nbsp;&amp;nbsp; Mensuel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.4798&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1510&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.7759&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.1838&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10.09&lt;br /&gt;fract_paiemt&amp;nbsp;&amp;nbsp; Semestriel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;br /&gt;Scale&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0000&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;comparaison des deux sorties&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Si on regarde l&amp;rsquo;impact du sexe par exemple, dans la première sortie on peut lire&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;&amp;nbsp; sexe_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Femme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.2429&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0619&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15.4237&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;.0001&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;alors que dans la seconde sortie, on a&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;sexe_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Femme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.4859&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1237&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.7284&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.2434&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15.42&lt;br /&gt;sexe_soc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Homme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;On
dira ce qu&amp;rsquo;on veut, mais moi je trouve cette différence troublante....
Dans la seconde sortie, le coefficient vaut le double de l&amp;rsquo;autre....&lt;br /&gt;Alors
SAS semble s&amp;rsquo;y retrouver car si on lui demande d&amp;rsquo;afficher le score
prédit pour un individu au hasard (le premier de la base par exemple),
les prédictions sont très proches,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial; color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; font-family: Georgia;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fract_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proba1_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proba1_&lt;br /&gt;&amp;nbsp; Obs&amp;nbsp; sexe_soc&amp;nbsp;&amp;nbsp; age_soc&amp;nbsp; paiemt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPOCAM&amp;nbsp; proba1_logit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Homme&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 71&amp;nbsp; Annuel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.10242637&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.10241302&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Si
quelqu&amp;rsquo;un sait interpréter ce qui est fait avec cette procédure
logistique (car R donne la même chose que la sortie GLM), je suis
preneur.....&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.sas-villliers2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/div&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Statistique de l'assurance STT6705V, partie 4</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/22/Statistique-de-l-assurance-STT6705V%2C-partie-4</link>
    <guid isPermaLink="false">urn:md5:1c7534227132e4f6486bdcc2c02413b1</guid>
    <pubDate>Wed, 22 Sep 2010 03:15:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>actuariat 10/11 STT6705V</category>
        <category>actuariat</category><category>Poisson</category><category>surdispersion</category><category>UdM</category>    
    <description>    &lt;p&gt;On continue le cours avec la fin sur la modélisation de la fréquence, où on parlera de surdispersion (évoquée &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2009/12/05/De-la-surdispersion-des-nombres&quot;&gt;ici&lt;/a&gt; par exemple), de quasi-lois (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2009/06/30/Vraisemblance%2C-quasi-vraisemblance%2C-ou-pseudo-vraisemblance&quot;&gt;ici&lt;/a&gt; ou&amp;nbsp;&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/03/26/Attention-au-quasi-lois....&quot;&gt;là&lt;/a&gt;), de régression binomiale négative (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/09/10/Mod%C3%A8les-GLM-et-variables-qualitatives&quot;&gt;ici&lt;/a&gt;), ou de modèles à inflation de zéros (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/07/22/Bonus-malus-et-non-d%C3%A9laration-de-sinistres&quot;&gt;là&lt;/a&gt;
par exemple). Et si ça ne suffit pas, on commencera à parler de la
modélisation des coûts individuels. Les lois de bases seront les lois lognormales, et gamma,&lt;/p&gt;
&lt;p id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/logngammma.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Les transparents seront bientôt en
ligne &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-udm-220910.pdf&quot;&gt;ici&lt;/a&gt;.&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;p id=&quot;media-original-image&quot;&gt;&lt;img style=&quot;width: 467px; height: 252px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/tumblr_l7jonbY3DU1qzs867o1_500.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/div&gt;Dans le prochain billet, je mettrais les liens vers les bases de
données &amp;nbsp;pour le projet d&amp;rsquo;économétrie. Sinon pour les rappels de la
semaine dernière, je renvoie Sinon pour les rappels de la
semaine dernière, je renvoie &lt;a href=&quot;http://www.diffusionvideo.umontreal.ca/statistiques/15sept2010/1/&quot;&gt;ici&lt;/a&gt;
et &lt;a href=&quot;http://www.diffusionvideo.umontreal.ca/statistiques/15sept2010/2/&quot;&gt;l&lt;/a&gt;&lt;a href=&quot;http://www.diffusionvideo.umontreal.ca/statistiques/15sept2010/2/&quot;&gt;à&lt;/a&gt;.&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Espérance de vie à la naissance, ou à 65 ans ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/14/Esp%C3%A9rance-de-vie-%C3%A0-la-naissance%2C-ou-%C3%A0-65-ans</link>
    <guid isPermaLink="false">urn:md5:ca8a43e4cb88f7a08880095f682dbdc0</guid>
    <pubDate>Tue, 14 Sep 2010 20:21:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>65 ans</category><category>CRAN</category><category>demography</category><category>démographie</category><category>espérance de vie</category><category>naissance</category><category>R</category><category>retraite</category>    
    <description>    &lt;p&gt;
Bon, je vais faire un rapide billet pour répondre à un commentaire qui avait
été posté &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/03/Esp%C3%A9rance-de-vie-et-retraite#c39500&quot;&gt;ici&lt;/a&gt;,
qui remettait en cause mes
conclusions (ce qui ne me gêne pas, loin de là, c&amp;rsquo;est
comme ça qu&amp;rsquo;on va faire avancer les choses), et surtout demandait des
informations complémentaires. J&amp;rsquo;avais un peu forcé le trait en
affirmant que &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;une personne de 70 ans vivra à peine plus longtemps - en moyenne -
qu’une personne de 70 ans en 1950&lt;/span&gt;&quot;
(c&amp;rsquo;est peut être le cas pour les centenaires, mais je n&amp;rsquo;ai pas de
données), mais le but de mon précédant billet était de montrer que les
gains sont beaucoup plus faibles que pour les plus jeunes.&lt;br /&gt;J&amp;rsquo;ai
décidé de refaire l&amp;rsquo;étude, de manière plus
claire peut être, et plus complète. Et en utilisant des données de l&amp;rsquo;INED, qui est une source a priori fiable de données.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Les données (détaillées)&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
Comme je le disais, tout d&amp;rsquo;abord, les données: je prends ici les
données de l&amp;rsquo;INED (et pas de http://mortalityorg). On peut trouver en
ligne (au format xls) des données de population par âge et par sexe, &lt;a href=&quot;http://www.ined.fr/cdrom_vallin_mesle/Donnees-de-base/Populations/Tableau-I-C-1.xls&quot;&gt;ici&lt;/a&gt;
(populations par âge, de 0 à 100 ans, au premier janvier,
de 1899 à 1998, selon le territoire couvert par la statistique
des décès, ensemble des deux sexes, avec depuis 1946, les
données INSEE et avant 1946, des reconstitutions
intercensitaires (Vallin, 1973)). Et &lt;a href=&quot;http://www.ined.fr/cdrom_vallin_mesle/Donnees-de-base/Deces/Tableau-I-B-1.xls&quot;&gt;là&lt;/a&gt;,
on a les données du nombre de décès par âge
et par sexe (décès par âge et par
génération, de 1899 à 1997, ensemble des deux
sexes, avec pour les moins de 100 ans, depuis 1907, décès
hors pertes militaires (SGF, puis INSEE), pour les années
de&amp;nbsp;guerre&amp;nbsp;: décès (INSEE + estimations des pertes
militaires (Vallin, 1973)) et entre 1899 et 1906&amp;nbsp;: décès
par âge de l&amp;rsquo;INSEE, répartition entre les triangles de
Lexis (Vallin, 1973). Pour les centenaires, jusqu&amp;rsquo;en 1967&amp;nbsp;: SGF, INSEE
+ répartitions estimées par les auteurs, et depuis 1968&amp;nbsp;:
INSEE (extrait d&amp;rsquo;enregistrements individuels fournis par l&amp;rsquo;INSEE dans
le cadre d&amp;rsquo;un avenant à la convention INED-INSEE)). Voilà
pour les données, ou presque....&lt;br /&gt;
Par paresse, et pour pouvoir partager les données plus facilement, j&amp;rsquo;ai mis en ligne des fichiers csv sur ma page. &lt;br /&gt;
Les données (brutes) contiennent des colonnes sans
intérêt, que je me suis permis de virer. Sinon dans la
base des populations, certaines lignes ont été supprimées car en 1914 il
y avait deux populations, sur territoire d&amp;rsquo;avant 1914 (sans
l&amp;rsquo;Alsace-Lorraine: Moselle, Bas-Rhin,
Haut-Rhin), et le territoire sans opérations militaires
(manquent, outre l&amp;rsquo;Alsace-Lorraine: Aisne, Ardennes, Marne,
Meurthe-et-Moselle, Meuse, Nord, Oise, Pas-de-Calais, Somme et Vosges).
C&amp;rsquo;est cette dernière qui est retenues dans la base des
décès c&amp;rsquo;est donc cette dernière que l&amp;rsquo;on utilisera
pour calculer l&amp;rsquo;exposition.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; tabB=read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/tabB.csv&quot;,&lt;br /&gt;
+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sep=&quot;;&quot;,header=FALSE)&lt;br /&gt;
&amp;gt; ANNEE=tabB[,1]&lt;br /&gt;
&amp;gt; BASEB=tabB[,seq(2,246,by=2)]&lt;br /&gt;
&amp;gt; BASEB=BASEB[,1:100]&lt;br /&gt;
&amp;gt; tabC=read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/tabC.csv&quot;,&lt;br /&gt;
+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sep=&quot;;&quot;,header=FALSE)&lt;br /&gt;
&amp;gt; BASEC=tabC[,2:101]&lt;br /&gt;
&amp;gt; BASEC=BASEC[-c(16,23,43,48,51,53),]&amp;nbsp;&lt;br /&gt;
&amp;gt; BASEC=BASEC[1:nrow(BASEB),]&lt;br /&gt;
&amp;gt; AGE=0:99&lt;/span&gt;&lt;/span&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Les taux de décès (population entière)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Commençons par calculer, et tracer les taux de
décès, qui sont les ratios entre les nombres de
décès et la population totale.&lt;br /&gt;
Mon premier point (pour répondre au commentaire) est que si l&amp;rsquo;on
regarde un peu la surface, les gains en terme de taux de
mortalité instantanés sont plus importants à la
naissance (courbe &lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt;) qu&amp;rsquo;à des âges beaucoup plus élevés, comme 90 ans (en &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;bleu&lt;/span&gt;) voire à 65 ans (en &lt;span style=&quot;font-weight: bold; color: rgb(51, 204, 0);&quot;&gt;vert&lt;/span&gt;),&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;table style=&quot;text-align: left; width: 100px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;&lt;img style=&quot;width: 220px; height: 177px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.mortalite03_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;img style=&quot;width: 220px; height: 177px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.mortalite04_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;p&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.mortalite05_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Un peu de prospective&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Comme on le voit, sur nos données, on est limité car on
n&amp;rsquo;a qu&amp;rsquo;un siècle de données, et c&amp;rsquo;est donc délicat
de suivre les espérances de vie.&lt;br /&gt;
Le plus simple est alors de reprendre ce que j&amp;rsquo;avais fait (en ligne &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/06/03/Esp%C3%A9rance-de-vie-et-retraite&quot;&gt;ici&lt;/a&gt;), utilisons les fonctions de Rob Hyndman, en ligne sur son blog (&lt;a href=&quot;http://robjhyndman.com/software/demography/&quot;&gt;là&lt;/a&gt;), mais sur nos données (la dernière fois j&amp;rsquo;avais utilisé les siennes).&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; library(demography)&lt;br /&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: forecast&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: fracdiff&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;This is forecast 2.05 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: rainbow&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: hdrcde&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: locfit&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: akima&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: lattice&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;locfit 1.5-6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2010-01-20 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: ash&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: ks&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: KernSmooth&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;KernSmooth 2.23 loaded&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Copyright M. P. Wand 1997-2009&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: mvtnorm&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;hdrcde 2.13 loaded&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Attachement du package&amp;nbsp;: &amp;rsquo;hdrcde&amp;rsquo;&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: MASS&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: pcaPP&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: cluster&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Le chargement a nécessité le package&amp;nbsp;: ftsa&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;This is demography 1.03 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Il y a eu 13 avis (utilisez warnings() pour les visionner)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
Commençons par mettre les données au bon format. Pour des raisons numériques, je suis &lt;em&gt;obligé&lt;/em&gt;
de me débarrasser des âges élevés pour lesquels j&amp;rsquo;ai pu avoir une
population nulle, ou pour lesquels j&amp;rsquo;ai des valeurs manquantes. J&amp;rsquo;ai
donc exclu les âges supérieurs à 90 ans,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; donnees = demogdata(data=t(as.matrix(BASEB[,1:90]))/t(as.matrix(BASEC[,1:90])),&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pop= t(as.matrix(BASEC[,1:90])),&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ages=AGE[1:90], &lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; years=ANNEE, &lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=&quot;mortality&quot;, label=&quot;France&quot;, name=&quot;total&quot;, lambda=0)&lt;br /&gt;&amp;gt; donnees&amp;nbsp; &lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Mortality data for France&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Series: total&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Years: 1899 - 1997&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ages:&amp;nbsp; 0 - 89&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Ensuite, on peut reprendre le code que j&amp;rsquo;avais fait. Notons qu&amp;rsquo;on
utiliser ici une modélisation à la Lee et Carter, ce qui
a été utilisée par l&amp;rsquo;INED pour extrapoler
certaines données dans la table.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; france.LC2 &amp;lt;- lca(donnees,adjust=&quot;dt&quot;,series=&quot;total&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; france.fcast &amp;lt;- forecast(france.LC2)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; L2 &amp;lt;- lifetable(france.fcast)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; ex2=L2$ex&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; L1=lifetable(donnees,series=&quot;total&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; ex1=L1$ex&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Pour l&amp;rsquo;espérance de vie &lt;em&gt;à la naissance&lt;/em&gt;,
et son évolution dans le temps, si on regarde les gains moyens année
après année, on voit que l&amp;rsquo;on gagne, en moyenne, 1/4 d&amp;rsquo;espérance de
vie, &amp;nbsp;soit 3 mois par an (comme dans mon précédant billet),&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; age=0&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; ex=c(ex1[age+1,],ex2[age+1,])&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; plot(1899:2047,ex,col=&quot;blue&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; I=(1950:2000)-1898&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; y=ex[I]&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; x=1950:2000&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; lm(y~x)&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;lm(formula = y ~ x)&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; -421.0384&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2549&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; abline(lm(y~x),col=&quot;red&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; points(x,y,pch=19,col=&quot;red&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.esp-vie-naissance-bis_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On
notera qu&amp;rsquo;en utilisant les autres méthodes d&amp;rsquo;estimation, j&amp;rsquo;obtiens la
même pente. En revanche, si je regarde l&amp;rsquo;espérance de vie résiduelle à
65 ans, elle n&amp;rsquo;est plus que de 0,16 années, soit moins de deux mois
chaque années,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; age=65&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; ex=c(ex1[age+1,],ex2[age+1,])&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; plot(1899:2047,ex,col=&quot;blue&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; I=(1950:2000)-1898&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; y=ex[I]&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; x=1950:2000&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; lm(y~x)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;lm(formula = y ~ x)&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; -295.6812&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1612&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; abline(lm(y~x),col=&quot;red&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; points(x,y,pch=19,col=&quot;red&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.esp-vie-65-bis_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Dit
autrement, entre un bébé qui nait en 1975 et un bébé qui nait en 1995,
il y a un gain d&amp;rsquo;environ 6 ans d&amp;rsquo;espérance de vie, passant de 81,8 ans
à 87,7, alors que pour une personne qui atteignait les 65 ans en 1975,
il avait 22 ans à vivre encore, en moyenne, contre &lt;em&gt;seulement &lt;/em&gt;26,5
pour une personne de 65 ans en 1995. Donc je peux maintenir ce que
j&amp;rsquo;affirmais la dernière fois, sur d&amp;rsquo;autres données.... En fait, si on
veut être plus précis, on peut précisément regarder l&amp;rsquo;évolution de la
pente, correspondant au gain moyen d&amp;rsquo;espérance de vie chaque année,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.esperance-vie-pente-bis_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
de considérables progrès ont été effectués en terme de gains
d&amp;rsquo;espérance de vie, mais beaucoup plus sur les jeunes que sur les
personnes plus âgées...&lt;br /&gt;&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Modèles GLM et variables qualitatives</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/11/Mod%C3%A8les-GLM-et-variables-qualitatives</link>
    <guid isPermaLink="false">urn:md5:5ed71276325715773bd5221f2d3ef9aa</guid>
    <pubDate>Sat, 11 Sep 2010 23:49:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>actuariat 10/11 STT6705V</category>
        <category>exposition</category><category>facteurs</category><category>factor</category><category>GLM</category><category>log</category><category>marges</category><category>poisson</category><category>qualitatives</category><category>rstats</category>    
    <description>    &lt;p&gt;Suite à une question lors du cours de mercredi dernier (et comme Brice
m&amp;rsquo;a posé exactement la même par mail tout à l&amp;rsquo;heure), je vais faire un
rapide billet sur les liens entre &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;modèle(s) GLM sur variable(s) qualitative(s)&lt;/span&gt;&quot; (exclusivement) et &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;moyenne par classe&lt;/span&gt;&quot;.&lt;br /&gt;Ce
que je disais en classe, c&amp;rsquo;est qu&amp;rsquo;en tarification, faire des GLM sur
des données exclusivement qualitatives, c&amp;rsquo;était équivalent à calculer
la moyenne par modalités (par classe tarifaire finalement). J&amp;rsquo;en avais
déjà parlé dans un billet sur la &lt;em&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;méthode des marges&lt;/span&gt;&lt;/em&gt; (car c&amp;rsquo;est de ça qu&amp;rsquo;on parle en fait), &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2009/06/08/La-%22m%C3%A9thode-des-marges%22&quot;&gt;ici&lt;/a&gt;.
Mais ici, je voulais illustrer ce point sur un exemple (ou plutôt
plusieurs exemples), afin d&amp;rsquo;expliquer ce que j&amp;rsquo;entendais pas &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;c&amp;rsquo;est la même chose&lt;/span&gt;&quot;...&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;en présence d&amp;rsquo;une unique variable qualitative&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Bon, commençons par simuler un jeu de données pour faire de l&amp;rsquo;économétrie...&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; set.seed(1)&lt;br /&gt;&amp;gt;&amp;nbsp; X = as.factor(sample(c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;),size=1000,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=TRUE,prob=c(.4,.3,.2,.1)))&lt;br /&gt;&amp;gt;&amp;nbsp; F=data.frame(X=c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;))&lt;br /&gt;&amp;gt;&amp;nbsp; M = rep(NA,1000)&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;A&quot;]=1&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;B&quot;]=1.5&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;C&quot;]=2&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;D&quot;]=2.5&lt;br /&gt;&amp;gt;&amp;nbsp; Z = rexp(1000,rate=M)&lt;br /&gt;&amp;gt;&amp;nbsp; Y = rpois(1000,Z)&lt;br /&gt;&amp;gt;&amp;nbsp; base=data.frame(X,Y) &lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; table(base)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp; Y&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp; 8&amp;nbsp; 11&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; A 188 102&amp;nbsp; 62&amp;nbsp; 28&amp;nbsp; 12&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 1&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; B 169&amp;nbsp; 69&amp;nbsp; 22&amp;nbsp; 20&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; C 140&amp;nbsp; 39&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; D&amp;nbsp; 85&amp;nbsp; 17&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Le &lt;em&gt;bon&lt;/em&gt; modèle est un modèle de Poisson avec un lien logarithmique.... Regardons déjà ce que sont les moyennes par modalités,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; mean(Y[X==&quot;A&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 1.091358&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; mean(Y[X==&quot;B&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.7628866&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; mean(Y[X==&quot;C&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.3969072&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; mean(Y[X==&quot;D&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.3272727&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Pour comparer avec des modèles GLM, commençons par le &lt;em&gt;bon&lt;/em&gt; modèle,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1.0913580 0.7628866 0.3969072 0.3272727&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;ce
qui est exactement ce que nous avions, en moyenne, par classes. Que se
passe-t-il si on se trompe de modèle&amp;thinsp;? par exemple avec une autre
fonction lien,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; reg=glm(Y~X,data=base,family=poisson(link=&quot;identity&quot;))&lt;br /&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1.0913580 0.7628866 0.3969072 0.3272727 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;et si on change aussi la loi, là aussi on retombe sur la moyenne par modalité...&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; reg=glm(Y~X,data=base,family=gaussian(link=&quot;identity&quot;))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1.0913580 0.7628866 0.3969072 0.3272727&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;On peut aussi tenter une régression binomiale négative par exemple,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; library(MASS)&lt;br /&gt;&amp;gt; reg=glm.nb(Y~X,data=base) &lt;br /&gt;&amp;gt;&amp;nbsp;predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1.0913580 0.7628866 0.3969072 0.3272727 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Moralité, on retrouve la même chose avec les deux approches: moyenne par modalité, ou GLM.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;en présence d&amp;rsquo;une unique variable qualitative et d&amp;rsquo;une exposition différente&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
En
pratique, si on cherche à modéliser la fréquence individuelle de
sinistres, il convient de prendre en compte l&amp;rsquo;exposition (c&amp;rsquo;est à dire
le fait que le nombre de sinistres observés dans la base n&amp;rsquo;a pas été
obtenu sur une année complète, mais parfois quelques mois).
Classiquement, le nombre de sinistres sera supposé proportionnel à
cette exposition. Considérons la base suivante,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; set.seed(1)&lt;br /&gt;&amp;gt;&amp;nbsp; X = as.factor(sample(c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;),size=1000,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=TRUE,prob=c(.4,.3,.2,.1)))&lt;br /&gt;&amp;gt;&amp;nbsp; E = runif(1000)&lt;br /&gt;&amp;gt;&amp;nbsp; F=data.frame(X=c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;))&lt;br /&gt;&amp;gt;&amp;nbsp; M = rep(NA,1000)&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;A&quot;]=1&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;B&quot;]=1.5&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;C&quot;]=2&lt;br /&gt;&amp;gt;&amp;nbsp; M[X==&quot;D&quot;]=2.5&lt;br /&gt;&amp;gt;&amp;nbsp; Z = rexp(1000,rate=M/E)&lt;br /&gt;&amp;gt;&amp;nbsp; Y = rpois(1000,Z)&lt;br /&gt;&amp;gt;&amp;nbsp; base=data.frame(X,Y) &lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; table(base)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp; Y&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp; 7&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; A 287&amp;nbsp; 76&amp;nbsp; 24&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 1&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; B 222&amp;nbsp; 44&amp;nbsp; 17&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; C 156&amp;nbsp; 29&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; D&amp;nbsp; 90&amp;nbsp; 15&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Les moyennes empiriques par modalité doivent être pondérées par ces expositions. Le plus simple est de &quot;&lt;em&gt;normaliser&lt;/em&gt;&quot;,
en modifiant les données pour les passer sur une base annuelle (en
divisant par l&amp;rsquo;exposition), puis en attribuant des poids proportionnels
à cette exposition,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; weighted.mean(Y[X==&quot;A&quot;]/E[X==&quot;A&quot;],E[X==&quot;A&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 1.001059&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; weighted.mean(Y[X==&quot;B&quot;]/E[X==&quot;B&quot;],E[X==&quot;B&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.6973345&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; weighted.mean(Y[X==&quot;C&quot;]/E[X==&quot;C&quot;],E[X==&quot;C&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.5110974&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; weighted.mean(Y[X==&quot;D&quot;]/E[X==&quot;D&quot;],E[X==&quot;D&quot;])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.5758276&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Comme
l&amp;rsquo;exposition est supposée intervenir de manière proportionnelle (i.e.
multiplicative), il est logique de supposer un lien logarithmique, et
si l&amp;rsquo;on considère une loi de Poisson, on obtient (en faisant une
prédicition pour une exposition d&amp;rsquo;un an)&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; base=data.frame(X,Y,E) &lt;br /&gt;&amp;gt;&amp;nbsp; F=data.frame(X=c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;),E=1)&lt;br /&gt;&amp;gt;&amp;nbsp; reg=glm(Y~X+offset(log(E)),data=base,family=poisson(link=&quot;log&quot;))&lt;br /&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1.0010593 0.6973345 0.5110974 0.5758276 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Bref,
encore une loi les résultats sont identiques. Mais, si on fait une
régression binomiale négative, on obtient des résultats légèrement
différents (0,17%, 0,03%, 1,02% et 3,40% respectivement), mais il ne
sont pas égaux,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; reg=glm.nb(Y~X+offset(log(E)),data=base)&lt;br /&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;0.9993223 0.6975693 0.5163053 0.5562640 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Autrement dit, si on doit prendre en compte une exposition, les deux méthodes ne coïncident plus.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;en présence de plusieurs variables qualitatives&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Pour conclure, regardons ce qui se passe avec deux variables qualitatives,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; set.seed(1)&lt;br /&gt;&amp;gt;&amp;nbsp; X1 = as.factor(sample(c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;),size=1000,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=TRUE,prob=c(.4,.3,.2,.1)))&lt;br /&gt;&amp;gt;&amp;nbsp; X2 = as.factor(sample(c(&quot;H&quot;,&quot;F&quot;),size=1000,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=TRUE,prob=c(.6,.4)))&lt;br /&gt;&amp;gt;&amp;nbsp; M = rep(NA,1000)&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;A&quot;)&amp;amp;(X2==&quot;H&quot;)==TRUE]=1&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;B&quot;)&amp;amp;(X2==&quot;H&quot;)==TRUE]=1.5&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;C&quot;)&amp;amp;(X2==&quot;H&quot;)==TRUE]=2&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;D&quot;)&amp;amp;(X2==&quot;H&quot;)==TRUE]=2.5&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;A&quot;)&amp;amp;(X2==&quot;F&quot;)==TRUE]=1.1&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;B&quot;)&amp;amp;(X2==&quot;F&quot;)==TRUE]=1.4&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;C&quot;)&amp;amp;(X2==&quot;F&quot;)==TRUE]=2.1&lt;br /&gt;&amp;gt;&amp;nbsp; M[(X1==&quot;D&quot;)&amp;amp;(X2==&quot;F&quot;)==TRUE]=2.7&lt;br /&gt;&amp;gt;&amp;nbsp; Z = rexp(1000,rate=M)&lt;br /&gt;&amp;gt;&amp;nbsp; Y = rpois(1000,Z)&lt;br /&gt;&amp;gt;&amp;nbsp; base=data.frame(Y,X1,X2) &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Bon, on a compris l&amp;rsquo;idée, je vais me contenter de faire les calculs pour deux types d&amp;rsquo;individus,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp; mean(Y[(X1==&quot;A&quot;)&amp;amp;(X2==&quot;H&quot;)==TRUE])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.9227642&lt;/span&gt;&lt;br /&gt;&amp;gt;&amp;nbsp;&amp;nbsp; mean(Y[(X1==&quot;C&quot;)&amp;amp;(X2==&quot;F&quot;)==TRUE])&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.4473684&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Si on fait une régression sur les deux facteurs, on obtient &lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; F=data.frame(X1=rep(c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;),2),X2=rep(c(&quot;H&quot;,&quot;F&quot;),each=4))&lt;br /&gt;&amp;gt;&amp;nbsp; reg=glm(Y~X1+X2,data=base,family=poisson(link=&quot;log&quot;))&lt;br /&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;0.9081317 0.6647936 0.4915430 0.3998411 0.9723245 0.7117857 0.5262885 0.4281045 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Les résultats sont différents des moyennes empiriques, tout simplement car on suppose ici les facteurs multiplicatifs,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; summary(reg)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;glm(formula = Y ~ X1 + X2, family = poisson(link = &quot;log&quot;), data = base)&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error z value Pr(&amp;gt;|z|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept) -0.02807&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.06824&amp;nbsp; -0.411 0.680851&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X1B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.31191&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.08759&amp;nbsp; -3.561 0.000369 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X1C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.61384&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11336&amp;nbsp; -5.415 6.12e-08 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X1D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.82032&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.15778&amp;nbsp; -5.199 2.00e-07 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X2H&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.06830&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.07587&amp;nbsp; -0.900 0.368009&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Dispersion parameter for poisson family taken to be 1)&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null deviance: 1581.6&amp;nbsp; on 999&amp;nbsp; degrees of freedom&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Residual deviance: 1525.5&amp;nbsp; on 995&amp;nbsp; degrees of freedom&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;AIC: 2489.6&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Number of Fisher Scoring iterations: 6&lt;/span&gt;&lt;br /&gt;&amp;gt; exp(coefficients(reg)[5])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; X2H &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;0.93398 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Autrement dit, pour un homme, je prédis&amp;nbsp;toujours être 6,4% inférieur à
une femme. Or il n&amp;rsquo;y a pas de raison que les deux facteurs
interviennent indépendamment... il faut donc plutôt regarder le produit
cartésien des modalités,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt;&amp;nbsp; predict(reg,newdata=F,type=&quot;response&quot;)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;0.9227642 0.6416185 0.5423729 0.3243243 0.9496855 0.7457627 0.4473684 0.5833333 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;On
a alors 8 modalités possibles (le croisement des modalités de chacune
des variables), et cette fois, on retombe sur les moyennes par classes.&lt;br /&gt;Moralité,
les GLM sur des facteurs peuvent coïncider avec les moyennes empiriques
par classes, mais à condition de le faire en suivant quelques règles
(en particulier croiser &lt;em&gt;toutes &lt;/em&gt;les modalités mais aussi faire attention à l&amp;rsquo;exposition).&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Ramadan, entre le sexe et la faim...</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/10/Ramadan%2C-entre-le-sexe-et-la-faim...</link>
    <guid isPermaLink="false">urn:md5:f469a855b34c15d82327b9db7957f973</guid>
    <pubDate>Fri, 10 Sep 2010 14:35:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>algérie</category><category>faim</category><category>google</category><category>maroc</category><category>pakistan</category><category>porno</category><category>ramadan</category><category>sexe</category><category>trends</category>    
    <description>    &lt;p&gt;Dans un précédant billet (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/09/09/%C3%A0-quoi-%C3%A7a-sert-de-faire-des-statistiques&quot;&gt;ici&lt;/a&gt;)
je volais un dessin de Martin Vidberg qui parlait de google et de
statistiques... Google trend est un outil magique pour noter des
tendances et faire des statistiques simples et marrantes. Par exemple,
puisque le &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(204, 0, 0);&quot;&gt;ramadan&lt;/span&gt; touche à sa fin, on peut regarder ce qui
motivent les algériens pendant le ramadan. Manifestement, le &lt;span style=&quot;font-style: italic; color: rgb(204, 0, 0); font-weight: bold;&quot;&gt;sexe&lt;/span&gt; n&amp;rsquo;est pas une priorité, que ce soit en anglais,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+sex&amp;amp;ctab=0&amp;amp;geo=dz&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 221px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.ramadan-sex-algeria_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
ou en français,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+sexe&amp;amp;ctab=0&amp;amp;geo=dz&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 222px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.ramadan-sexe-algeria_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
De manière générale, le mot clé le plus
tapé sous google a tendance à se faire tout petit pendant
la période du ramadan, alias &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;porno&lt;/span&gt;,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+porno&amp;amp;ctab=0&amp;amp;geo=dz&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 219px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.ramadan-porno-algerie_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
En fait, on cherche un peu moins les &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;femmes&lt;/span&gt; sur le net,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+femme&amp;amp;ctab=0&amp;amp;geo=dz&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 220px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.ramadan-femme-algerie_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
Par contre, visiblement, on a faim, et on veut bien manger: &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(204, 0, 0);&quot;&gt;cuisine&lt;/span&gt; explose pendant le ramadan,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+cuisine&amp;amp;ctab=0&amp;amp;geo=dz&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 222px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.ramadan-cuisine-algeria_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
On peut aussi regarder les autres pays à forte population musulmane, et observer des tendances similaires, comme le Maroc,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+sex&amp;amp;ctab=0&amp;amp;geo=ma&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 221px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.maroc-ramadan-sex_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
les Émirats Arabes Unis,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+sex&amp;amp;ctab=0&amp;amp;geo=ae&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 221px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.emirats-ramadan-sex_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
ou encore le Pakistan,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/trends?q=ramadan%2C+sex&amp;amp;ctab=0&amp;amp;geo=pk&amp;amp;date=all&amp;amp;sort=0&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 221px;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.pakistan-ramadan-sex_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
(dans ce dernier cas, on observe un fort retour du mot clé &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;sex&lt;/span&gt;une
fois le ramadan passé... une espèce de manque virtuel). Bref, avec
Google, on peut vraiment observer des choses intéressantes... non&amp;thinsp;?&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Le million ! le milllion !</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/09/Le-million-%21-le-milllion-%21</link>
    <guid isPermaLink="false">urn:md5:2cd4497704303470adfd4c270ec1e1c5</guid>
    <pubDate>Thu, 09 Sep 2010 16:08:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Informatique / R</category>
        <category>ARIMA</category><category>Barney</category><category>blog</category><category>CRAN</category><category>forecast</category><category>fréquentation</category><category>Google</category><category>R</category>    
    <description>    &lt;p&gt;Hier soir (ou ce matin, je suis perdu avec ce décalage horaire) Christelle me demandait de parler un peu de prévision avec R (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2009/12/11/D%C3%A9mographie-avec-R%2C-suite#c145498&quot;&gt;ici&lt;/a&gt;).
Au lieu de renvoyer vers l&amp;rsquo;aide en ligne, penons un exemple pratique
(et simple, voire si possible intéressant): la fréquentation d&amp;rsquo;un blog
(en l&amp;rsquo;occurrence &lt;a style=&quot;color: rgb(204, 0, 0); font-weight: bold;&quot; href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/&quot;&gt;http://blogperso.univ-rennes1.fr/arthur.charpentier/&lt;/a&gt;). Considérons le nombre de &lt;em&gt;pages vues&lt;/em&gt;, par jour, selon Google Analytics. &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; base=read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/million.csv&quot;,&lt;br /&gt;+ sep=&quot;;&quot;,header=TRUE&lt;br /&gt;)&amp;gt; X=base$nombre&lt;br /&gt;&amp;gt; D0=as.Date(&quot;08/11/2008&quot;,&quot;%d/%m/%Y&quot;)&lt;br /&gt;&amp;gt; D=D0+1:length(X)&lt;br /&gt;&amp;gt; plot(D,X)&lt;br /&gt;&amp;gt; plot(acf(X,lag=90))&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;La série a l&amp;rsquo;allure suivante (oui, le compteur n&amp;rsquo;a été installé qu&amp;rsquo;il y a deux ans),&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.google-blog_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Les autocorrélations montre une forte saisonnalité hebdomadaire, avec &lt;del&gt;moins&lt;/del&gt; plus (cf &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/09/Le-million-%21-le-milllion-%21#c39426&quot;&gt;ici&lt;/a&gt;) de consultations en semaine que le week-end,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.google-blog-acf_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
La question que l&amp;rsquo;on cherche à résoudre est &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;ai-je une chance d&amp;rsquo;atteindre le million de pages vues d&amp;rsquo;ici la fin de l&amp;rsquo;année&amp;thinsp;?&lt;/span&gt;&quot;.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.millemilliards_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On peut traduire cette question de deux manières&lt;br /&gt;&lt;ul&gt;&lt;li&gt;quelle est la probabilité que le 1er janvier, j&amp;rsquo;ai atteint le million de pages vues,&lt;/li&gt;
&lt;li&gt;quelle est la probabilité que la date où le million de pages vues sera atteint soit avant le 1er janvier&lt;/li&gt;
&lt;/ul&gt;
Une fois formalisée la question, reste à faire un peu d&amp;rsquo;économétrie. &lt;br /&gt;&lt;ul style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt; modélisation économétrique&lt;/li&gt;
&lt;/ul&gt;
En
faisant simple et rapide, afin de prendre en compte la corrélation
forte avec la semaine précédente, et le fait que l&amp;rsquo;on s&amp;rsquo;intéresse à la
somme cumulée, on peut considérer un modèle ARIMA&lt;br /&gt;&lt;ul&gt;&lt;li&gt;avec un retard d&amp;rsquo;ordre 7 pour les composantes moyennes mobiles et autorégressives,&lt;/li&gt;
&lt;li&gt;avec une série intégrée à l&amp;rsquo;ordre 1,&lt;/li&gt;
&lt;/ul&gt;
L&amp;rsquo;ajustement se fait de la manière suivante,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; X=cumsum(base$nombre)&lt;br /&gt;&amp;gt; model&amp;nbsp; &amp;lt;- arima(X,c(7 ,&amp;nbsp;&amp;nbsp; # partie AR &lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1,&amp;nbsp;&amp;nbsp;&amp;nbsp; # partie I&lt;br /&gt;+&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 7))&amp;nbsp;&amp;nbsp; # partie MA&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;et la prévision se fait via&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; forecast &amp;lt;- predict(model,200) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ensuite, ce n&amp;rsquo;est qu&amp;rsquo;une représentation graphique,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; u=max(D)+1:200&lt;br /&gt;&amp;gt; polygon(&amp;nbsp; c(u,rev(u)),&amp;nbsp; c(forecast$pred - 1.96*forecast$se,&lt;br /&gt;+ &amp;nbsp;rev(forecast$pred + 1.96*forecast$se)), col = &quot;yellow&quot;,&amp;nbsp;border=NA)&lt;br /&gt;&amp;gt; lines(u,forecast$pred,col=&quot;blue&quot;,lwd=2)&lt;br /&gt;&amp;gt; lines(u,forecast$pred- 1.96*forecast$se,col=&quot;blue&quot;,lty=2)&lt;br /&gt;&amp;gt; lines(u,forecast$pred+ 1.96*forecast$se,col=&quot;blue&quot;,lty=2)&lt;br /&gt;&amp;gt; abline(v=as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;),col=&quot;red&quot;)&lt;br /&gt;&amp;gt; abline(h=1000000,col=&quot;red&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.million-model1-prevision_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Afin de répondre à la question posée, on peut étudier les différentes probabilités envisagées,&lt;br /&gt;&lt;ul style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt; probabilité que le 1er janvier, j&amp;rsquo;ai atteint le million de pages vues&lt;/li&gt;
&lt;/ul&gt;
Dans
un premier temps, on utilise la normalité des prédictions (en supposant
une normalité du bruit) pour obtenir la loi de la prédiction à une date
quelconque,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; k=which(u==as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;))&lt;br /&gt;&amp;gt; x=seq(800000,1100000,by=100)&lt;br /&gt;&amp;gt; y=dnorm(x,mean=forecast$pred[k],sd=forecast$se[k])&lt;br /&gt;&amp;gt; plot(x,y,type=&quot;l&quot;,lwd=2)&lt;br /&gt;&amp;gt; x0=x[x&amp;gt;=1000000]&lt;br /&gt;&amp;gt; polygon(&amp;nbsp; c(x0,rev(x0)),&amp;nbsp;c(y[x&amp;gt;=1000000],rep(0,length(x0))), col = &quot;yellow&quot;,border=NA)&lt;br /&gt;&amp;gt; lines(x,y,type=&quot;l&quot;,lwd=2)&lt;br /&gt;&amp;gt; abline(v=1000000)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.million-model1-density_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;Le cas de la probabilité d&amp;rsquo;atteindre plus d&amp;rsquo;un million de visiteur le 1er janvier est alors&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; k=which(u==as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;))&lt;br /&gt;&amp;gt; 1-pnorm(1000000,mean=forecast$pred[k],sd=forecast$se[k])&lt;br /&gt;[1] 0.2604821&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;problème dual,&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
Dans
un second temps, on peut envisager une autre approche, consistant à se
demander quelle pourrait être la loi de la date du jour où le million
de pages vues sera atteint,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; P=rep(NA,300)&lt;br /&gt;&amp;gt; for(k in 1:300){&lt;br /&gt;+ P[k]=1-pnorm(1000000,mean=forecast$pred[k],sd=forecast$se[k])}&lt;br /&gt;&amp;gt; plot(max(D)+1:300,P,type=&quot;l&quot;,lwd=2)&lt;br /&gt;&amp;gt; x=max(D)+1:300&lt;br /&gt;&amp;gt; x0=x[x&amp;lt;=as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;)]&lt;br /&gt;&amp;gt; polygon(&amp;nbsp; c(x0,rev(x0)),&amp;nbsp;c(P[x&amp;lt;=as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;)],rep(0,length(x0))),&amp;nbsp; col = &quot;yellow&quot;,&amp;nbsp;border=NA)&lt;br /&gt;&amp;gt; lines(max(D)+1:300,P,type=&quot;l&quot;,lwd=2)&lt;br /&gt;&amp;gt; abline(v=as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;))&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.an-model1-density_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
La probabilité que cette date soit antérieure au 1er janvier est alors&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; P[u==as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;)]&lt;br /&gt;[1] 0.2604821&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;(ce
qui, fort heureusement, correspond à la probabilité calculée par le
problème primal). Bref, j&amp;rsquo;ai 1 chance sur 4 d&amp;rsquo;atteindre le million de
pages vues avant la nouvelle année....&lt;ul style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;sensibilité à un changement de modèle&lt;/li&gt;
&lt;/ul&gt;
C&amp;rsquo;est
bien joli tout ça, mais ces calculs sont largement soumis à la
contrainte du choix de modèle que j&amp;rsquo;ai fait arbitrairement au début...
on peut se demander si en changeant de modèle, les résultats changent
sensiblement, ou pas. Au lieu de tenter un autre modèle ARIMA (voire
SARIMA), j&amp;rsquo;ai préféré changer la série de référence... et me focaliser
sur 2010 uniquement. D&amp;rsquo;un côté j&amp;rsquo;enlève les premières semaines où le
niveau de fréquentation était très faible, de l&amp;rsquo;autre, je donne un
poids très important aux vacances d&amp;rsquo;été, i.e. la période juin-août,
pendant laquelle les internautes semblent moins sensibles à la
modélisation économétrique.&lt;br /&gt;Si l&amp;rsquo;on modélise la fréquentation pour 2010, seulement, on obtient&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.million-model2-prevision_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
avec les distributions suivantes, tout d&amp;rsquo;abord pour la densité du nombre de visiteur atteint au 1er janvier 2011,&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.million-model2-density_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et pour la fonction de répartition de la date où sera atteint le million de pages vues,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.an-model2-density_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;soit une probabilité de l&amp;rsquo;ordre de 35%, dans les deux cas,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; P[u==as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;)]&lt;br /&gt;[1] 0.3531648&lt;br /&gt;&amp;gt; k=which(u==as.Date(&quot;01/01/2011&quot;,&quot;%d/%m/%Y&quot;))&lt;br /&gt;&amp;gt; 1-pnorm(1000000,mean=forecast2$pred[k],sd=forecast2$se[k])&lt;br /&gt;[1] 0.3531648&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On
obtient des probabilités relativement proches avec les deux modèles, et
j&amp;rsquo;aurais&amp;nbsp;envie de croire que l&amp;rsquo;objectif est envisageable.... &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;challenge accepted&lt;/span&gt;&quot;
comme dirait mon ami Barney Stinson (oui, c&amp;rsquo;est mon ami). Reste juste à
trouver des sujets qui attireront du monde en cette fin d&amp;rsquo;année...</description>
    
    
    
      </item>
    
  <item>
    <title>Statistique de l'assurance STT6705V, partie 2</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/09/06/Statistique-de-l-assurance-STT6705V%2C-partie-2</link>
    <guid isPermaLink="false">urn:md5:f762a249a484e2e3aff0eb0eb21b8d63</guid>
    <pubDate>Mon, 06 Sep 2010 23:24:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>actuariat 10/11 STT6705V</category>
        <category>actuariat</category><category>cours</category><category>GLM</category><category>vidéo</category>    
    <description>    &lt;p&gt;Après un long week end - fête du travail oblige - alors que les
étudiants Rennais reprenaient le chemin de la fac, on va poursuivre le
cours de statistique de l&amp;rsquo;assurance. Ce &lt;em&gt;premier &lt;/em&gt;cours permettra de présenter un peu la théorie des modèles&amp;nbsp;GLM, les &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;modèles linéaires généralisés&lt;/span&gt;,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.math03_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
le but sera de survoler la théorie, en insistant sur leur utilisation en assurance. Les transparents seront mis en ligne&amp;nbsp;&lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-udm-080910.pdf&quot;&gt;ici&lt;/a&gt; mercredi, un peu avant le cours.&lt;br /&gt;Pour
les étudiants Rennais, j&amp;rsquo;avais envoyé un lien (ou plutôt fait envoyé,
donc consulté vos mails) pour voir les 3 heures d&amp;rsquo;introduction qui
avait été filmées la semaine dernière (cf &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/08/30/Statistique-de-l-assurance-STT6705V%2C-partie-1&quot;&gt;ici&lt;/a&gt;). Pour des raisons de droits d&amp;rsquo;auteur, je crois que je ne suis pas autorisé à donner le lien (mais je vais me renseigner).&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.essai-video-UdM_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;Je vous encourage à aller passer 3 heures devant votre ordinateur avant le cours de mercredi&lt;sup style=&quot;color: rgb(204, 51, 204);&quot;&gt;1&lt;/sup&gt;....&lt;/p&gt;
&lt;img style=&quot;width: 100px; height: 97px; float: left;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/.fb1a857d9c5e8de718ddf54498e956df70ca7315_m_t.jpg&quot; alt=&quot;&quot; /&gt;côté
programmation, j&amp;rsquo;ai mis un peu de code R en ligne afin d&amp;rsquo;importer les
bases que l&amp;rsquo;on utilisera au cours des premières session, et les mettre
un peu en fome.....&lt;span style=&quot;font-family: Georgia;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; sinistreUdM &amp;lt;- read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/sinistreUdM.txt&quot;,&lt;br /&gt;+ header=TRUE,sep=&quot;;&quot;)&lt;br /&gt;&amp;gt; sinistres=sinistreUdM[sinistreUdM$garantie==&quot;1RC&quot;,]&lt;br /&gt;&amp;gt; nrow(sinistres)&lt;br /&gt;&amp;gt; contratUdM &amp;lt;- read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/contratUdM.txt&quot;,&lt;br /&gt;+ header=TRUE,sep=&quot;;&quot;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A partir de ces deux bases, on peut récupérer le nombre de sinistres, par police,&lt;span style=&quot;font-family: Georgia;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; T=table(sinistres$nocontrat)&lt;br /&gt;&amp;gt; T1=as.numeric(names(T))&lt;br /&gt;&amp;gt; T2=as.numeric(T)&lt;br /&gt;&amp;gt; nombre1 = data.frame(nocontrat=T1,nbre=T2)&lt;br /&gt;&amp;gt; I = contratUdM$nocontrat%in%T1&lt;br /&gt;&amp;gt; T1=contratUdM$nocontrat[I==FALSE]&lt;br /&gt;&amp;gt; nombre2 = data.frame(nocontrat=T1,nbre=0)&lt;br /&gt;&amp;gt; nombre=rbind(nombre1,nombre2)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;.... et voilà, on peut commencer,&lt;span style=&quot;font-family: Georgia;&quot;&gt;&amp;nbsp;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; base = merge(contratUdM,nombre)&lt;br /&gt;&amp;gt; head(base)&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt; nocontrat exposition zone puissance agevehicule ageconducteur bonus&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.87&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 56&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 115&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.72&amp;nbsp;&amp;nbsp;&amp;nbsp; D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 121&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.05&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 37&amp;nbsp;&amp;nbsp;&amp;nbsp; 55&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 142&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.90&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 155&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.12&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 59&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 186&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.83&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 75&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp; marque carburant densite region nbre&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 93&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 54&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 93&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 73&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;p style=&quot;color: rgb(153, 51, 153);&quot;&gt;&lt;sup&gt;1&lt;/sup&gt; de toutes façons, la rentrée des séries télés n&amp;rsquo;a pas commencé....&amp;nbsp;il faudra attendre 2 semaines avant que &lt;em&gt;How I Met Your Mother&lt;/em&gt; ne reprenne, ainsi que &lt;em&gt;House&lt;/em&gt;, &lt;em&gt;Dexter&lt;/em&gt; ou encore &lt;em&gt;The Big Bang Theory &lt;/em&gt;. Bref, pas d&amp;rsquo;excuse (pour l&amp;rsquo;instant), il n&amp;rsquo;y a rien d&amp;rsquo;autre à la télé....&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Statistique de l'assurance STT6705V, partie 1</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/31/Statistique-de-l-assurance-STT6705V%2C-partie-1</link>
    <guid isPermaLink="false">urn:md5:3e62173ef557eb6b95a4fbb425a47983</guid>
    <pubDate>Tue, 31 Aug 2010 04:05:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>actuariat 10/11 STT6705V</category>
        <category>actuariat</category><category>plan</category><category>Rennes1</category><category>STT 6705V</category><category>UdM</category><category>visio</category>    
    <description>    &lt;p&gt;Le premier cours &amp;nbsp;commencera mercredi, pavillon &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Roger Gaudry&lt;/span&gt;, salle &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;S116&lt;/span&gt;.
Le premier cours ne sera pas transmis en visio-conférence (la rentrée
des masters à Rennes n&amp;rsquo;ayant lieu que la semaine prochaine). Ce cours
proposera une introduction au cours qui aura lieu tous les mercredis
matins pendant la session d&amp;rsquo;automne. Les transparents du premier cours
sont en ligne &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-udm-010910.pdf&quot;&gt;ici&lt;/a&gt;. Pour les prochains cours, je mettrais en avance les lignes le code que j&amp;rsquo;utiliserais.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.climat-froid-montreal_tumblr_l77n4vO6VS1qzdi59o1_500_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Sinon
pour le barème, il y aura deux mini-projets (25-25) de provisionnement
et de mortalité, et un plus gros (50) de tarification. Le cours se
basera sur R, mais pour les amateurs de SAS (ou autre), je suis
ouvert....</description>
    
    
    
      </item>
    
  <item>
    <title>Passer des cassettes aux mp3</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/22/Passer-des-cassettes-aux-mp3</link>
    <guid isPermaLink="false">urn:md5:2b1f90a9ba4f3a5109ba30e64e4ac31f</guid>
    <pubDate>Sun, 22 Aug 2010 22:25:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>cassette</category><category>CD</category><category>doublon</category><category>mp3</category><category>random</category><category>shuffle</category>    
    <description>    &lt;p&gt;Plus le temps passe, plus j&amp;rsquo;ai l&amp;rsquo;impression d&amp;rsquo;être un dinosaure....
Lorsque j&amp;rsquo;étais jeune, j&amp;rsquo;écoutais de la musique sur des cassettes&lt;sup&gt;&lt;span style=&quot;color: rgb(204, 51, 204);&quot;&gt;1&lt;/span&gt;&lt;/sup&gt;. Je me souviens même avoir été enchanté par l&amp;rsquo;arrivée du premier walkman &lt;em&gt;réversible&lt;/em&gt;:
on n&amp;rsquo;était alors plus obligé de tourner la cassette au bout de 20
minutes. Quand soudain, à la fin des années 80 est arrivé le &lt;em&gt;compact disc&lt;/em&gt;, et les lecteurs avec leur fonction &lt;strong&gt;Random&lt;/strong&gt;, ou &lt;strong&gt;Shuffle&lt;/strong&gt;.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.PlaylistPhoto_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
J&amp;rsquo;aurais
du me douter que je tournerais mal parce que je me souviens avoir joué
avec la platine de mes parents, en essayant de voir si la &lt;em&gt;première&lt;/em&gt; chanson pouvait passer en premier avec une lecture aléatoire, mais aussi la &lt;em&gt;seconde &lt;/em&gt;pouvait
passer juste après. Bon, avec le recul, je me rends compte que j&amp;rsquo;ai du
beaucoup user la platine parce qu&amp;rsquo;avec un disque de 10 titres, il faut
90 (ou 100) essais (en moyenne) pour qu&amp;rsquo;une lecture aléatoire commence
effectivement par 1 et 2. C&amp;rsquo;est d&amp;rsquo;ailleurs à ce moment que j&amp;rsquo;ai aussi
découvert les tirages &lt;em&gt;avec&lt;/em&gt; et &lt;em&gt;sans &lt;/em&gt;remises: avec certaines platines, on ne pouvait pas obtenir deux fois le même titre, alors que d&amp;rsquo;autres oui.&lt;br /&gt;Puis
sont arrivés les lecteurs mp3, où on n&amp;rsquo;avait plus 10 titres tirés au
hasard, mais 200 voire 1000. Et l&amp;rsquo;autre jour en courant, je me suis
posé les mêmes questions que lorsque j&amp;rsquo;étais tout petit (oui, je suis
un dinosaure, mais j&amp;rsquo;étais jeune à cette époque): si le lecteur propose
une fonction &lt;em&gt;random&lt;/em&gt; avec remise, combien de chansons dois-je attendre, en moyenne, avant de réentendre une chanson que j&amp;rsquo;avais déjà entendu&amp;thinsp;?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;De la probabilité d&amp;rsquo;entendre deux fois une chanson&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Pour faire un peu formel, supposons que mon lecteur contienne&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp301.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp301.png&quot; /&gt; chansons.&lt;br /&gt;La probabilité de n&amp;rsquo;avoir &lt;em&gt;aucune &lt;/em&gt;répétition sur&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp302.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp302.png&quot; /&gt; lectures (on suppose&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp303.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp303.png&quot; /&gt;) est &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp304.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp304.png&quot; /&gt;&lt;/div&gt;qui correspond aussi au nombre d&amp;rsquo;arrangements de&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp302.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp302.png&quot; /&gt; éléments parmi&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp301.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp301.png&quot; /&gt;, divisé par&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp305.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp305.png&quot; /&gt;, soit&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp306.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp306.png&quot; /&gt;&lt;/div&gt;Si le ratio est faible (ou n est grand), on peut utiliser l&amp;rsquo;approximation&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp307.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp307.png&quot; /&gt; et donc la probabilité s&amp;rsquo;approche par&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp308.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp308.png&quot; /&gt;&lt;/div&gt;soit tout simplement - toujours en cherchant une approximation - une probabilité de n&amp;rsquo;avoir &lt;em&gt;aucune &lt;/em&gt;répétition de&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp309.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp309.png&quot; /&gt;&lt;/div&gt;Si on se donne une probabilité de n&amp;rsquo;avoir aucune répétition de&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp310.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp310.png&quot; /&gt;, alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp311.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp311.png&quot; /&gt;&lt;/div&gt;Avec &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp301.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp301.png&quot; /&gt;=200 chansons sur mon lecteur mp3, en jouant 17 titres, j&amp;rsquo;ai environ 1
chance sur 2 d&amp;rsquo;avoir au moins un titre joué deux fois. Et 17 chansons,
ça correspond à ce que j&amp;rsquo;écoute en faisant mon jogging.... Bref, le
temps de faire mon jogging, j&amp;rsquo;ai 1 chance sur 2 d&amp;rsquo;entendre un titre
deux fois.&lt;br /&gt;Mais que se passerait-il si je tenais le raisonnement inverse&amp;thinsp;?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Problème dual et jogging interminable....&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Autrement
dit, combien de temps vais-je courir si je décide de m&amp;rsquo;arrêter lorsque
j&amp;rsquo;entends (pour la première fois) un titre pour la seconde fois&amp;thinsp;? En
fait, Donald Knuth en parle un peu dans son livre &lt;em&gt;the art of computer programming&lt;/em&gt;:
on peut montrer que l&amp;rsquo;espérance du nombre de titres qu&amp;rsquo;il faudra jouer
pour avoir une première répétition parmi n titres est de la forme&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp312.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp312.png&quot; /&gt;&lt;/div&gt;qui admet un développement asymptotique&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp33333.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/mp33333.png&quot; /&gt;&lt;/div&gt;soit,
toujours avec 200 titres dans mon lecteur, une vingtaine de titres à
jouer, en moyenne. Ce qui rallongera un peu mon jogging, finalement...&lt;span style=&quot;font-family: Georgia;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; n=200&lt;br /&gt;&amp;gt; sqrt(2*n*log(2))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 16.65109&lt;/span&gt;&lt;br /&gt;&amp;gt; 1+sqrt(pi*n/2)-1/3+1/12*sqrt(pi/2*n)-4/135/n&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 19.8681&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Formellement, le premier correspond à une médiane, alors que le second à une espérance. Ce qui explique la différence. &lt;br /&gt;Notons que si mon jogging &lt;em&gt;classique&lt;/em&gt; dure la durée de 17 titres, la probabilité d&amp;rsquo;avoir un jogging deux fois plus long est quand même d&amp;rsquo;une chance sur 10,&lt;span style=&quot;font-family: Georgia;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; k=31&lt;br /&gt;&amp;gt; exp(-k*(k-1)/(2*n))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.09778344&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&amp;gt; sqrt(2*n*log(1/.01))&lt;/span&gt;&lt;br /&gt;[1] 42.91932&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;autrement
dit,&amp;nbsp;j&amp;rsquo;ai une chance sur 100 (ce qui devrait donc arriver une fois dans
l&amp;rsquo;année, en moyenne) de courir pendant 43 chansons... qui vont me
paraître très très longues....&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 51, 204);&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;
je passais mon temps l&amp;rsquo;oreille sur la radio (car j&amp;rsquo;ai connu les
premières radios libres, comme on disait alors), prêt à enregistrer dès
qu&amp;rsquo;une super chanson passait.. je me souviens avoir guetter des jours
durant le passage de &lt;em&gt;you spin me around &lt;/em&gt;(&lt;a href=&quot;http://www.youtube.com/watch?v=ZUatnbaNfEo&quot;&gt;ici&lt;/a&gt;) que mes élèves (qui n&amp;rsquo;ont pas connu cette époque) ou les cinéphiles connaissent probablement seulement sous la version &lt;em&gt;right round &lt;/em&gt;(&lt;a href=&quot;http://www.youtube.com/watch?v=CcCw1ggftuQ&quot;&gt;là&lt;/a&gt;) qui a abondamment samplé le thème. Oui, je suis un dinosaure..&lt;br /&gt;&lt;/span&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Des étés pluvieux en Bretagne ? une réalité statistique...</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/21/Des-%C3%A9t%C3%A9s-pluvieux-en-Bretagne-une-r%C3%A9alit%C3%A9-statistique...</link>
    <guid isPermaLink="false">urn:md5:02ded9376126fa74e6e51fad5ceb0b9e</guid>
    <pubDate>Sat, 21 Aug 2010 15:32:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Climat</category>
        <category>Bretagne</category><category>chi-deux</category><category>corrélation</category><category>indépendance</category><category>Marseille</category><category>Paris</category><category>pluie</category><category>Rennes</category><category>été</category>    
    <description>    &lt;p&gt;Pour compléter le précédant billet (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/08/16/En-Bretagne,-il-fait-beau-plusieurs-fois-par-jour&quot;&gt;ici&lt;/a&gt;) on peut se demander en quoi la Bretagne est différente des autres régions françaises... &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.pluie_camion_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nous avions vu &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/08/16/En-Bretagne,-il-fait-beau-plusieurs-fois-par-jour&quot;&gt;ici&lt;/a&gt; le niveau de précipitation moyen, jour après jours pendant les mois d&amp;rsquo;été, en Bretagne. A Rennes. En revanche, à &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Paris&lt;/span&gt; on obtient la moyenne suivante,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.pluie-ete-paris_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
que l&amp;rsquo;on peut comparer à &lt;span style=&quot;color: rgb(204, 0, 0); font-weight: bold;&quot;&gt;Marseille&lt;/span&gt;,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.pluie-ete-marseille_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
ou encore à&amp;nbsp;&lt;span style=&quot;color: rgb(204, 0, 0); font-weight: bold;&quot;&gt;Strasbourg&lt;/span&gt;,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.pluie-ete-strasbourg_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Sur la figure ci-dessous, on voit que la probabilité d&amp;rsquo;avoir de la pluie à &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Paris&lt;/span&gt; (au sens au moins 0.1 mm d&amp;rsquo;eau dans la journée, en trait gras &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;bleu&lt;/span&gt;, au moins 2 mm d&amp;rsquo;eau dans la journée, en trait &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;bleu&lt;/span&gt;) est supérieure à la probabilité d&amp;rsquo;avoir de la pluie à Rennes (respectivement en&lt;span style=&quot;font-weight: bold; color: rgb(51, 204, 255);&quot;&gt; bleu clair&lt;/span&gt; gras, et en &lt;span style=&quot;color: rgb(51, 204, 255);&quot;&gt;bleu clair&lt;/span&gt; fin)&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.proba-pluie-paris-glm_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On est certes très au dessus de &lt;span style=&quot;color: rgb(204, 0, 0); font-weight: bold;&quot;&gt;Marseille&lt;/span&gt;,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.proba-pluie-marseille-glm_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
mais très en dessous de &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Strasbourg&lt;/span&gt;,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.proba-pluie-strasbourg-glm_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Mais au delà des lois marginales, ces villes sont différentes de la Bretagne si l&amp;rsquo;on regarde les &lt;strong&gt;matrices de transition&lt;/strong&gt;. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Transition d&amp;rsquo;un jour sur l&amp;rsquo;autre&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Pour &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Rennes&lt;/span&gt;, si
on regarde jour après jour, on obtient&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;1955&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;612&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;2567&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;606&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;723&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1329&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;76,15 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;23,85 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;45,60 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;54,40 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Pour &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Paris&lt;/span&gt;, la probabilité de transition jour après jour a la forme suivante&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;2689&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;959&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;3648&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;946&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;1466&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;2412&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;73,71 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;26,29 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;39,22 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;60,78 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Pour &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Marseille&lt;/span&gt;, la probabilité de transition jour après jour a la forme suivante&lt;/div&gt;&lt;/div&gt;&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;2527&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;375&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;2902&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;362&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;216&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;578&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;87,08 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;12,92 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;62,63 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;37,37 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Pour&amp;nbsp;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Strasbourg&lt;/span&gt;, la probabilité de transition jour après jour a la forme suivante&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;31&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;128&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;159&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;132&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;1464&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1596&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;19,50 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;80,50 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;8,27 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;91,73 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Transition d&amp;rsquo;une semaine sur l&amp;rsquo;autre&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Si en revanche on regarde les matrices de transition semaine par semaine, on a des résultats assez différents. Une &lt;em&gt;bonne &lt;/em&gt;semaine signifie aucun jour avec plus de 2 dm de pluie.&lt;br /&gt;Pour &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Rennes&lt;/span&gt;, si
on regarde semaine après semaine&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;379&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;25&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;404&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;26&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;7&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;33&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;93,81 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;6,19 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;78,79 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;21,21 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Pour &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Paris&lt;/span&gt;, la probabilité de transition&amp;nbsp;semaine après semaine a la forme suivante&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;576&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;46&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;622&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;53&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;4&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;57&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;92,60 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;7,40 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;92,98 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;7,02 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Pour &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Marseille&lt;/span&gt;, la probabilité de transition&amp;nbsp;semaine après semaine a la forme suivante&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;274&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;59&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;333&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;47&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;9&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;56&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;82,28 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;17,72 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;83,93 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;16,07 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Pour&amp;nbsp;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Strasbourg&lt;/span&gt;, la probabilité de transition&amp;nbsp;semaine après semaine a la forme suivante&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;1494&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;614&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;2018&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;613&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;939&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1552&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;70,87 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;29,13 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;39,50 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;60,50 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Les tests du chi deux, d&amp;rsquo;indépendance d&amp;rsquo;une semaine sur l&amp;rsquo;autre donnent&lt;img style=&quot;width: 128px; height: 170px; float: right;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/k2510835.jpg&quot; alt=&quot;&quot; /&gt;&lt;ul&gt;&lt;li&gt;à Rennes,&amp;nbsp;une statistique du chi-deux de 8,054, soit une p-value de 0,45%&lt;/li&gt;
&lt;li&gt;à Paris,&amp;nbsp;une statistique du chi-deux de 0,025, soit une p-value de 87,26%&lt;/li&gt;
&lt;li&gt;à Marseille, une statistique du chi-deux de 0,012, soit une p-value de 91,24%&lt;/li&gt;
&lt;li&gt;à Strasbourg, une statistique du chi-deux de 0,7649, soit une p-value de 38,18%&lt;/li&gt;
&lt;/ul&gt;
autrement dit l&amp;rsquo;hypothèse d&amp;rsquo;indépendance est acceptée partout, sauf à Rennes....&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Moralité&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
De
manière assez paradoxale, on prétend que la Bretagne a un temps
changeant, et pour reprendre le titre du précédant billet,
effectivement, en Bretagne, il peut faire beau plusieurs fois p&lt;img style=&quot;width: 128px; height: 170px; float: left;&quot; src=&quot;http://freakonometrics.blog.free.fr/public/perso/k2902112.jpg&quot; alt=&quot;&quot; /&gt;ar jour.
Mais sur le long terme, d&amp;rsquo;une semaine sur l&amp;rsquo;autre, le temps est au
contraire très corrélé, contrairement aux autres régions. A Paris,
Marseille ou Strasbourg, qu&amp;rsquo;il ait fait beau, ou qu&amp;rsquo;il ait plu la
semaine précédente, cela n&amp;rsquo;apporte aucune information sur la
probabilité d&amp;rsquo;avoir de la pluie la semaine où l&amp;rsquo;on vient en
vacances.... Mais pas en Bretagne: manifestement, il existe donc des
étés pourris, où il pourra pleuvoir toutes les semaines, et des étés
superbes où il ne pleut jamais....</description>
    
    
    
      </item>
    
  <item>
    <title>En Bretagne, il fait beau plusieurs fois par jour</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/23/En-Bretagne%2C-il-fait-beau-plusieurs-fois-par-jour</link>
    <guid isPermaLink="false">urn:md5:9eb026e31888561c7b98b0f0b1fe0975</guid>
    <pubDate>Sat, 21 Aug 2010 09:27:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Climat</category>
        <category>Bretagne</category><category>chaîne</category><category>Markov</category><category>pluie</category><category>Rennes</category>    
    <description>    &lt;p&gt;bon, et à l&amp;rsquo;occasion il peut pleuvoir un peu.... Il peut donc être
intéressant pour planifier un peu ses vacances de calculer la
probabilité d&amp;rsquo;avoir de la pluie.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.rennes-centre-enfants_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Les calculs ont été fait sur les données de pluviométrie à Rennes, en ligne sur le site eca&amp;amp;d, &lt;a href=&quot;http://eca.knmi.nl/&quot;&gt;ici&lt;/a&gt; (données de qualité &lt;em&gt;gratuites&lt;/em&gt;).&lt;br style=&quot;font-weight: bold;&quot;&gt;&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;Probabilité d&amp;rsquo;avoir de la pluie, pendant les vacances d&amp;rsquo;été&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
Considérons ici la série du niveau de précipitation par jour, en par 0,1 mm, &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.pluie-rennes_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et la probabilité d&amp;rsquo;avoir de la pluie dans la journée (régression logistique),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.proba-pluie-rennes_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
il peut pleuvoir à Rennes l&amp;rsquo;été. Mais ça n&amp;rsquo;aide pas vraiment pour
planifier ses vacances. Car si ça se trouve, il y a des étés sans pluie,
et des étés où il pleut sans cesse.&lt;br style=&quot;font-weight: bold;&quot;&gt;&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;Dynamique et matrice de transition (par jour et par semaine)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
Autrement
dit, au lieu de regarder les lois marginales (comme la probabilité
d&amp;rsquo;avoir de la pluie dans la journée), on peut s&amp;rsquo;intéresser à la
dynamique de la série, modélisée sous la forme d&amp;rsquo;une chaîne de Markov.
Si on regarde jour après jour, avec les 30 mois de juillet et août
entre 1980 et 2009,&lt;br /&gt;&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;871&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;298&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;1169&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;292&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;335&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;627&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;ce qui donne les probabilités de transition suivantes,&lt;br /&gt;&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;&lt;dl&gt;&lt;dt&gt;jour&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;75,51 %&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;25,49 %&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;46,57 %&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 255, 153);&quot;&gt;53, 43 %&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;autrement, s&amp;rsquo;il fait beau aujourd&amp;rsquo;hui, on a 3 chances sur 4 d&amp;rsquo;avoir du beau temps demain.&lt;br /&gt;Si on regarde semaine après&amp;nbsp;semaine, où l&amp;rsquo;intérêt sont les semaines &lt;em&gt;sans pluie&lt;/em&gt;,&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;13&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;26&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;39&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;23&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;140&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;163&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;avec là aussi les probabilités de transition suivantes,&lt;br /&gt;&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;33,33 %&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;66,67 %&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;14,11 %&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;85,89 %&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Si on regarde semaine après&amp;nbsp;semaine, où l&amp;rsquo;intérêt sont les semaines &lt;em&gt;avec six jours sans pluie&lt;/em&gt; (on s&amp;rsquo;autorise une journée de pluie),&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;36&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;36&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;72&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;30&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;100&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;130&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;ce qui donne les probabilités de transition suivantes,&lt;br /&gt;&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;50,00 %&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;50,00 %&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;23,08 %&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;76,92 %&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
Bon, maintenant, si on pense qu&amp;rsquo;avoir 2 mm de pluie dans la journée,
c&amp;rsquo;est juste un peu d&amp;rsquo;humidité dans l&amp;rsquo;air, les matrices de transitions
sont sensiblement différentes, dans le cas où on s&amp;rsquo;autorise une journée
dans la semaine avec un peu d&amp;rsquo;humidité pour parler de &lt;em&gt;beau temps&lt;/em&gt;,
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;106&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;36&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;142&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;31&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;29&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;75,65 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;25,35 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;51,67 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;48,33 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Autrement dit, on retrouve une matrice proche de celle que nous
avions sur les données journalière: s&amp;rsquo;il a fait beau la semaine avant
de venir en Bretagne, on a 3 chances sur 4 d&amp;rsquo;avoir du beau temps. En
revanche, s&amp;rsquo;il a fait mauvais, on a une chance sur deux d&amp;rsquo;avoir beau
temps la semaine suivante.&lt;br /&gt;Si notre définition de &lt;em&gt;pluie&lt;/em&gt;
est encore plus laxiste (il faut qu&amp;rsquo;il y ait eu un déluge une journée
dans la semaine, à savoir plus de 2 cm d&amp;rsquo;eau dans la journée), alors
cette fois, on obtient,
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;3&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;171&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;12&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;183&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;14&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;5&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;130&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
ce qui donne les probabilités de transition suivantes,&lt;br /&gt;
&lt;table style=&quot;width: 100%; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;2&quot; rowspan=&quot;1&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n_1.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;1&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau&lt;/dt&gt;&lt;dt&gt;temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot; colspan=&quot;1&quot; rowspan=&quot;2&quot;&gt;
&lt;dl&gt;&lt;dt&gt;semaine&amp;nbsp;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/date-n.png&quot; alt=&quot;&quot; /&gt;&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;beau temps&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;93,44 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;6,56 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;
&lt;dl&gt;&lt;dt&gt;pluie&lt;/dt&gt;&lt;/dl&gt;
&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;73,68 %&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 153);&quot;&gt;26,32 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;Autrement dit, s&amp;rsquo;il y a eu au moins une très mauvaise journée
la semaine passée, on a 1 chance sur 4 d&amp;rsquo;en avoir également une la
semaine suivante. En revanche, s&amp;rsquo;il a fait beau tout le temps, on a
presque 95% de chances d&amp;rsquo;avoir du beau temps la semaine suivante.&lt;br /&gt;Moralité, quelle que soit la définition retenue pour définir le &lt;em&gt;beau temps&lt;/em&gt;, le temps à Rennes n&amp;rsquo;est pas indépendant d&amp;rsquo;une semaine sur l&amp;rsquo;autre: il y a manifestement des étés pluvieux, et d&amp;rsquo;autre non.</description>
    
    
    
      </item>
    
  <item>
    <title>Allez, on va fermer (temporairement...)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/08/Allez%2C-on-va-fermer-%28temporairement...%29</link>
    <guid isPermaLink="false">urn:md5:a66df0a60e0db8e897bfa930be4fb899</guid>
    <pubDate>Sun, 08 Aug 2010 01:26:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>on souffle un peu</category>
            
    <description>    &lt;p id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/note_76346.jpg.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Vitesse et comportement dangereux au volant (partie 3)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/07/Vitesse-et-comportement-dangereux-au-volant-%28partie-3%29</link>
    <guid isPermaLink="false">urn:md5:ab5e794a3f0e0958f5a101f4151cef76</guid>
    <pubDate>Sat, 07 Aug 2010 02:42:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Risques</category>
        <category>auto</category><category>distance</category><category>excès</category><category>freinage</category><category>vitesse</category>    
    <description>    &lt;p&gt;
Après plusieurs billets sur les accidents de la route (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/08/04/Nombre-de-morts-sur-la-route-en-baisse...-et-%28partie-1%29&quot;&gt;ici&lt;/a&gt; et &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/08/06/Quand-surviennent-les-accidents-de-la-route-%28partie-2%29&quot;&gt;là&lt;/a&gt;), parlons
un peu de vitesse des véhicules. J&amp;rsquo;ai pu récupérer
des données via l&amp;rsquo;inrets, d&amp;rsquo;observations près de Saclay
en région parisienne, sur une 2x2 limitée à 110
km/h.&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.n118-saclay2_m.jpg&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.n118-saclay2_m.jpg&quot; /&gt;&lt;/div&gt;
J&amp;rsquo;ai ainsi le passage de plusieurs millions de véhicules, sur quelques jours, incluant &lt;em&gt;tous&lt;/em&gt;
les véhicules. Mais si j&amp;rsquo;ai signé des papiers quant à la
confidentialité des données, je dois pouvoir mettre des dessins
construits à partir de ces données...&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;A quelle vitesse roulent les conducteurs parisiens&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img title=&quot;compteur_vitesse.jpg, août 2010&quot; style=&quot;margin: 0 0 1em 1em; float: right;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.compteur_vitesse_t.jpg&quot; /&gt;Comme
pour les accidents, distinguons semaine et week end. En semaine, on
retrouve les pics du matin et du soir, qui poussent les gens à
ralentir. La courbe en &lt;strong&gt;noir&lt;/strong&gt; est la vitesse moyenne des véhicules qui passent sur ce tronçon, et la courbe en &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;bleu&lt;/span&gt;, la vitesse des 5% des véhicules les plus rapides,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.vitesse-semaine_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Ces pics sont légèrement atténués le week end,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.vitesse-we_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
avec ici un trafic très dense tout l&amp;rsquo;après midi, entre 15&amp;nbsp;et 20 heures.
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Quelle proportion de véhicules dépasse la limite autorisée&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Comme pour les accidents, distinguons semaine et week end. En semaine, on retrouve les pics du matin et du soir, avec en &lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;gras&lt;/span&gt; la proportion des véhicules qui dépasse 110 km/h, et en trait &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;fin&lt;/span&gt;, la proportion qui dépasse 115 km/h (soit 5% de plus),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.exces-vitesse-semaines_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
avec des choses finalement assez proches le week end, &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.exces-vitesse-we_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Autrement
dit, aux heures de pointe, peu de monde dépasse la vitesse autorisée,
mais vers midi, ou surtout la nuit, environ un véhicule sur quatre
dépasse la vitesse autorisée (mais seulement un sur six la dépasse de
plus de 5%).
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Vitesse et respect des distances de sécurité&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;La
base est très complète, puisque j&amp;rsquo;ai tous les véhicules qui sont passés
près de Saclay, avec l&amp;rsquo;heure d&amp;rsquo;observation, la vitesse, ce qui permet
d&amp;rsquo;obtenir la distance entre deux véhicules qui se suivent (en supposant
que le premier véhicule maintienne sa vitesse constante).&lt;br /&gt;Rappelons qu&amp;rsquo;il existe un lien &lt;em&gt;théorique&lt;/em&gt; entre la vitesse d&amp;rsquo;un véhicule et la distance de freinage (expliqué &lt;a href=&quot;http://www.msr.lu/mmp/online/website/content/fiches_pedagogiques/physique/104/23_FR.html&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://www.ilephysique.net/forum-sujet-96548.html&quot;&gt;là&lt;/a&gt;). Pour faire simple, la distance de freinage&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein02.png&quot; /&gt; est la somme d&amp;rsquo;une distance parcourue avant de réagir &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein04.png&quot; /&gt;, et d&amp;rsquo;une distance de freinage proprement dite &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein03.png&quot; /&gt;,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein01.png&quot; /&gt;&lt;/div&gt;Si on suppose que la personne met une seconde à réagir, la distance de réaction est simplement la vitesse&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein05.png&quot; /&gt; (exprimée en m/h), i.e.&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein06.png&quot; /&gt;&lt;/div&gt;Quant au freinage à prorement parler, rappelons que les équations qui charactérisent le mouvement d&amp;rsquo;un objet sont de la forme&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein10.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein10.png&quot; /&gt;&lt;br /&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein11.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein11.png&quot; /&gt;&lt;br /&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein12.png&quot; /&gt;&lt;/div&gt;Aussi, en mettant la deuxième au carré, et en combinant avec la troisième, on a&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein13.png&quot; /&gt;&lt;/div&gt;avec&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein15.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein15.png&quot; /&gt; (on cherche à arrêter le véhicule) et &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein14.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein14.png&quot; /&gt;, aussi, avec &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein16.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein16.png&quot; /&gt;, on obtient quelque chose qui peut s&amp;rsquo;écrire&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein17.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/frein17.png&quot; /&gt;&lt;/div&gt;à
condition d&amp;rsquo;avoir des vitesses en km/h. Aussi en agglomération, il faut
23 m pour s&amp;rsquo;arrêter. Et sur notre route à Saclay, pour une personne qui
roule à 110 km/h, il faut compter 110 m (ce qui correspond au message
véhiculé par la sécurité routière).&lt;br /&gt;Sur nos données, on peut représenter en &lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt; les individus qui ne respectent pas la distance de sécurité.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.diistance-vitesse-inversion-axes_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
La courbe &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;bleue&lt;/span&gt; est la distance moyenne des véhicule en fonction de la distance qui les sépare du véhicule qui les précède,&lt;br /&gt;Aussi,
en faisant une régression logistique (lissée), on obtient que 60% des
conducteurs qui roulent entre 50 et 110 km/h ne respectent pas les
distances de sécurité.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.non-respect-distance-secutrite_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Quand surviennent les accidents de la route ? (partie 2)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/06/Quand-surviennent-les-accidents-de-la-route-%28partie-2%29</link>
    <guid isPermaLink="false">urn:md5:69a24cd10713ce8d37b80c470efb5e91</guid>
    <pubDate>Fri, 06 Aug 2010 23:33:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>accident</category><category>corporel</category><category>hiver</category><category>route</category><category>semaine</category><category>week-end</category><category>été</category>    
    <description>    &lt;p&gt;Je poursuis un peu mon étude des accidents de la route (ou pour être
plus précis, des accidents corporels, ayant causé des blessés, et ayant
fait l&amp;rsquo;objet d&amp;rsquo;un rapport de police). &lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.warhol_car_crash_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
J&amp;rsquo;avais parlé &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/08/04/Nombre-de-morts-sur-la-route-en-baisse...-et-%28partie-1%29&quot;&gt;ici&lt;/a&gt;
de la tendance de long terme, sur 6 ou 7 ans, montrant qu&amp;rsquo;il y avait
une tendance à la baisse aussi bien du nombre de tués que du nombre de
blessés grave. On avait observé que les cycles annuels avaient tendance
à diminuer également. Mais qu&amp;rsquo;en est-il des cycles à court terme&amp;thinsp;?&lt;br /&gt;En particulier, on peut se demander s&amp;rsquo;il n&amp;rsquo;existe pas des cycles dans la
journée. En semaine, l&amp;rsquo;hiver (entre novembre et début
février), on observe les tendances suivantes,&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.accident-semaine-hiver_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
(les
points sont les moyennes brutes, par tranche d&amp;rsquo;une demi heure, et la
courbe est un lissage de ces points). On distinguera les années
2002-2004 (en &lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt;) et 2004-2007 (en &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;bleu&lt;/span&gt;) Si l&amp;rsquo;on regarde les semaines l&amp;rsquo;été (entre mai et début août), on a&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.accident-semaine-ete_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Notons que si l&amp;rsquo;on compte non plus les accidents, mais les blessés
graves ou les tués (il y a généralement plusieurs victimes dans ces
accidents), on observe les cycles suivants,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.blesses-grave-hiver-semaine_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
pour l&amp;rsquo;hiver, alors que l&amp;rsquo;été,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.blesses-grave-ete-semaine_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Autrement
dit, les tendances sont les mêmes: les accidents du matin ne sont pas
moins meutriers que ceux du soir... Les week-ends, les tendances sont
assez différentes entre l&amp;rsquo;hiver et l&amp;rsquo;été, avec respectivement&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.accident-week-end-hiver_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.accident-week-end-ete_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Si l&amp;rsquo;on regarde les blessés graves et les tués, on a les cycles suivants,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.blesses-grave-hiver-we_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.blesses-grave-ete-we_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Nombre de morts sur la route en baisse... et ? (partie 1)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/05/Nombre-de-morts-sur-la-route-en-baisse...-et-%28partie-1%29</link>
    <guid isPermaLink="false">urn:md5:27270563091ca22361781e7d0f15976d</guid>
    <pubDate>Thu, 05 Aug 2010 00:22:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>accidents</category><category>corporels</category><category>France</category><category>rupture</category><category>statistiques</category>    
    <description>    &lt;p&gt;Tout le monde semble se réjouir de la baisse du nombre de morts sur la route
depuis quelques années (longtemps attribué à la
présence de radars automatiques, mais qu&amp;rsquo;on pourrait aussi associer à
l&amp;rsquo;instauration du permis à point). Et c&amp;rsquo;est tant mieux. Mais sans
vouloir jouer les
cyniques, et en tous les cas c&amp;rsquo;est une statistique qui intéresse
probablement davantage les assureurs, il peut sembler intéressant de
s&amp;rsquo;intéresser aussi aux&amp;nbsp;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;accidents
corporels graves&lt;/span&gt;....&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; id=&quot;media-original-image&quot;&gt;&lt;img style=&quot;width: 432px; height: 285px;&quot; title=&quot;image volée chez Andy Warhol&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/saupload_warhol_car_crash_green.jpg&quot; alt=&quot;image volée chez Andy Warhol&quot; /&gt;&lt;/p&gt;
Le principal soucis méthodologique est qu&amp;rsquo;au 1er janvier 2005, la définition d&amp;rsquo;accidents &lt;em&gt;graves&lt;/em&gt; ou encore de &lt;em&gt;décès&lt;/em&gt; a changé. Avant 2005, un &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;tué&lt;/span&gt;,
était une victime décédée sur le coup ou dans les six jours qui suivent
l’accident. A partir de 2005, les 6 jours passent à 30 jours. De même,
un&amp;nbsp;&lt;em&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;blessé grave&lt;/span&gt;&lt;/em&gt;&amp;nbsp;était
un blessé dont l’état nécessitait plus de six jours d’hospitalisation.
Après 2005, cette classe disparait, et seuls restent les blessés qui
ont passé plus de 24 heures à l&amp;rsquo;hôpital.... Bref, on est un peu bloqué
pour vraiment analyser les tendances sur une longue période...
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Nombre de morts sur la route&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Le graphique suivant montre le nombre quotidien de morts sur les
routes, passant d&amp;rsquo;une vingtaine en 2002 à une douzaine (en 2008).&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.deces-ruptur2e_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On notera qu&amp;rsquo;il n&amp;rsquo;y a pas eu de réelle rupture en 2005, malgré la nouvelle définition de &lt;em&gt;décès&lt;/em&gt;. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Nombre de blessés graves&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
En revanche, les statistiques sur les blessés (graves) ont connu une réelle rupture en 2005.&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.blesses-rupture_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On peut essayer de &lt;em&gt;corriger&lt;/em&gt; afin de rendre les séries comparables (au moins en terme d&amp;rsquo;ordre de grandeur),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.blesses-ru2pture-correct_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Au delà de la tendance (et de la rupture de la forte baisse observée en
2002-2004), on notera que le cycle annuel est plus faible. De la même
manière que les cycles dans les naissances semblent avoir diminué
(comme je l&amp;rsquo;évoquais &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/07/19/Davantage-de-r%C3%A9gularit%C3%A9-dans-les-naissances&quot;&gt;ici&lt;/a&gt;), on notera que le cycle dans les accidents graves (mais aussi dans une moindre mesure les décès) a fortement diminué... &lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Propriétaire ou locataire ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/04/Propri%C3%A9taire-ou-locataire</link>
    <guid isPermaLink="false">urn:md5:ce144d81bebae905d996328dc198dff3</guid>
    <pubDate>Wed, 04 Aug 2010 22:29:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Economie</category>
        <category>actualisation</category><category>locataire</category><category>propriétaire</category><category>taux</category>    
    <description>    &lt;p&gt;&lt;img title=&quot;maison15euros.jpg, août 2010&quot; style=&quot;margin: 0 0 1em 1em; float: right;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/maison15euros.jpg&quot; /&gt;Il existe une mythologie aujourd&amp;rsquo;hui bien ancrée, consistant à penser qu&amp;rsquo;il &lt;em&gt;faut &lt;/em&gt;être
propriétaire de son logement. C&amp;rsquo;est d&amp;rsquo;ailleurs le message que l&amp;rsquo;État
(c&amp;rsquo;est à dire nous tous) véhicule sur différentes affiches, comme celle
à droite. Tout le monde a déjà entendu l&amp;rsquo;adage prétendant que &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 102, 0);&quot;&gt;payer un loyer, c&amp;rsquo;est jeter de l&amp;rsquo;argent par les fenêtres&lt;/span&gt;&quot;....mais personnellement, j&amp;rsquo;ai l&amp;rsquo;impression que rembourser un crédit, c&amp;rsquo;est aussi &amp;rsquo;&quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 102, 0);&quot;&gt;jeter de l&amp;rsquo;argent par les fenêtres&lt;/span&gt;&quot;.
Dans le premier cas, c&amp;rsquo;est le propriétaire qui est derrière la fenêtre,
alors que dans le second cas c&amp;rsquo;est une banque (mais aussi un notaire,
et l&amp;rsquo;état qui récupère beaucoup d&amp;rsquo;impôt).&lt;br /&gt;Visiblement, l&amp;rsquo;État semble
avoir pris le parti qu&amp;rsquo;enrichir les propriétaires, c&amp;rsquo;est mal, alors
qu&amp;rsquo;enrichir son banquier c&amp;rsquo;est bien... &amp;nbsp;Peut être est-ce mieux dans l&amp;rsquo;&lt;em&gt;intérêt collectif&lt;/em&gt;
(car c&amp;rsquo;est le but ultime de l&amp;rsquo;État me semble-t-il) d&amp;rsquo;être tous
propriétaires&amp;thinsp;? Mais qu&amp;rsquo;en est-il de l&amp;rsquo;intérêt individuel&amp;thinsp;? Ai-je
vraiment intérêt à préférer être propriétaire plutôt que locataire&amp;thinsp;?&lt;br /&gt;On
peut essayer de faire un petit modèle simple, voire simpliste...
Considérons quelqu&amp;rsquo;un possédant un apport personnel de 100 000 € (je
mets des sommes rondes pour simplifier le modèle), et souhaitant loger
dans une maison qui vaut 300 000 €. Il a deux possibilités,&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;devenir propriétaire du bien&lt;/li&gt;
&lt;li&gt;être locataire du bien (on suppose que le choix est possible pour le même bien)&lt;/li&gt;
&lt;/ul&gt;
&lt;img title=&quot;temoignage-1.gif, août 2010&quot; style=&quot;float: right; margin: 0 0 1em 1em;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/temoignage-1.gif&quot; /&gt;Dans
le premier cas, on va supposer que qu&amp;rsquo;il est possible d&amp;rsquo;avoir un crédit
sur 20 ans pour un taux de 5,5%. On va supposer qu&amp;rsquo;il y a 10% de frais d&amp;rsquo;acquisition, entre l&amp;rsquo;agent immobilier et le notaire. On oubliera les
charges annuelles en tant que propriétaire, et les éventuels crédit
d&amp;rsquo;impôt sur les intérêts.&lt;br /&gt;Dans le second cas, il paye un loyer de 1
000 € par mois, éventuellement revalorisé (+2% par an par exemple),
mais il a la possibilité d&amp;rsquo;épargner (en plus de capitaliser ce qui
constituait l&amp;rsquo;apport initial s&amp;rsquo;il achetait).&lt;br /&gt;En fait, dans les deux
cas, il épargne. On peut partir du fait qu&amp;rsquo;il a 2 000 € allouer au
logement (ce montant peut également être revalorisé). Dans le second
cas, il peut épargner 1 000 € par mois, et dans le premier, la
différence entre les mensualités qu&amp;rsquo;il doit à la banque et les 2 000 €.
On suppose que les taux de placement sont à 4,5%.&amp;nbsp;&lt;br /&gt;Au bout de 15 ans, la maison vaut 500 000 €. Notons que la revalorisation à 2% est plus faible que la croissance de
la valeur du bien (passer de 300 à 500 en 20 ans correspond à une
valorisation annuelle de 2,5%). Le propriétaire a-t-il vraiment fait une &lt;em&gt;bonne&lt;/em&gt; affaire&amp;thinsp;?&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; capital=100000&lt;br /&gt;&amp;gt; revenu =2000&lt;br /&gt;&amp;gt; loyer&amp;nbsp; =1000&lt;br /&gt;&amp;gt; i1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =.055&lt;br /&gt;&amp;gt; i2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =.045&lt;br /&gt;&amp;gt; i3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =.02&lt;br /&gt;&amp;gt; T&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =20&lt;br /&gt;&amp;gt; maison1=300000&lt;br /&gt;&amp;gt; maison2=500000&lt;br /&gt;&amp;gt; mensualite=(maison1*1.1-capital)/sum((1+i1)^(-(1:(T*12))/12))&lt;br /&gt;&amp;gt; mensualite&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 1564.789&lt;/span&gt;&lt;br /&gt;&amp;gt; (1+i3)^T&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 1.485947&lt;/span&gt;&lt;br /&gt;&amp;gt; locataire&amp;nbsp;&amp;nbsp;&amp;nbsp; = capital*(1+i2)^T+sum((1+i3)^((1:(T*12))/12)*(revenu-loyer)*(1+i2)^((1:(T*12))/12))&lt;br /&gt;&amp;gt; proprietaire = maison2+sum((revenu-mensualite)*(1+i3)^((1:(T*12))/12)*(1+i1)^((1:(T*12))/12))&lt;br /&gt;&amp;gt; locataire&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 728274.5&lt;/span&gt;&lt;br /&gt;&amp;gt; proprietaire&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 738245.5&lt;/span&gt;&lt;br /&gt;&amp;gt; (proprietaire-locataire)/proprietaire&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.01350635&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Autrement
dit pour être propriétaire, les mensualités sont de 1 564 € par mois
(constantes), alors que le locataire aurait eu un loyer de 1 000 € initialement, revalorisé de 2% &amp;nbsp;par an, soit 1 485 € par mois sur la
fin. Bref, au final, le locataire, qui a mis 1 000 € par mois
(revalorisés là aussi à 2%) se retrouve à la tête de 728 milliers €
alors que le propriétaire a vu son bien se valoriser (et atteindre 500
milliers €), mais il a également pu épargner un peu. Bref, il se
retrouve à la tête d&amp;rsquo;un patrimoine de 738 milliers €. Ce qui est
comparable.... Moralité, on jette autant d&amp;rsquo;argent par les fenêtres dans
les deux cas, mais du point de vue de la personne qui loge dans
l&amp;rsquo;appartement, ça se vaut...&lt;br /&gt;Mais au delà des montants, on peut surtout étudier l&amp;rsquo;impact des différents paramètres....&lt;br /&gt;Le graphique ci-dessous montre l&amp;rsquo;impact du &lt;strong&gt;capital&lt;/strong&gt; initial: s&amp;rsquo;il est trop faible, être locataire est beaucoup plus intéressant,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.impact-capital-loyer-proprio_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
(les
ordonnées positives signifie que la richesse en tant que propriétaire
excède celle que l&amp;rsquo;on aurait en tant que locataire). Autrement dit,
avec un faible capital initial, il sera coûteux de devenir propriétaire.
Ici, il faut disposer d&amp;rsquo;au moins 1/3 du prix de la maison en apport.
Mais grosso modo, plus on est riche, plus on peut avoir intérêt à
devenir propriétaire. On peut aussi regarder l&amp;rsquo;impact du &lt;strong&gt;taux d&amp;rsquo;emprunt&lt;/strong&gt;,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.impact-taux-emprunt-locataire-proprio_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
(où l&amp;rsquo;on retrouve que si le taux d&amp;rsquo;emprunt est trop élevé, je n&amp;rsquo;ai aucun intérêt à emprunter) ou encore du &lt;strong&gt;revenu&lt;/strong&gt; que l&amp;rsquo;on souhaite allouer au logement,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.impact-revenu-loyer-proprio_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pour comparer l&amp;rsquo;impact de la &lt;strong&gt;durée&lt;/strong&gt;,
on va supposer que la valorisation du loyer et du salaire reste à 2%,
mais que la valorisation du bien immobilier est de 2,5% par an.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.impact-tps-loyer-proprio_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Certes,
le locataire épargne moins sur une durée courte, mais le locataire a de
telles mensualités à payer qu&amp;rsquo;il vaut mieux épargner. Bon, bien sûr la
difficulté est de supposer qu&amp;rsquo;on peut faire varier ces paramètres indépendamment les uns des autres, mais j&amp;rsquo;ai l&amp;rsquo;impression que cela
permet de &amp;nbsp;mieux comprendre &lt;em&gt;qui&lt;/em&gt; peut être intéressé pour devenir propriétaire.... en l&amp;rsquo;occurrence ceux qui ont le temps, et ceux qui ont de l&amp;rsquo;argent....&lt;br /&gt;Bref,
je laisse ceux qui le souhaite améliorer le modèle car il est ici très
(trop&amp;thinsp;?) simpliste... même s&amp;rsquo;il laisse à penser que le choix d&amp;rsquo;acheter
ou de louer n&amp;rsquo;est pas aussi simple qu&amp;rsquo;il y paraît, loin de là.....</description>
    
    
    
      </item>
    
  <item>
    <title>Importer une base SAS sous R</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/08/03/Importer-une-base-SAS-sous-R</link>
    <guid isPermaLink="false">urn:md5:73a3b7f163843f47020b4c503822d90f</guid>
    <pubDate>Tue, 03 Aug 2010 15:30:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Informatique / R</category>
        <category>CRAN</category><category>import</category><category>R</category><category>SAS</category>    
    <description>    &lt;p&gt;Depuis pas mal de temps, je reçois des bases envoyées par différentes
personnes, pour faire des stats, et si la plupart ont la bonne idée de me
les envoyer directement en format csv, malheureusement, je reçois parfois
des bases sas dont je ne sais trop que faire (car je n&amp;rsquo;ai pas sas). &lt;br /&gt;La&lt;span style=&quot;font-weight: bold; color: rgb(153, 0, 0);&quot;&gt; library(foreign)&lt;/span&gt; de R propose d&amp;rsquo;importer des bases SAS qui sont au format xport (&lt;a href=&quot;http://www.google.fr/url?sa=t&amp;amp;source=web&amp;amp;cd=2&amp;amp;ved=0CCEQFjAB&amp;amp;url=http%3A%2F%2Fcran.r-project.org%2Fweb%2Fpackages%2Fforeign%2Fforeign.pdf&amp;amp;ei=LhlYTJusBI-RjAfS2eiDCg&amp;amp;usg=AFQjCNFEbIBi-Fv-EwGzBlqFF7roXXU6lQ&amp;amp;sig2=EZzGEOw74S3-J7oqZgyVYg&quot;&gt;ici&lt;/a&gt;). Mais généralement, les données SAS sont au format&amp;nbsp;sas7bdat. Pendant l&amp;rsquo;année, j&amp;rsquo;avais l&amp;rsquo;habitude d&amp;rsquo;aller squatter &lt;em&gt;la&lt;/em&gt;
salle informatique qui dispose de SAS, pour ouvrir SAS et exporter les
données en csv. Mais avec la fermeture estivale de la faculté, j&amp;rsquo;ai été
un peu bloqué. J&amp;rsquo;ai alors découvert la version &lt;em&gt;online&lt;/em&gt;
de SAS sur l&amp;rsquo;ent de l&amp;rsquo;université. Malheureusement, il faut que les données
soient dans un répertoire sur le réseau, ce qui nécessite au préalable
d&amp;rsquo;envoyer des données sur le réseau au lieu de pointer sur un
répertoire local (ce qui peut être loin, voir impossible si la base est
trop grosse). Fort heureusement, l&amp;rsquo;autre jour, j&amp;rsquo;ai découvert,&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.sas.com/apps/demosdownloads/sassysview_PROD_8.2_downarea.jsp?productID=100693&quot;&gt;&lt;img style=&quot;border: 0 solid; width: 448px; height: 92px;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.sas-reader_m.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;On peut en effet télécharger gratuitement sur le site de&amp;nbsp;&lt;a href=&quot;http://www.sas.com/apps/demosdownloads/sassysview_PROD_8.2_downarea.jsp?productID=100693&quot;&gt;www.sas.com&lt;/a&gt; un lecteur de base, qui permet ensuite d&amp;rsquo;exporter la base en csv... et ensuite de l&amp;rsquo;importer facilement sous R... Trop facile&amp;thinsp;!</description>
    
    
    
      </item>
    
  <item>
    <title>Tempête et inondation: 1,5 milliards d'euros pour Xynthia</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/30/Temp%C3%AAte-et-inondation%3A-1%2C5-milliards-d-euros-pour-Xynthia</link>
    <guid isPermaLink="false">urn:md5:8e56b51314886556f595eb67ab8dd57f</guid>
    <pubDate>Fri, 30 Jul 2010 21:43:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Assurance</category>
        <category>cat nat</category><category>inondation</category><category>Lothar</category><category>Martin</category><category>milliards</category><category>quote-part</category><category>tempête</category><category>Xynthia</category>    
    <description>    &lt;p&gt;Les premiers rapports sur Xynthia, ses conséquences mais aussi ses causes commencent à être diffusés, comme &lt;a href=&quot;http://www.senat.fr/notice-rapport/2009/r09-554-notice.html&quot;&gt;ici&lt;/a&gt;
par exemple. Pour rappels, dans la nuit du 27 au 28 février, la tempête
Xynthia a balayé plusieurs pays européens, causant de très nombreux
dégâts en France, principalement en Charente Maritime et en Vendée. A
l’ile de Ré, des rafales de 160 km/h ont été mesurées. Mais les effets
de la tempête ont été décuplés par la présence de polders, l’océan
reprenant alors en quelques heures des territoires que l’homme croyait
s’être approprié depuis quelques siècles. Comble de malchance, cette
tempête est survenu lors des grandes marées, ce qui a de nouveau
accentué les effets&amp;nbsp;: afin de compenser la baisse de pression
atmosphérique, le niveau des océans monte davantage, créant ainsi une
surcote, et causant des inondations dès que le niveau des digues est
atteint.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.vendee-xynthia_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Ces
inondations ont causé environ 420 000 sinistres, pour un coût de 700
millions € (soit un coût moyen par sinistre de l‘ordre de 1700 €). 22
000 sinistres ont été des dommages matériels de véhicules (pour un coût
total de l’ordre de 35 millions €), 69 000 sinistres ont été des
dommages de professionnels (pour 255 millions €) et près de 330 000
sinistres ont été des dommages à des particuliers, pour mon montant
total de 425 millions d’euros. Le risque inondation est couvert par le
régime dit cat nat, instauré par la loi du 13 juillet 1982, qui est
obligatoire dans tout contrat de dommages aux biens, et qui couvre tous
les dommages causées par une «&amp;nbsp;&lt;em&gt;intensité anormale d’un agent naturel&lt;/em&gt;&amp;nbsp;»,
excepté les tempêtes. Si une commune touchée est classée comme été
victime d’une catastrophe naturelle, les habitants peuvent alors faire
jouer la garantie. Toutefois, si la commune n’a pas fait de Plan de
Prévention des Risques,. Le montant des primes d’assurance affectée par
ces catastrophes est fixé par l’Etat, ou plutôt la part de la prime
habitation (pour les particulier) qui sera affectée à la couverture du
risque, en l‘occurrence 12%: peu importe le risque réel, l’Etat impose
un mécanisme de solidarité entre les assurés. Les assureurs touchent
ainsi environ 1,3 milliards € au titre de l’ensemble des risques dit
cat nat (ce qui inclus la sécheresse ou les mouvements de terrain, en
plus des inondations). Les assureurs peuvent également souscrire un
contrat de réassurance auprès de la Caisse Centrale de Réassurance
(CCR, possédant une garantie illimitée de l‘Etat) en quote-part,
conduisant à un partage pour moitié entre l’assureur et le réassurance.
La CCR offre de plus une clause de limitation des pertes, dans le cas
où un sinistre couterait plus du double des primes encaissées. Compte
tenu du rôle central joué par la CCR, c’est cette dernière qui fournit
généralement les statistiques sur les évènements naturels.&lt;br /&gt;Les
tempêtes ont fait l’objet d’une extension obligatoire, en juin 1990,
dans tous les contrats dommage, avec une couverture qui incluse
généralement la grêle et le poids de la neige. La tempête en elle même
a causé environ 35 000 sinistres, pour un coût de 700 millions € (soit
un coût moyen par sinistre de l‘ordre de 20 000 €). Environ 10 500 de
ces sinistres sont liés à des couvertures de véhicules, avec un coût
moyen de l’ordre de 5 000 €. 5 500 ont causé des dommages à des
professionnels, pour un coût total de l’ordre de 250 millions €, alors
que 400 millions ont été affecté à 19 000 sinistres de particuliers.
Cette garantie est certes elle aussi obligatoire, mais l’Etat ne
propose plus d’intervenir, et ce sont les réassureurs privés qui
permettent aux assureurs de se couvrir contre les très grosses tempêtes
(on aura en mémoire celles de décembre 1999, dont le montant réévalué
atteint les 10 milliards €). Notons que pour couvrir le risque
tempêtes, les assureurs collectent environ 1 milliard € par an. Dans le
cas de la garantie tempête, la principale source de données est la
Fédération Française des Sociétés d’Assurance, qui collecte les données
des différentes mutuelles et compagnies d’assurance.&lt;br /&gt;Cet évènement a
marqué les esprits non seulement à cause du nombre élevé de victimes,
mais aussi car il rappelle deux évènements très similaires. Le premier
est survenu dans la nuit du 31 janvier au 1er février 1953, au Pays
Bas, où une tempête a traversé le pays à quelques jours des grandes
marées (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/03/01/Les-Pays-Bas%2C-inond%C3%A9s%2C-f%C3%A9vrier-1953&quot;&gt;ici&lt;/a&gt;).
Les digues subirent plus de 400 brèches, et plus de 500 km de digues
furent à reconstruire. Mais surtout, 1 836 personnes trouvèrent la
mort, ce qui, ramené à la population des Pays-Bas de l’époque (de
l’ordre de 10 millions d’habitants),&amp;nbsp;correspondrait – aujourd’hui – à
une catastrophe causant la mort de plus de 10 000 personnes en France
(ou plus de 60 000 aux Etats Unis). Le second est l’ouragan Katrina qui
a détruit la Nouvelle Orléans le 28 août 2005, où le raz de marée qui
est survenu au même moment a causé davantage de dégâts que les rafales
de vent (pourtant très fort). Ce risque avait été évoqué par des
ingénieurs quelques mois plus tôt.&lt;br /&gt;Le parallèle avec Katrina est
d’autant plus saisissant que, comme à la Nouvelle Orléans, on retrouve
des rapports d’experts qui évoquent la catastrophe quelques mois plus
tôt. En particulier, l’idée d’avoir un «&amp;nbsp;&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 153, 0);&quot;&gt;Plan
de Prévention des Risques de submersion marine dans l’estuaire du Lay
sur les communes de La Faute-sur-Mer et de l’Aiguillon-sur-Mer, où la
conjonction de deux phénomènes, de crue dans l’estuaire du Lay et de
submersion marine, pourrait avoir un impact très important sur les
zones densifiées à l’arrière d’un réseau de digues vieillissant&lt;/span&gt;.&amp;nbsp;» (&lt;a href=&quot;http://www.lafautesurmer.net/tag/maslin/&quot;&gt;ici&lt;/a&gt;). A La Faute-sur-Mer, «&amp;nbsp;&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 153, 0);&quot;&gt;la rupture des digues sur ce secteur engendrerait des dégâts majeurs aux biens et aux personnes&lt;/span&gt;&amp;nbsp;», ajoute le rapport en citant l&amp;rsquo;exemple des tempêtes Lothar et Martin qui «&amp;nbsp;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;ont démontré que les zones côtières pouvaient être submergées par la mer, notamment en zone estuarienne&amp;nbsp;&lt;/span&gt;».&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.article_infogfaute_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;(le graphique a été volé sur le site de 20min, &lt;a href=&quot;http://cache.20minutes.fr/img/photos/20mn/2010-03/2010-03-02/article_infogfaute.jpg&quot;&gt;ici&lt;/a&gt;). En effet, depuis les tempêtes de décembre 99, les tempêtes majeures en Europe sont jugées «&amp;nbsp;&lt;em&gt;rares&lt;/em&gt;&amp;nbsp;», mais plus «&amp;nbsp;&lt;em&gt;exceptionnelles&lt;/em&gt;&amp;nbsp;».
On a même vu des cyclones tropicaux se diriger vers l’Europe (au lieu
de se diriger vers les Amériques) comme la tempête Grace en octobre
2009 (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/01/08/Les-ouragans-en-Europe-c-est-pour-quand&quot;&gt;ici&lt;/a&gt;).
Autrement dit le risque existe. Et comme toujours quand on fait face à
un risque, deux solutions se posent à nous&amp;nbsp;: accepter de prendre le
risque, quitte éventuellement à transférer la conséquence financière à
un tiers (un assureur le plus souvent), ou tout mettre en œuvre pour le
réduire (on parlera alors de prévention). Mais encore faut-il toutefois
avoir conscience de l’existence de ces risques, en l’occurrence de
risques à long terme. Et ce n’est pas essentiel si l’on mène des
politiques à court terme.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>L'équipe de France de foot devrait jouer seulement en semaine</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/24/L-%C3%A9quipe-de-France-de-foot-devrait-jouer-seulement-en-semaine</link>
    <guid isPermaLink="false">urn:md5:a72e1e11b9d71933178f839a20a9e681</guid>
    <pubDate>Sat, 24 Jul 2010 22:48:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Risques</category>
        <category>accident</category><category>corporels</category><category>foot</category><category>France</category><category>match</category><category>semaine</category>    
    <description>    &lt;p&gt;Il y a quelques semaines, le &lt;em&gt;service de centralisation des statistiques de l&amp;rsquo;assurance accidents LAA&lt;/em&gt;,
par l&amp;rsquo;intermédiaire de Stefan Scholz Odermatt, a
publié une étude sur la survenance d&amp;rsquo;accident automobile
les jours de match de foot. &lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.foot-etude_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;Selon l&amp;rsquo;étude (mentionnée &lt;a href=&quot;http://www.suva.ch/fr/print/home/news/vom-wm-public-viewing-in-die-arztpraxis/medienmitteilungen.htm&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://www.tdg.ch/nombe-accidents-augmente-matches-foot-2010-06-25&quot;&gt;là&lt;/a&gt;) le nombre d&amp;rsquo;accidents les jours où il y a match est supérieur aux jours sans match,&amp;nbsp;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.foot-etude-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;Ayant
réussi à récupérer une base presque exhaustive d&amp;rsquo;accidents corporels en
France, je peux faire la même étude, entre janvier 2002 et décembre
2007. Les conclusions sont moins flagrantes que sur le cas suisse, en
particulier les jours de semaine, où manifestement, personne ne
s&amp;rsquo;intéresse aux matchs (où en tous les cas pas assez pour être moins
vigilent au volant).&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.foot-accident-semaine_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;En revanche, le week end, l&amp;rsquo;effet devient plus prononcé&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.foot-accident-week-end_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;avec davantage d&amp;rsquo;accidents dans la journée où il y a un match de l&amp;rsquo;équipe de France.&lt;img style=&quot;width: 184px; height: 240px; float: right;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.2a833855c5907369f229a684ee314c240f1777ff_m_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;Moralité,
l&amp;rsquo;équipe de France de foot devrait jouer seulement en semaine, à chaque
match, cela éviterait une vingtaine d&amp;rsquo;accidents de la route à chaque
fois (et je ne parle que d&amp;rsquo;accidents corporels, ayant causé des blessures et ayant donné lieu à un constat de police)&amp;thinsp;! Comme le disait un copain à qui je racontais ça, &quot;&lt;em&gt;l&amp;rsquo;équipe de France devrait jouer, ça serait un début&lt;/em&gt;&quot;.... mais c&amp;rsquo;est un autre sujet.&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Estimateur(s) sans biais ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/23/Estimateur%28s%29-sans-biais</link>
    <guid isPermaLink="false">urn:md5:274ce38257cfd08d9da775eb202772a7</guid>
    <pubDate>Fri, 23 Jul 2010 23:17:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>biais</category><category>estimateur</category><category>estimation</category><category>Le Chat</category><category>Maclaurin</category><category>série entière</category>    
    <description>    &lt;p&gt;En fin de semaine j&amp;rsquo;étais à Lyon à l&amp;rsquo;école d&amp;rsquo;été organisée par
Stéphane, pour parler bootstrap et estimation de l&amp;rsquo;incertitude associée
à l&amp;rsquo;estimation du montant des réserves (pour faire simple, les slides
sont en ligne &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-lyon-ibnr.pdf&quot;&gt;ici&lt;/a&gt;). Je ferais un billet plus détaillé (avec les codes
pour répondre à la demande que m&amp;rsquo;ont faites plusieurs personnes). A la fin de l&amp;rsquo;exposé, on discutait des estimateurs sans biais
avec quelqu&amp;rsquo;un qui se plaignait du biais à distance fini de certains
estimateurs, et qui me demandait &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;vous ne pouvez pas trouver un estimateur sans biais du msepc&amp;thinsp;?&lt;/span&gt;
&quot;. Si à la rigueur la recherche des propriétés d&amp;rsquo;estimateur peut être
un passe temps occasionnel, je n&amp;rsquo;ai pas eu la présence d&amp;rsquo;esprit de lui
faire remarquer qu&amp;rsquo;il existe des paramètres dont il est &lt;em&gt;impossible&lt;/em&gt; de construire un estimateur sans biais... étonnant, non&amp;thinsp;?&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/3-364a7.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Prenons la loi de Poisson de paramètre&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais01.png&quot; /&gt;. Alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais02.png&quot; /&gt;&lt;/div&gt;Supposons que l&amp;rsquo;on cherche à estimer&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais03.png&quot; /&gt;. S&amp;rsquo;il existe une statistique&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais04.png&quot; /&gt; qui soit un estimateur sans biais de&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais05.png&quot; /&gt;, alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais06.png&quot; /&gt;&lt;/div&gt;Or &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais04.png&quot; /&gt; est une fonction de&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais07.png&quot; /&gt;, donc&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais08.png&quot; /&gt;&lt;/div&gt;Cela signifie tout simplement que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais09.png&quot; /&gt;&lt;/div&gt;Ça c&amp;rsquo;est bien gênant parce que la fonction&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais10.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/biais10.png&quot; /&gt; n&amp;rsquo;admet pas de développement en série entière (je renvoie à des cours de prépa, ou &lt;a href=&quot;http://hypography.com/forums/physics-and-mathematics/11618-interesting-consequence-of-differentation-inverse-functions-3.html&quot;&gt;là&lt;/a&gt; par exemple). Moralité, il existe des grandeurs dont on ne peut pas construire un estimateur sans biais.... Qui l&amp;rsquo;eut cru&amp;thinsp;?</description>
    
    
    
      </item>
    
  <item>
    <title>Bonus-malus et non déclaration de sinistres</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/23/Bonus-malus-et-non-d%C3%A9laration-de-sinistres</link>
    <guid isPermaLink="false">urn:md5:2fd556c54392698ba575325593af96c2</guid>
    <pubDate>Fri, 23 Jul 2010 00:34:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Assurance</category>
        <category>50</category><category>binomiale</category><category>binomiale négative</category><category>bonus</category><category>CRAN</category><category>Poisson</category><category>R</category><category>zero-inflated</category>    
    <description>    &lt;p&gt;Le mécanisme bonus-malus a de très nombreuses vertus, dont celui de
renforcer la solidarité. Mais il semble qu&amp;rsquo;il incite aussi à ne pas
déclarer certains petits sinistres à son assureur. C&amp;rsquo;est ce que&amp;nbsp;nous
allons montrer ici.&lt;br /&gt;&amp;nbsp;La distribution des personnes ayant un bonus de
50% (ce qui est le niveau le plus bas que l&amp;rsquo;on puisse atteindre, en
théorie) a la forme suivante, en fonction de l&amp;rsquo;âge du conducteur,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; library(splines)&amp;thinsp;; &amp;nbsp;library(pscl)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; reg &amp;lt;- glm((bonus==50)~bs(ageconducteur),data=sinistres,family=binomial)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; base &amp;lt;- data.frame(ageconducteur=seq(18,80))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; y=predict(reg,newdata=base)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; plot(seq(18,80),y)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.BLEUproportion-bonus-50_m.jpg&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.BLEUproportion-bonus-50_m.jpg&quot; /&gt;&lt;/div&gt;
Comme je le notais déjà ici, une personne qui a un niveau
de bonus bas peut être incitée à ne pas
déclarer un petit sinistre à son assureur (et de proposer
&amp;nbsp;un arrangement à l&amp;rsquo;amiable avec la contrepartie).&lt;br /&gt;
Cette sur-représentation des 0 dans la base pour les très
bas niveaux de bonus peut être prise en compte à l&amp;rsquo;aide
des modèles dits &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;zero-inflated&lt;/span&gt;.&lt;br /&gt;
Classiquement, on supposait que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf01.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;dans le cas d&amp;rsquo;un modèle de Poisson. On va supposer ici que
l&amp;rsquo;assuré peut décider de ne pas déclarer certains
sinistres. Autrement dit&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf02.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;et pour &amp;nbsp;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf03.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf04.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;On peut considérer un modèle logistique pour modéliser
cette probabilité de non-déclaration,&amp;nbsp;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf06.png&quot; alt=&quot;&quot; /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf07.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
alors que pour le modèle de Poisson&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zeroinf08.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
En fait, si l&amp;rsquo;on suppose que l&amp;rsquo;impact d&amp;rsquo;une variable n&amp;rsquo;est pas
linéaire, on peut introduire des splines pour estimer la
transformation &lt;em&gt;optimale&lt;/em&gt;,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; library(splines)&amp;thinsp;; &amp;nbsp;library(pscl)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; reg=zeroinfl(nombre~bs(ageconducteur,df=4) | bs(ageconducteur), data = nombre,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
+ dist = &quot;poisson&quot;,link=&quot;logit&quot;,offset=log(exposition))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; age=seq(18,80)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; DT=data.frame(ageconducteur=age,exposition=1)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; Y=predict(reg,newdata=DT,type=&quot;zero&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; plot(age,Y)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ce qui permet de ne faire une prédiction &lt;em&gt;que&lt;/em&gt;
sur la composante d&amp;rsquo;inflation zero. Sur une base de données sur
laquelle je devrais revenir à la rentrée, on obtient la tendance
suivante,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.poisson-zero-infl_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;Malheureusement,
l&amp;rsquo;interprétation est plus délicate, car avec une régression binomiale
négative, qui autorise plus de variance, on obtient des ordres de
grandeur très différents&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; reg=zeroinfl(nombre~bs(ageconducteur,df=4) | bs(ageconducteur), data = nombre,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
+ dist = &quot;negbin&quot;,link=&quot;logit&quot;,offset=log(exposition))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.bonus-negbin-zi_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
(on
oubliera le comportement de bord pour les âges élevés, peu de personnes
âgées appartenant à ce portefeuille, les résultats sont peu robustes à
droite).&lt;br /&gt;On retrouve toutefois une fonction croissante (au moins
entre 20 et 60 ans), ce qui peut être relié avec la distribution du
bonus en fonction de l&amp;rsquo;âge: plus on est âgé, plus on a de chance
d&amp;rsquo;avoir un très bon bonus, et plus on a de chances de ne pas déclarer
un sinistre à son assureur...&lt;br /&gt;D&amp;rsquo;ailleurs, si on fait la régression directement sur le niveau de bonus, et plus sur l&amp;rsquo;âge, on a l&amp;rsquo;impact suivant&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
&amp;gt; reg=zeroinfl(nombre~bs(bonus,df=4) | bs(bonus), data = nombre,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;
+ dist = &quot;poisson&quot;,link=&quot;logit&quot;,offset=log(exposition))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.bonus-zero-infl_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Moralité,
c&amp;rsquo;est bien le niveau élevé de bonus qui incite les assurés à ne pas
déclarer de sinistres à leurs assureurs (et pas forcément un effet d&amp;rsquo;âge que l&amp;rsquo;on
pourrait associer à de l&amp;rsquo;Alzheimer).</description>
    
    
    
      </item>
    
  <item>
    <title>Davantage de régularité dans les naissances ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/20/Davantage-de-r%C3%A9gularit%C3%A9-dans-les-naissances</link>
    <guid isPermaLink="false">urn:md5:d06c740887094fdf7329acc81cc1c3df</guid>
    <pubDate>Tue, 20 Jul 2010 00:50:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>70</category><category>2000</category><category>cac40</category><category>cycle</category><category>INED</category><category>naissance</category><category>saisonnalité</category><category>sexe</category><category>été</category>    
    <description>    &lt;p&gt;L&amp;rsquo;autre jour, l&amp;rsquo;INED avait fait beaucoup de bruit en publiant une étude
expliquant que le pic des naissance classiquement observé en mai
semblait avoir disparu (&lt;a href=&quot;http://www.lepoint.fr/societe/moins-de-naissances-les-samedis-et-dimanches-07-07-2010-1212174_23.php&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://www.lemonde.fr/societe/article/2010/07/08/les-francais-font-des-bebes-toute-l-annee_1385411_3224.html&quot;&gt;là&lt;/a&gt;).
On va essayer de vérifier ce point, à partir de toutes les naissances
observées en France entre 1968 et 2005. Ca sera le billet &lt;em&gt;sexe&lt;/em&gt; de l&amp;rsquo;été...&lt;/p&gt;
&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;Le nombre quotidien de naissances en France &lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
La série brute ressemble à ça,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On
pourrait à la rigueur extraire les cycles directement sur cette série,
mais ça ne serait pas forcément convainquant (même si visuellement on
retrouve ce qui était évoqué),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-brut-cycle_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
mais la première chose que l&amp;rsquo;on observe est que la différence entre le nombre de naissances le week end (en &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt;) et en semaine (en &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;bleu&lt;/span&gt;) s&amp;rsquo;est fortement creusée dans les années 80-90.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On peut regarder le ratio du nombre de naissance le week end, par rapport aux jours de la semaine précédant le week end,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-10_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et on peut alors &quot;&lt;em&gt;corriger&lt;/em&gt;&quot; ou &quot;&lt;em&gt;lisser&lt;/em&gt;&quot; la série, de manière à maintenir la moyenne hebdomadaire, mais en transférant quelques naissances de la semaine au week end.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Sur cette série lissée, on peut extraire une tendance de long terme.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-4_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
C&amp;rsquo;est sur le &quot;&lt;em&gt;bruit&lt;/em&gt;&quot;
autour de cette tendance que l&amp;rsquo;on peut essayer d&amp;rsquo;étudier un éventuel
cycle annuel. Notons que l&amp;rsquo;on retrouve les tendances sur la série brute&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-tendance-semaine-weekend_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;Série corrigée de la tendance de long terme&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
La série suivante permet de voir l&amp;rsquo;évolution du &quot;cycle&quot; (série brute à laquelle on retranche la tendance observée ci-dessus) à la fin des années 60 (en &lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;rouge&lt;/span&gt;), des années 70 (en &lt;span style=&quot;color: rgb(255, 102, 0);&quot;&gt;orange&lt;/span&gt;), des années 80 (en &lt;span style=&quot;color: rgb(255, 204, 0);&quot;&gt;jaune&lt;/span&gt;), voire des années 90 (en presque &lt;span style=&quot;color: rgb(255, 255, 153);&quot;&gt;blanc&lt;/span&gt;),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-9_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Sur les années 68-78, on a la tendance suivante&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-5_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
alors que pour les années 95-2005, cela donne&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-7_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Au final, les deux tendances sont les suivantes, avec en &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;rouge&lt;/span&gt; les années 70 et en &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;bleu&lt;/span&gt; les années 2000.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-8_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Effectivement,
le pic classiquement observé au mois de mai semble avoir disparu, et la
série aujourd&amp;rsquo;hui semble beaucoup plus lisse. Et comme l&amp;rsquo;INED, on note
qu&amp;rsquo;il y a effectivement un mini-pic au mois de septembre.&lt;br /&gt;&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;Des naissances au comportement sexuel&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
Tout
comme l&amp;rsquo;INED, on peut relier ça à l&amp;rsquo;activité sexuelle des français, que
l&amp;rsquo;on peut visualiser sur le graphique ci-dessous (en décalant tout
simplement de 9 mois),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-sexe_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
l&amp;rsquo;activité sexuelle semblait s&amp;rsquo;intensifier pendant les vacances
scolaires, en particulier début août (mais aussi plus généralement
pendant les vacances scolaires, que ce soit Pâques, les vacances d&amp;rsquo;été,
ou les vacances de Noël d&amp;rsquo;ailleurs). Ou peut être pourrait-on conclure
à la rigueur que l&amp;rsquo;été, on sort moins couvert.... car on observe les
comportements sexuels associés à une naissance 9 mois plus tard (ce qui
ne doit pas correspondre à l&amp;rsquo;unique activité sexuelle).&lt;br /&gt;Les français
semblent avoir intensifié leur activité sexuelle pendant une période
plus fraîche (novembre-mars), au détriment de la période estivale. Un
effet du réchauffement climatique (il fait trop chaud pour batifoler
l&amp;rsquo;été)&amp;thinsp;? Un effet des 35 heures et des RTT (et des vacances qui sont
plus réparties dans l&amp;rsquo;année qu&amp;rsquo;avant)&amp;thinsp;?&lt;br /&gt;&lt;ul style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;li&gt;&lt;strong&gt;L&amp;rsquo;été s&amp;rsquo;ra chaud&amp;thinsp;?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
En
fait, au lieu de penser en terme de saison, on peut penser en&amp;nbsp;terme de
température (j&amp;rsquo;ai pris la température quotidienne minimale à Paris,
c&amp;rsquo;est à dire la nuit...&amp;nbsp;). &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.temperature-naissance-9-mois_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
c&amp;rsquo;est à dire en zoomant&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.temperature-naissance-9-mois-zoom_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
On
peut aussi chercher à étudier davantage ce qui se passait il y a 30 ans
et maintenant (comme dans la partie précédente). Il y a 30 ans (courbe &lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;&quot;&gt;rouge&lt;/span&gt;) on observait un (très) fort pic estival. Ce pic a disparu aujourd&amp;rsquo;hui (courbe &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;bleue&lt;/span&gt;), avec un comportement comparable, qu&amp;rsquo;il fasse 0 ou 20 degrés dehors. &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-temperature-Z-R-B_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Quid de l&amp;rsquo;impact des bourses&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Mais la recherche de &lt;em&gt;la&lt;/em&gt;
variable qui pourrait expliquer cette saisonnalité ou ces pics est sans
fin. Beaucoup de monde évoque la bonne santé économique pour expliquer
les booms de natalité.... ça marche peut être à long terme, mais à
court terme&amp;thinsp;?&lt;br /&gt;En fait, si on croisse l&amp;rsquo;activité sexuelle avec le niveau de la bourse, on peut presque retrouver ce genre de comportement,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.naissance-bourse-Z_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
une
bourse en très forte hausse semble provoquer un (léger) pic de natalité
9 mois plus tard, alors qu&amp;rsquo;un effondrement de la bourse se traduit
plutôt par une chute (légère certes) 9 mois plus tard...&amp;nbsp;&lt;br /&gt;&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Qu'est ce que la modélisation économétrique (4) ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/16/%284%29</link>
    <guid isPermaLink="false">urn:md5:4e17335982a7e1dcf4353b4fa7583afc</guid>
    <pubDate>Fri, 16 Jul 2010 17:31:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>économétrie - M1-09/10</category>
        <category>Angrist</category><category>corrélation</category><category>ecole</category><category>effectifs</category><category>interprétation</category><category>Lavy</category><category>multicolinéarité</category><category>school</category><category>école</category><category>économétrie</category>    
    <description>    &lt;p&gt;Suite à une discussion au téléphone
l&amp;rsquo;autre jour avec Elsa, j&amp;rsquo;ai voulu rajouter un petit billet - un peu
technique - sur la multicolinéarité. Ou comment interpréter le signe (et la valeur) d&amp;rsquo;un coefficient dans une régression multiple.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Interpréter une régression avec des
variables explicatives corrélées&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Assez souvent en
économétrie, les variables explicatives peuvent
être corrélées. Ce qui peut introduire des erreurs
d&amp;rsquo;interprétation. Considérons le petit modèle
suivant, où l&amp;rsquo;on dispose de deux variables explicatives. &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;
&amp;gt; library(mnormt)&lt;br /&gt;
&amp;gt; set.seed(1)&lt;br /&gt;
&amp;gt; Z=rmnorm(200,c(0,0),matrix(c(1,-.8,-.8,1),2,2))&lt;br /&gt;
&amp;gt; Y=1+2*Z[,1]+.5*Z[,2]+rnorm(200)&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;Si l&amp;rsquo;on se contente
d&amp;rsquo;analyses univariées, on notera que &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-03.png&quot; alt=&quot;&quot; /&gt; &lt;em&gt;semble&lt;/em&gt; décroitre avec &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-01.png&quot; alt=&quot;&quot; /&gt;.&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;
&amp;gt; summary(lm(Y~Z[,2]))&lt;br /&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;lm(formula = Y ~ Z[, 2])&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t
value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept)&amp;nbsp;&amp;nbsp; 1.0229&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1132&amp;nbsp;&amp;nbsp;
9.038&amp;nbsp;&amp;nbsp; &amp;lt;2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Z[, 2]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1.0717&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1171&amp;nbsp;
-9.155&amp;nbsp;&amp;nbsp; &amp;lt;2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’
0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Residual standard error: 1.6 on 198
degrees of freedom&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Multiple R-squared: 0.2974,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Adjusted R-squared: 0.2938 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;F-statistic: 83.81 on 1 and 198
DF,&amp;nbsp; p-value: &amp;lt; 2.2e-16 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.Y-Z2-multicolineaite_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pourtant, si l&amp;rsquo;on contrôle à l&amp;rsquo;aide la &amp;nbsp;variable &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-04.png&quot; alt=&quot;&quot; /&gt;,
on s&amp;rsquo;aperçoit que l&amp;rsquo;impact de &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-01.png&quot; alt=&quot;&quot; /&gt; sur &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-03.png&quot; alt=&quot;&quot; /&gt; va plutôt dans
l&amp;rsquo;autre sens, avec un signe positif, et significativement positif,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;
&amp;gt; summary(lm(Y~Z[,1]+Z[,2]))&lt;br /&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Call:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;lm(formula = Y ~ Z[, 1] + Z[, 2])&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t
value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(Intercept)&amp;nbsp; 0.95647&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.07597&amp;nbsp;
12.591&amp;nbsp; &amp;lt; 2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Z[, 1]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.04287&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.13082&amp;nbsp;
15.615&amp;nbsp; &amp;lt; 2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Z[, 2]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.45621&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.12541&amp;nbsp;&amp;nbsp;
3.638 0.000351 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’
0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Residual standard error: 1.073 on
197 degrees of freedom&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Multiple R-squared: 0.686,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Adjusted R-squared: 0.6828 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;F-statistic: 215.2 on 2 and 197
DF,&amp;nbsp; p-value: &amp;lt; 2.2e-16 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Graphiquement, on a le modele suivant&lt;br /&gt;&lt;p&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.y-Z1-Z2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
autrement dit,  &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-03.png&quot; alt=&quot;&quot; /&gt; croit fortement avec  &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-04.png&quot; alt=&quot;&quot; /&gt;, mais à  &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-04.png&quot; alt=&quot;&quot; /&gt; fixé, on note que  &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-03.png&quot; alt=&quot;&quot; /&gt; est croissant avec  &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-01.png&quot; alt=&quot;&quot; /&gt; . L&amp;rsquo;intuition derrière est qu&amp;rsquo;il faut regarder l&amp;rsquo;impact de &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-01.png&quot; alt=&quot;&quot; /&gt; sur &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-03.png&quot; alt=&quot;&quot; /&gt; &lt;em&gt;pour des individus qui se ressemblent - ou identique -&lt;/em&gt; c&amp;rsquo;est à dire
avec des valeurs de&amp;nbsp; &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-04.png&quot; alt=&quot;&quot; /&gt; proches. Si l&amp;rsquo;on considère le
sous-échantillon des &lt;em&gt;petites&lt;/em&gt;
valeurs de &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-04.png&quot; alt=&quot;&quot; /&gt;, on obtient&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;
&amp;gt; I=Z[,1]&amp;lt;(-1)&lt;br /&gt;
&amp;gt; plot(Z[,2],Y,xlab=&quot;&quot;,ylab=&quot;&quot;)&lt;br /&gt;
&amp;gt; abline(lm(Y[I]~Z[I,2]),col=&quot;red&quot;,lwd=2)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;p&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.Y-Z2-multicolineaite-Y1-petit_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
alors que pour les &lt;em&gt;grandes &lt;/em&gt;valeurs
de &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multi-c-04.png&quot; alt=&quot;&quot; /&gt;,&lt;br /&gt;
&lt;p&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.Y-Z2-multicolineaite-Y1-grand_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref, l&amp;rsquo;impact négatif semble ici positif. En considérant
un échantillon plus grand (en simulant 2000 valeurs au lieu de 200), on obtient des choses ressemblant
à ça,&lt;br /&gt;&lt;p id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/multicolin-positif-negatif.gif&quot; alt=&quot;&quot; /&gt;
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Interprétation sur le problème des
tailles des classes&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Si l&amp;rsquo;on revient au sujet de
l&amp;rsquo;impact de la taille de la classe (dans les écoles) sur les résultats scolaires,
on pourrait être dans la même configuration. Sans variable
de contrôle, la taille de la classe impact de manière
positive les résultats scolaires: plus la classe est nombreuse,
meilleures sont les résultats. Or comme le notaient Angrist et
Lavy (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/03/Qu-est-ce-que-la-mod%C3%A9lisation-%C3%A9conom%C3%A9trique-%283%29&quot;&gt;ici&lt;/a&gt;), la taille de la classe est très
corrélée à des variables socio-économiques.
Si l&amp;rsquo;on arrive à trouver de bonnes variables de contrôle,
on peut parfaitement obtenir un impact négatif, comme dans
l&amp;rsquo;exemple simulé ci-dessus... &lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Tails of copulas, une lecture graphique</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/08/Tails-of-copulas%2C-une-lecture-graphique</link>
    <guid isPermaLink="false">urn:md5:fefbc61d0dfa91a3e4913941e47130f6</guid>
    <pubDate>Thu, 08 Jul 2010 04:26:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>alae</category><category>ASTIN</category><category>Berlin</category><category>copulas</category><category>CRAN</category><category>loss</category><category>tails</category><category>Venter</category>    
    <description>    &lt;p&gt;
Suite à une formation que je faisais en fin de semaine à Brest (les slides sont &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-euria-1.pdf&quot;&gt;ici&lt;/a&gt; et &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-euria-2.pdf&quot;&gt;là&lt;/a&gt;), je voulais revenir sur les histoires de &lt;em&gt;tails of copulas&lt;/em&gt;,
pour reprendre le titre de l&amp;rsquo;article (&lt;a href=&quot;http://hhttp//www.actuaries.org/ASTIN/Colloquia/Washington/Venter.pdf&quot;&gt;ici&lt;/a&gt;) de Gary Venter (et qui correspond
à des choses que j&amp;rsquo;avais pu présenter il y a quelques
années à Berlin, les slides étant en ligne &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/slides-ASTIN.pdf&quot;&gt;ici&lt;/a&gt;).
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Quantifier la dépendance de queue&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
L&amp;rsquo;idée est de noter qu&amp;rsquo;il est noter qu&amp;rsquo;il existe deux
manières de quantifier la dépendance de queue. La
première est liée à l&amp;rsquo;approche de Joe (1990, &lt;a href=&quot;http://ideas.repec.org/a/eee/jmvana/v35y1990i1p12-30.html&quot;&gt;ici&lt;/a&gt;, ou 1997 pour le livre), qui
a introduit un (&lt;em&gt;strong&lt;/em&gt;)&lt;em&gt; tail dependence index&lt;/em&gt;. Par exemple pour la queue inférieure,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/toc3latex2png.2.php.png&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/toc3latex2png.2.php.png&quot; /&gt;&lt;/div&gt;soit&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/toc3latex2png.3.php.png&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/toc3latex2png.3.php.png&quot; /&gt;&lt;/div&gt;La seconde est liée à une idée que l&amp;rsquo;on retrouve dans les travaux de
Janet Heffernan, Stuart Coles ou Jonathan Tawn. L&amp;rsquo;intuition est la
suivante (on peut la retrouver en ligne &lt;a href=&quot;http://econstor.eu/dspace/bitstream/10419/29623/1/614058171.pdf&quot;&gt;ici&lt;/a&gt;). Si&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-2.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-2.2.php.png&quot; /&gt; et&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-3.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-3.2.php.png&quot; /&gt; ont la même loi et que l&amp;rsquo;on suppose les variables indépendantes, alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-1.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-1.2.php.png&quot; /&gt;&lt;/div&gt;
En revanche, si les variables sont comonotones (c&amp;rsquo;est à dire égales comme on suppose les lois identiques),&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-4.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-4.2.php.png&quot; /&gt;&lt;/div&gt;
Aussi, on peut supposer qu&amp;rsquo;il existe un indice &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; /&gt; tel que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-5.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-5.2.php.png&quot; /&gt;&lt;/div&gt;
Le soucis est que le cas d&amp;rsquo;indépendance correspond à&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; /&gt;=2, alors que le cas de dépendance forte correspond au cas &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; /&gt;=1. Il est alors usuel de faire une transformation affine pour se
ramener sur [0,1], et que la force de la dépendance soit
croissante avec&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png&quot; /&gt;, e.g.&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-8.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-8.2.php.png&quot; /&gt;&lt;/div&gt;Posons alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.2.php.png&quot; /&gt;&lt;/div&gt;qui pourra être interprété comme un (&lt;em&gt;weak&lt;/em&gt;) &lt;em&gt;tail dependence index&lt;/em&gt;.&lt;br /&gt;
Bref, ces deux mesures donnent de l&amp;rsquo;information sur le comportement dans les queues de distribution.&lt;br style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Les fonctions de concentration dans les queues&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
L&amp;rsquo;idée est de noter qu&amp;rsquo;il est possible d&amp;rsquo;étudier ces fonctions afin de
mieux comprendre le comportement dans les queues. En s&amp;rsquo;inspirant de
Gary Venter, on peut définir &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/Llatex2png.2.php.png&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/Llatex2png.2.php.png&quot; /&gt;&lt;/div&gt;
pour étudier le comportement dans la queue inférieure, et &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/Clatex2png.2.php.png&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/Clatex2png.2.php.png&quot; /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;pour la queue supérieure,où&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-12.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-12.2.php.png&quot; /&gt; est la copule de survie associée à &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-13.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-13.2.php.png&quot; /&gt;, au sens où&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-14.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-14.2.php.png&quot; /&gt;&lt;/div&gt;
et&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-15.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-15.2.php.png&quot; /&gt;&lt;/div&gt;Cet outil permettra de modéliser la dépendance &lt;em&gt;forte&lt;/em&gt;. On peut également poser, afin d&amp;rsquo;étudier la dépendance faible,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.3.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.3.php.png&quot; /&gt;&lt;/div&gt;ou&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.4.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.4.php.png&quot; /&gt;&lt;/div&gt;&lt;br style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Application statistique&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
L&amp;rsquo;idée est de noter qu&amp;rsquo;il est facile d&amp;rsquo;estimer ces fonctions. Ces
outils peuvent être utiles pour mieux comprendre le comportement dans
les queues.&lt;br /&gt;
Par exemple pour une copule Gaussienne de corrélation 0,5, on a la
forme théorique suivante pour les fonctions de concentration (au sens
fort)&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.LR-gaussien-probas_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Statistiquement, il est possible d&amp;rsquo;estimer ces quantités en
comptant simplement le nombre d&amp;rsquo;observations dans le coin
inférieur gauche, ou le coin supérieur droit.&amp;nbsp;
Si on dispose d&amp;rsquo;un échantillon, on peut alors regarder ce que donnent les versions&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-18.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-18.2.php.png&quot; /&gt;&lt;/div&gt;
et &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-19.2.php.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-19.2.php.png&quot; /&gt;&lt;/div&gt; Pour un
échantillon de taille n=500, on obtient les intervalles de
confiance à 90% de la forme suivante,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.LR-gaussien-stats_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Le code R ressemble à ça&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; library(evd); data(lossalae)&lt;br /&gt;&amp;gt; cor(lossalae,method=&quot;spearman&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loss&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALAE&lt;br /&gt;Loss 1.000000 0.451872&lt;br /&gt;ALAE 0.451872 1.000000&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;avec le code suivant pour la version empirique,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; library(evd); data(lossalae)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; z=seq(0,.5,by=.001)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp;U=rank(v[,1])/(nrow(v)+1)&lt;br /&gt;&amp;gt; V=rank(v[,2])/(nrow(v)+1)&lt;br /&gt;&amp;gt; Lemp=rep(NA,length(z))&lt;br /&gt;&amp;gt; Remp=rep(NA,length(z))&lt;br /&gt;&amp;gt; for(i in 1:length(z)){&lt;br /&gt;+&amp;nbsp; Lemp[i]=sum((U&amp;lt;=z[i])&amp;amp;(V&amp;lt;=z[i]))/sum(U&amp;lt;=z[i])&lt;br /&gt;+&amp;nbsp; Remp[i]=sum((U&amp;gt;=1-z[i])&amp;amp;(V&amp;gt;=1-z[i]))/sum(U&amp;lt;=z[i])&lt;br /&gt;+ }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;et pour la version théorique,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; Lg=(pcopula(copclayton,cbind(z,z)))/(z)&lt;br /&gt;&amp;gt; Rg=((1-2*(1-z)+pcopula(copclayton,cbind(1-z,1-z))))/(z)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; plot(c(1-z,z),c(Lg,Rg))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
De plus, on a des fonctions similaires pour la dépendance au sens faible, avec le code suivant pour la version théorique,&amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; Lg=log(pcopula(cop,cbind(z,z)))/log(z)&lt;br /&gt;&amp;gt; Rg=log((1-2*(1-z)+pcopula(cop,cbind(1-z,1-z))))/log(z)&lt;br /&gt;&amp;gt; Lg=1/Lg*2-1&lt;br /&gt;&amp;gt; Rg=1/Rg*2-1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;et celui là pour la version empirique&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; z=seq(0,.5,by=.001)&lt;br /&gt;&amp;gt; v &amp;lt;- lossalae&lt;br /&gt;&amp;gt; U=rank(v[,1])/(nrow(v)+1)&lt;br /&gt;&amp;gt; V=rank(v[,2])/(nrow(v)+1)&lt;br /&gt;&amp;gt; Lemp=rep(NA,length(z))&lt;br /&gt;&amp;gt; Remp=rep(NA,length(z))&lt;br /&gt;&amp;gt; for(i in 1:length(z)){&lt;br /&gt;+&amp;nbsp; Lemp[i]=log(mean((U&amp;lt;=z[i])&amp;amp;(V&amp;lt;=z[i])))/log(mean(U&amp;lt;=z[i]))&lt;br /&gt;+&amp;nbsp; Remp[i]=log(mean((U&amp;gt;=1-z[i])&amp;amp;(V&amp;gt;=1-z[i])))/log(mean(U&amp;lt;=z[i]))&lt;br /&gt;+ }&lt;br /&gt;&amp;gt; Lemp=1/Lemp*2-1&lt;br /&gt;&amp;gt; Remp=1/Remp*2-1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Bref,
on peut utiliser ces fonctions sur des vrais échantillons. Considérons
l&amp;rsquo;exemple classique loss-alae (où l&amp;rsquo;on couple les frais dans des
sinistres assurés, et les frais payés par l&amp;rsquo;assureur). On souhaite
ajuster une copule, sans trop savoir laquelle. On peut commencer par
étudier la dépendance forte, et comparer avec une copule Gaussienne. La
copule Gaussienne de référence possède ici le même rho de Spearman que
l&amp;rsquo;échantillon dont on dispose,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; library(evd); data(lossalae)&lt;br /&gt;&amp;gt; cor(lossalae,method=&quot;spearman&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loss&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALAE&lt;br /&gt;Loss 1.000000 0.451872&lt;br /&gt;ALAE 0.451872 1.000000&lt;br /&gt;&amp;gt; library(copula)&lt;br /&gt;&amp;gt; paramgauss=.47&lt;br /&gt;&amp;gt; paramclayton=.9&lt;br /&gt;&amp;gt; paramgumbel=1.45&lt;br /&gt;&amp;gt; copgauss=normalCopula(paramgauss)&lt;br /&gt;&amp;gt; copclayton=claytonCopula(paramclayton, dim = 2)&lt;br /&gt;&amp;gt; copgumbel=gumbelCopula(paramgumbel, dim = 2)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;On obtient ici&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loss-alae-lambda-LR-gauss_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
La
courbe verte est l&amp;rsquo;intervalle de confiance (ponctuel) à 95% pour une
copule Gaussienne et un échantillon de même taille. On voit qu&amp;rsquo;on
modélise mal la structure de dépendance. Avec une copule duale de
Clayton, on obtient&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loss-alae-lambda-LR-clayton_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;et enfin pour une copule de Gumbel,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loss-alae-lambda-LR-gumbel_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
la copule de Gumbel semble réellement bien adaptée... Si on creuse en
étudiant la dépendance au sens faible, on peut valider là aussi ce
modèle. En effet, si la référence est la copule Gaussienne,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loss-alae-eta-LR-gauss_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
ou pour une copule de Clayton,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loss-alae-eta-LR-clayton_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
alors qu&amp;rsquo;une copule de Gumbel donnerait&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loss-alae-eta-LR-gumbel_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Transfert du blog, suite</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/07/01/Transfert-du-blog%2C-suite</link>
    <guid isPermaLink="false">urn:md5:c7f6d71b8f1cce20fd2690c8b580cec0</guid>
    <pubDate>Thu, 01 Jul 2010 19:18:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>liens externes</category>
        <category>blog</category><category>freakonometric</category><category>freakonometrics</category><category>transfert</category>    
    <description>    &lt;p&gt;
Autant l&amp;rsquo;admettre rapidement, transférer un blog n&amp;rsquo;est pas aussi
simple que j&amp;rsquo;aurais pu le penser... Certes, l&amp;rsquo;essentiel des billets
sont désormais lisibles sur &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php/&quot;&gt;freakonometrics.free.fr&lt;/a&gt;, mais les catégories
n&amp;rsquo;ont pas été transférées, ainsi que les
commentaires. Et comme certains commentaires qui m&amp;rsquo;ont
été fait sont plus intéressants que les billets
eux-mêmes, je trouve que ça manque. Mais surtout le
référencement a du mal à suivre...&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img title=&quot;transfert-fichier-gif.gif, juil. 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/transfert-fichier-gif.gif&quot; /&gt;&lt;/div&gt;
Bref, autant faire simple, et je vais continuer à nourrir les
deux blogs en parallèles (quite probablement à ne pas
mettre forcément tous les billets en ligne ici).</description>
    
    
    
      </item>
    
  <item>
    <title>Econometrica et Ouest France: même combat ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/18/Econometrica-et-Ouest-France%3A-m%C3%AAme-combat</link>
    <guid isPermaLink="false">urn:md5:e5f6de779d2e69d31b5a989c54445238</guid>
    <pubDate>Fri, 18 Jun 2010 09:45:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>Benford</category><category>Hill</category><category>impact factor</category><category>Pareto</category><category>presse</category><category>tirage</category><category>Zipf</category>    
    <description>    &lt;p&gt;
Un court billet aujourd&amp;rsquo;hui pour présenter deux ou trois petits
graphiques (je n&amp;rsquo;ai malheureusement pas encore trouvé comment
aller plus loin sur l&amp;rsquo;analogie...).&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;La
recherche et l&amp;rsquo;&lt;/span&gt;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;impact factor&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt; des revues&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Dans le système d&amp;rsquo;évaluation des chercheurs (je pourrais
même dire des enseignants chercheurs) on est évalué
tout simplement en fonction des revues dans lesquelles on arrive
à placer nos papiers. Les revues sont en effet notées,
classées, le classement le plus connu étant l&amp;rsquo;&lt;em&gt;impact factor&lt;/em&gt;
(j&amp;rsquo;en avais parlé l&amp;rsquo;an dernier lors du versement de primes à des
chercheurs à Lyon, &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2009/03/09/Ranking&quot;&gt;ici&lt;/a&gt;).
Quelques
revues ont un facteur d&amp;rsquo;impact très
élevé, et ensuite se trouve des centaines voire des
milliers de revues spécialisées. La distribution de ce
facteur d&amp;rsquo;impact a l&amp;rsquo;allure suivante,&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.presse-impact-factor-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Comme l&amp;rsquo;ont noté plusieurs auteurs (&lt;a href=&quot;http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B83WV-4N517D8-1&amp;amp;_user=10&amp;amp;_coverDate=04%2F30%2F2007&amp;amp;_rdoc=1&amp;amp;_fmt=high&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;_docanchor=&amp;amp;view=c&amp;amp;_searchStrId=1373248283&amp;amp;_rerunOrigin=google&amp;amp;_acct=C000050221&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=10&amp;amp;md5=db9f0d7e6c5963ccd3471e8b5b0ec83e&quot;&gt;ici&lt;/a&gt;
ou &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=905316&quot;&gt;là&lt;/a&gt;),
la loi de dite de Zipf pourrait bien reproduire cette distribution
(j&amp;rsquo;en avais parlé il y a plus d&amp;rsquo;un an dans un billet
sur la loi de&amp;nbsp;George Kingsley Zipf (&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2009/04/01/La-loi-de-Zipf&quot;&gt;ici&lt;/a&gt;),
que j&amp;rsquo;avais fait un peu après avoir joué avec la loi de Benford (&lt;a href=&quot;http://freakonometrics.blog.free.fr/arthur.charpentier/index.php/post/2009/03/10/La-loi-de-Benford%2C-un-peu-de-th%C3%A9orie&quot;&gt;ici&lt;/a&gt;
et &lt;a href=&quot;http://freakonometrics.blog.free.fr/arthur.charpentier/index.php/post/2009/03/19/La-loi-de-Benford%2C-un-peu-de-pratique&quot;&gt;là&lt;/a&gt;)).&amp;nbsp;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;La
presse quotidienne, hebdomadaire ou mensuelle, et les nombres de tirages&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Le monde de la recherche essaye régulièrement de donner
l&amp;rsquo;illusion d&amp;rsquo;une brillante autorégulation, avec une
reconnaissance par ses pairs, des relecteurs anonymes des articles
soumis dans les revues, etc. Mais le monde de la recherche n&amp;rsquo;est pas si
éloigné que ça des querelles d&amp;rsquo;épiciers sur le tirages de la presse....
En fait, si on regarde ce qu&amp;rsquo;on appelle la diffusion de
la presse payante&lt;em&gt; technique et professionnelle&lt;/em&gt; (&lt;a href=&quot;http://www.ojd.com/chiffres/section/PPGP&quot;&gt;ici&lt;/a&gt;) et la presse
payante&lt;em&gt; grand public&lt;/em&gt; (&lt;a href=&quot;http://www.ojd.com/chiffres/section/PPGP&quot;&gt;là&lt;/a&gt;),&amp;nbsp;on retrouve à
très peu de choses prêt la même loi...&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.presse-impact-factor-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;br /&gt;Bref, plus publier dans une revue à gros tirage veut dire qu&amp;rsquo;on est
un meilleur chercheur... ou quelque chose du genre. Le code est ici pour
ceux qui doutent,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;
presse=read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/presses.csv&quot;,sep=&quot;;&quot;,header=TRUE)&lt;br /&gt;&amp;nbsp;#
presse=read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/Science_Journal_Ranking_Version_2003.csv&quot;,sep=&quot;;&quot;,header=TRUE)&lt;br /&gt;&amp;gt;
X=as.numeric(as.character(presse$Diffusion))&lt;br /&gt;&amp;gt;
X=X[is.na(X)==FALSE]&lt;br /&gt;&amp;gt; Xs=sort(X)&lt;br /&gt;&amp;gt;
plot(length(X):1,Xs,col=&quot;blue&quot;,xlab=&quot;Ranking&quot;,ylab=&quot;Tirage (diffusion
France payéé)&quot;)&lt;br /&gt;&amp;gt;
plot(log(length(X):1),Xs,col=&quot;blue&quot;,xlab=&quot;Ranking (log)&quot;,ylab=&quot;Tirage
(diffusion France payéé)&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Liens
avec la théorie des valeurs extrêmes&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
En fait, la loi de Zipf est tout simplement une loi de Pareto dans le
cas discret (oui, les chercheurs ont un don pour donner des noms
différents à des objets identiques, ça permet de faire plusieurs
papiers sans que personne ne se doute de rien... pour ceux qui en
doute, il suffit de croiser sous Google finance avec Zipf, Pareto,
Power law, on va retrouver plein de monde qui raconte exactement la
même chose). Bref, la loi de Pareto donne des choses très proches,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.presse-impact-factor-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
y compris la loi exponentielle qui est un cas limite de la loi de Pareto&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.presse-impact-factor-4_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;br /&gt;On peut d&amp;rsquo;ailleurs aller un peu plus loin, en estimant le paramètre
de la puissance, avec l&amp;rsquo;estimateur de Hill (discuté &lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/02/02/Les-mod%C3%A8les-en-r%C3%A9assurance&quot;&gt;là&lt;/a&gt;),&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.hill-impact-factor_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
ce
qui confirme que les lois sont proches (des lois puissance), même si
dans le cas de la presse française, on est sur un indice proche de 1.5
(à droite), alors que la presse académique est de l&amp;rsquo;ordre de 2 (à
gauche), avec toutefois une explosion du côté des extrêmes (les 30 &lt;em&gt;meilleures
&lt;/em&gt;revues ayant visiblement un impact beaucoup trop important).</description>
    
    
    
      </item>
    
  <item>
    <title>Le paradoxe de Saint Pétersbourg, partie -2</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/11/Le-paradoxe-de-Saint-P%C3%A9tersbroug%2C-partie-2</link>
    <guid isPermaLink="false">urn:md5:850dcab21fbe5a80e685addb02787ca5</guid>
    <pubDate>Thu, 17 Jun 2010 22:17:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Risques</category>
        <category>Bernoulli</category><category>Cramer</category><category>Montmort</category>    
    <description>    &lt;p&gt;
(oui, je commence à numéroter comme les Donjons,
ou comme lorsque je commence des sections ou des sous-sections quand je
fais cours au tableau). J&amp;rsquo;avais fait l&amp;rsquo;autre jour un billet sur le
paradoxe de Saint-Pétersbourg, expliquant que, bien que
l&amp;rsquo;espérance de ce jeu soit infinie, ça reste un
jeu qui s&amp;rsquo;achève très rapidement, car en moyenne,
on n&amp;rsquo;a le droit de ne faire que deux lancers...&lt;br /&gt;
Mais avant d&amp;rsquo;aller plus loin, un petit retour en arrière
s&amp;rsquo;impose. En fait, j&amp;rsquo;ai toujours présenté en
cours la théorie de l&amp;rsquo;espérance de
l&amp;rsquo;utilité comme une réponse à ce
paradoxe. Je me rend compte, après avoir cherché
un peu, que c&amp;rsquo;est un peu plus compliqué ça.
Installons nous confortablement, je vais raconter la petite histoire....&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.sew-and-so-st-petersburg.jpg_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;
En 1738, Daniel Bernoulli a publié un ouvrage
intitulé &lt;em style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Specimen
theoriae novae de mensura sortis&lt;/em&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;&amp;nbsp;
&lt;/span&gt;(que nous pourrons traduire &lt;em&gt;théorie sur la mesure
du risque&lt;/em&gt;, dont la traduction est longuement
commentée dans un document de Pierre Charles Pradier, &lt;a href=&quot;http://picha.univ-paris1.fr/Pradier%25202003c.pdf.&quot;&gt;ici&lt;/a&gt;,
qui note que &lt;em&gt;sortis &lt;/em&gt;est
lié au &lt;em&gt;sort&lt;/em&gt;,
et donc au &lt;em&gt;hasard&lt;/em&gt;,
au &lt;em&gt;risque&lt;/em&gt;).
C&amp;rsquo;est dans cet ouvrage qu&amp;rsquo;il introduit le concept d&amp;rsquo;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;espérance
morale&lt;/span&gt;.&lt;br /&gt;
Toute cette théorie a été reprise dans
la &lt;em&gt;théorie
analytique des probabilités&lt;/em&gt; publiée
par Laplace en 1812,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.laplace-bernoulli_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;La
construction de la fortune morale&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Pour comprendre le cheminement de Daniel Bernoulli, supposons qu&amp;rsquo;une
personne passe d&amp;rsquo;une somme de monnaie&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg01.png&quot; /&gt; à
une somme&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg02.png&quot; /&gt;.
Il
pense que la valeur relative de cet incrément doit
être proportionnel à l&amp;rsquo;incrément&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg03.png&quot; /&gt;,
mais inversement proportionnel à la richesse&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg01.png&quot; /&gt;.
Autrement
dit, la variation de la valeur&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg04.png&quot; /&gt;
vérifie&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg05.png&quot; /&gt;&lt;/div&gt;
ou encore &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg06.png&quot; /&gt;&lt;/div&gt;
Pour reprendre la terminologie de Laplace,&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg01.png&quot; /&gt;
est la &lt;em&gt;fortune physique
&lt;/em&gt;et
y la &lt;em&gt;fortune morale&lt;/em&gt;.
Dans la langue de Daniel Bernoulli,&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg04.png&quot; /&gt;
est appelé &lt;em&gt;emolunmentum&lt;/em&gt;,
et&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; /&gt; &lt;em&gt;summa
bonorum&lt;/em&gt;.
Introduisons alors un peu d&amp;rsquo;aléa. La personne commence avec
une dotation physique&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; /&gt;.
Il peut alors gagner&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg07.png&quot; /&gt;
avec une
probabilité&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg08.png&quot; /&gt;.
Daniel Bernoulli propose alors de poser&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg09.png&quot; /&gt;&lt;/div&gt;
Daniel appelle&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg10.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg10.png&quot; /&gt; &lt;em&gt;emolunmentum
medium&lt;/em&gt;. En conservant une expression de la forme&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg11.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg11.png&quot; /&gt;&lt;/div&gt;
il convient de définir la &lt;em&gt;fortune physique &lt;/em&gt;comme&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg12.png&quot; /&gt;&lt;/div&gt;
Pour reprendre la terminologie de Laplace,&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg13.png&quot; /&gt;
est &quot;&lt;em&gt;l&amp;rsquo;accroissement
de la fortune
physique qui procurerait à l&amp;rsquo;individu le même
avantage moral qui résulte pour lui, de son expectative&lt;/em&gt;&quot;,
ou encore, selon Daniel Bernoulli&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg13.png&quot; /&gt;
est le &quot;&lt;em&gt;lucurm legitime
expectandum seu
sors quoesita&lt;/em&gt;&quot;.&lt;br /&gt;
Il considère alors deux états possibles,&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg14.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg14.png&quot; /&gt;
de probabilités respectives&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg15.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg15.png&quot; /&gt;.
La
fortune physique est alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg16.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg16.png&quot; /&gt;&lt;/div&gt;
On supposera que le jeu est juste, autrement dit&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg17.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg17.png&quot; /&gt;,
ou
avec les notations de Laplace, &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg18.png&quot; /&gt;}&lt;/div&gt;
Daniel Bernoulli (puis plus tard Laplace) montrèrent que
même si le jeu était juste, la fortune physique
était toujours plus petite que&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; /&gt;.
En fait, la
démonstration est simple, car comme on a une mesure de
probabilité,&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg20.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg20.png&quot; /&gt;,
et donc&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg21.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg21.png&quot; /&gt;&lt;/div&gt;
Autrement dit, on doit simplement montrer que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg22.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg22.png&quot; /&gt;&lt;/div&gt;
L&amp;rsquo;astuce pour montrer ce dernier résultat consiste
à noter que le terme de droite peut s&amp;rsquo;écrire&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg23.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg23.png&quot; /&gt;&lt;/div&gt;
ce que revient à comparer une moyenne
géométrique et une moyenne
arithmétique (ce que j&amp;rsquo;avais évoqué
&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php?post/2010/05/11/Moyenne-g%C3%A9om%C3%A9trique-versus-moyenne-arithm%C3%A9tique...&quot;&gt;ici
&lt;/a&gt;avec des dessins).&lt;br /&gt;
A partir de cette théorie, Daniel Bernoulli propose ensuite
une application en assurance. Un armateur possède une
fortune physique&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; /&gt;,
et il espère toucher x si le bateau
arrive à bon port (ce qui surviendra avec
probabilité&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg24.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg24.png&quot; /&gt;).
S&amp;rsquo;il ne s&amp;rsquo;assure pas, sa fortune physique
sera &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg25.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg25.png&quot; /&gt;&lt;/div&gt;
En invoquant encore une fois cette comparaison entre moyenne
géométrique et moyenne arithmétique,
on en déduit que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg26.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg26.png&quot; /&gt;&lt;/div&gt;
Daniel Bernoulli en déduit que l&amp;rsquo;armateur a
intérêt à s&amp;rsquo;assurer dès lors
que la prime d&amp;rsquo;assurance ne dépasse pas&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg27.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg27.png&quot; /&gt;
(qui est la
prime pure en terminologie actuarielle).&lt;br /&gt;
En notant e la prime d&amp;rsquo;assurance, Bernoulli montre qu&amp;rsquo;il faut chercher
ce que nous appellerions un équivalent certain, solution de &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg28.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg28.png&quot; /&gt;&lt;/div&gt;
Il essaye alors de résoudre ce problème comme une
équation en&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; /&gt;
(la prime d&amp;rsquo;asssurance e étant
supposée donnée). Mais je m&amp;rsquo;égare un
peu....&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Le
paradoxe de Saint Petersbourg&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Une fois présenté son problème
d&amp;rsquo;assurance, Daniel Bernoulli reprend un problème qu&amp;rsquo;il
avait soumis à Pierre Rémond de Montmort en
septembre 1713 (&lt;a href=&quot;http://gallica.bnf.fr/ark:/12148/bpt6k110519q&quot;&gt;ici&lt;/a&gt;).
&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.lettre-montmort-bernoulli_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Dans ce jeu, &amp;nbsp;un joueur lance un pièce en l&amp;rsquo;air. Si
&quot;face&quot; apparaît au premier lancer, il touche 1 shilling.
&amp;nbsp;S&amp;rsquo;il tombe sur &quot;pile&quot;, il peut relancer la pièce.
Si &quot;face&quot; apparaît au second lancer, il touche 2 shilling.
&amp;nbsp;S&amp;rsquo;il tombe sur &quot;pile&quot;, il peut relancer la pièce.
Si &quot;face&quot; apparaît au troisième lancer, il touche
4 shilling. &amp;nbsp;S&amp;rsquo;il tombe sur &quot;pile&quot;, il peut relancer la
pièce, etc. A chaque fois qu&amp;rsquo;il fait &quot;face&quot;, il double ses
gains.&lt;br /&gt;
L&amp;rsquo;espérance de gain est alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg30.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg30.png&quot; /&gt;&lt;/div&gt;
qui est une somme infinie.&lt;br /&gt;
Pour résoudre le problème, Daniel Bernoulli
calcule la fortune physique i.e.&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg31.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg31.png&quot; /&gt;&lt;/div&gt;
qui est finie dès lors que&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg19.png&quot; /&gt;
est finie. Par exemple avec&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg32.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/blog/stpg32.png&quot; /&gt;,
on obtient 2. Pour ceux qui veulent s&amp;rsquo;en convaincre
(numériquement)&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;
x0=0&lt;br /&gt;
&amp;gt; prod((x0+2^(0:100))^(1/2^(1:101)))-x0&lt;br /&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Pour une richesse initiale de 1000, Bernoulli montre que la fortune
physique est alors de 6,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;
x0=1000&lt;br /&gt;
&amp;gt; prod((x0+2^(0:100))^(1/2^(1:101)))-x0&lt;br /&gt;
&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 5.972253&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Bref, Daniel Bernoulli avait ainsi montré que ses calculs de
fortune physique permettait d&amp;rsquo;expliquer pourquoi les personnes jouant
à son jeu étaient près à
jouer une somme assez faible (en tous les cas comparé
à la valeur espérée de gain). &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Montmort,
Bernoulli(s)
et Cramer&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
En fait, si Montmort avait évoqué ce&amp;nbsp;&lt;em&gt;paradoxe&lt;/em&gt;
dès 1713, on peut retrouver également ce problème soulevé en 1728 par
Gabriel Cramer, toujours dans des lettres échangées avec &amp;nbsp;Bernoulli,
mais cette fois avec Nicolas, et pas Daniel, &lt;a href=&quot;http://www.cs.xu.edu/math/Sources/Montmort/stpetersburg.pdf&quot;&gt;ici&lt;/a&gt;,&lt;br /&gt;&lt;p&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.cramer-bernoulli-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.cramer-bernoulli-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://freakonometrics.blog.free.fr/public/perso/.cramer-bernoulli-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
A la lecture de
tout cela, on se rend compte que le paradoxe de Saint-Pétersbourg a été
proposé à Bernoulli par Montmort et Cramer, que Cramer introduit
également la notion d&amp;rsquo;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;espérance morale&lt;/span&gt;, bien avant Bernoulli.... L&amp;rsquo;histoire est
souvent bien injuste dès qu&amp;rsquo;on se penche sur les héritages...&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Transfert du blog....</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/11/Transfert-du-blog....</link>
    <guid isPermaLink="false">urn:md5:0d099d7ddc00694d2e1fd99daea3a0cd</guid>
    <pubDate>Fri, 11 Jun 2010 16:14:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Disclamer</category>
        <category>transfert</category>    
    <description>    &lt;p&gt;Le blog devrait progressivement migrer depuis&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/&lt;/span&gt;&lt;/div&gt;vers cette nouvelle adresse,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://freakonometrics.blog.free.fr/index.php/&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;http://freakonometrics.blog.free.fr/index.php/&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
Encore
quelques réglage à faire, et comprendre comment faire proprement du
dotclear avec free... En attendant, je vais probablement mettre les
deux blogs à jour de manière sumultanée. Encore quelques semaines avant
l&amp;rsquo;inauguration.... et un basculement définitif probablement pour la rentrée...&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/tumblr_kxcud2EiXm1qze5g2o1_400.gif&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/tumblr_kxcud2EiXm1qze5g2o1_400.gif&quot; /&gt;
&lt;/div&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Paradoxe de Simpson expliqué par un dessin</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/10/Paradoxe-de-Simpson-expliqu%C3%A9-par-un-dessin</link>
    <guid isPermaLink="false">urn:md5:4f09095c94abd81d67a0867d8e666b9b</guid>
    <pubDate>Thu, 10 Jun 2010 22:36:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>dessin</category><category>Nelsen</category><category>Scarsini</category><category>Simpson</category>    
    <description>    &lt;p&gt;Il y a plusieurs mois, j&amp;rsquo;avais fait un billet sur le &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;paradoxe de Simpson&lt;/span&gt; (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/06/19/Pardaxoe-de-simpson&quot;&gt;ici&lt;/a&gt;).
Pour reprendre un exemple simple, supposons que l&amp;rsquo;on a deux hôpitaux,
affichant les statistiques suivantes, pour les personnes &quot;&lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 255);&quot;&gt;saines&lt;/span&gt;&quot;,&lt;/p&gt;
&lt;table style=&quot;text-align: left; margin-left: auto; margin-right: auto; color: rgb(153, 51, 153); width: 413px; height: 88px;&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;hôpital&lt;/td&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;total&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0);&quot;&gt;survivants&lt;/td&gt;&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;décès&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0);&quot;&gt;taux de&lt;br /&gt;survie&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;hopital A&lt;/td&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;600&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(101, 202, 202); color: rgb(0, 0, 0);&quot;&gt;590&lt;/td&gt;&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;10&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(101, 202, 202); color: rgb(0, 0, 0);&quot;&gt;98%&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;x&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;hopital B&lt;/td&gt;
&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;900&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 102, 102); color: rgb(0, 0, 0);&quot;&gt;870&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;30&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 102, 102); color: rgb(0, 0, 0);&quot;&gt;97%&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;et pour les
personnes &quot;&lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 255);&quot;&gt;malades&lt;/span&gt;&quot;
(on suppose vraiment que le critère est identique pour les deux hôpitaux)&lt;br /&gt;
&lt;table style=&quot;text-align: left; margin-left: auto; margin-right: auto; color: rgb(153, 51, 153); width: 413px; height: 88px;&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;hôpital&lt;/td&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;total&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0);&quot;&gt;survivants&lt;/td&gt;&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;décès&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0);&quot;&gt;taux de&lt;br /&gt;survie&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;hopital A&lt;/td&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;400&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(101, 202, 202); color: rgb(0, 0, 0);&quot;&gt;210&lt;/td&gt;&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;190&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(101, 202, 202); color: rgb(0, 0, 0);&quot;&gt;53%&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;x&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;hopital B&lt;/td&gt;
&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;100&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 102, 102); color: rgb(0, 0, 0);&quot;&gt;30&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;70&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 102, 102); color: rgb(0, 0, 0);&quot;&gt;30%&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Bref, peu importe son état de santé, on a toujours intérêt à choisir l’hôpital
A. D’où le paradoxe. En revanche, si on combine, on obtient &quot;&lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 255);&quot;&gt;globalement&lt;/span&gt;&quot;,&lt;span style=&quot;color: rgb(153, 51, 153);&quot;&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;
&lt;table style=&quot;text-align: left; margin-left: auto; margin-right: auto; color: rgb(153, 51, 153); width: 413px; height: 88px;&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;hôpital&lt;/td&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;total&lt;/td&gt;
&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0);&quot;&gt;survivants&lt;/td&gt;&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center;&quot;&gt;décès&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0);&quot;&gt;taux de&lt;br /&gt;survie&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;hopital A&lt;/td&gt;
&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;1000&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(101, 202, 202); color: rgb(0, 0, 0);&quot;&gt;800&lt;/td&gt;&lt;td style=&quot;color: rgb(0, 0, 0); text-align: center; background-color: rgb(101, 202, 202);&quot;&gt;200&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(101, 202, 202); color: rgb(0, 0, 0);&quot;&gt;80%&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;hopital B&lt;/td&gt;
&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;1000&lt;/td&gt;
&lt;td style=&quot;text-align: center; background-color: rgb(255, 102, 102); color: rgb(0, 0, 0);&quot;&gt;900&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 102, 102); color: rgb(0, 0, 0); text-align: center;&quot;&gt;100&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 102, 102); color: rgb(0, 0, 0);&quot;&gt;90%&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: Arial;&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;on note que l&amp;rsquo;on a intérêt à choisir l&amp;rsquo;hôpital B. Étonnant non&amp;thinsp;? (l&amp;rsquo;exemple vient de Marco Scarsini, et je n&amp;rsquo;ai jamais trouvé plus élégant).&lt;br /&gt;J&amp;rsquo;évoque souvent ce paradoxe en économétrie, et c&amp;rsquo;est ce que j&amp;rsquo;avais fait dans mon précédant billet (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/06/19/Pardaxoe-de-simpson&quot;&gt;ici&lt;/a&gt;).
En fait, Roger Nelsen propose un petit exemple simple permettant de
comprendre comment on peut obtenir un tel paradoxe. L&amp;rsquo;idée est de noter
que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-eq-04.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;et&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-eq-05.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;et pourtant &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-eq-06.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;Cela n&amp;rsquo;a a priori rien d&amp;rsquo;exceptionnel... On peut parfaitement avoir&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-eq-01.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;et&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-eq-02.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;tout en ayant,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-eq-03.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;C&amp;rsquo;est ce que l&amp;rsquo;on peut visualiser ci-dessous,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot; id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/simpson-anim-slow.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Merci Roger....</description>
    
    
    
      </item>
    
  <item>
    <title>Dessins et preuves ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/10/Dessins-et-preuves</link>
    <guid isPermaLink="false">urn:md5:5d00a6f906577f55a71c29f18c7c43e0</guid>
    <pubDate>Thu, 10 Jun 2010 09:10:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>dessin</category><category>Nelsen</category><category>preuve</category><category>proofs without words</category>    
    <description>    &lt;p&gt;
Plusieurs personnes m&amp;rsquo;ont laissé des messages et des
commentaires suites aux derniers dessins, disant en substance &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;c&amp;rsquo;est
bien joli, mais est-ce que c&amp;rsquo;est vraiment une preuve&amp;thinsp;? &lt;/span&gt;&quot;.
Etant incompétent en épistémologie, je
n&amp;rsquo;aurais pas la prétention d&amp;rsquo;apporter des
lumières... En revanche, Olivier m&amp;rsquo;a forwardé (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/04/Le-paradoxe-de-Saint-P%C3%A9terbourg%2C-partie-1?pub=0#pr&quot;&gt;ici&lt;/a&gt;) le
document en ligne &lt;a href=&quot;http://accromath.uqam.ca/contents/pdf/Preuves-sans-mots.pdf&quot;&gt;là&lt;/a&gt;
(on l&amp;rsquo;on retrouve page 4 un dessin plus beau que celui que j&amp;rsquo;avais pu
faire pour montrer que la loi géométrique est une
&lt;em&gt;vraie&lt;/em&gt; loi
de proba), et surtout, il&amp;nbsp;m&amp;rsquo;a fait découvrir &lt;a href=&quot;http://fr.wikipedia.org/wiki/Preuve_sans_mots&quot;&gt;ici&lt;/a&gt;
la notion de &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;preuve
sans mots&lt;/span&gt;&quot;, où l&amp;rsquo;on retrouve une
très jolie preuve animée (je me rends compte que
l&amp;rsquo;animation aide vraiment à la compréhension,
c&amp;rsquo;est ça que j&amp;rsquo;aurais du faire depuis le début)
du théorème de Pythagore (que je continue de
mentionner en cours, comme &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/?q=pythagore&quot;&gt;là&lt;/a&gt;,
lorsque je dois parler de formule de décomposition de la
variance). Bref, sur la page wiki est mentionné des ouvrages
de Roger Nelsen, que je dévore depuis ce matin.&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;table style=&quot;width: 100px; text-align: left; margin-left: auto; margin-right: auto;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;p id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/book2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;&lt;p id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/book3.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;(ainsi que quelques livres avec Claudi Alsina). Pour la petite
histoire, c&amp;rsquo;est justement Roger qui m&amp;rsquo;avait expliqué comme
obtenir ces propriétés de la loi
géométrique, à l&amp;rsquo;époque
où je faisais un &lt;em&gt;short
course &lt;/em&gt;à Samos, en , sur &lt;em&gt;advanced statistical methods in
insurance&lt;/em&gt;. J&amp;rsquo;avais évoqué
l&amp;rsquo;importance de la loi géométrique dans le
concept de période de retour, et Roger m&amp;rsquo;avait expliquer
comment retrouver l&amp;rsquo;histoire de l&amp;rsquo;espérance de la loi
géométrique sans équations....&lt;/div&gt;&lt;/div&gt;
J&amp;rsquo;ai retrouvé plusieurs dessins que j&amp;rsquo;avais fait dans mes cahiers de prépas (que je
commence à ressortir ces derniers temps, depuis que je dois
revenir sur quelques concepts fondamentaux de convexité et
de topologie... et qui m&amp;rsquo;avait servi pour les dessins que j&amp;rsquo;avais déjà pu faire, &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/05/11/Moyenne-g%C3%A9om%C3%A9trique-versus-moyenne-arithm%C3%A9tique...&quot;&gt;ici&lt;/a&gt;
en particulier), et surtout j&amp;rsquo;en ai découvert un paquet
d&amp;rsquo;autres, que je ne pourrais pas m&amp;rsquo;empêcher
d&amp;rsquo;évoquer dans de futurs billets... D&amp;rsquo;ailleurs, je me suis rendu compte
qu&amp;rsquo;on pouvait retrouver un bon nombre de ces exemples directement sur
jstor, &lt;a href=&quot;http://www.jstor.org.gate3.inist.fr/action/doBasicSearch?Query=roger+nelsen+proof+without+words&amp;amp;gw=jtx&amp;amp;prq=roger+nelsen&amp;amp;Search=Search&amp;amp;hp=25&amp;amp;wc=on&quot;&gt;là&lt;/a&gt;. Par exemple, il propose une interprétation
de la comparaison de plusieurs moyennes (arithmétique, géométrique,
etc), plus complète que ce que j&amp;rsquo;avais pu faire,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.nelsen-comparaison-moyennes_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Sur la &lt;em&gt;preuve&lt;/em&gt; par le dessin, Jean-Paul Delahaye apporte les éclaircissements suivant, &lt;a href=&quot;http://accromath.uqam.ca/contents/pdf/Preuves-sans-mots.pdf&quot;&gt;ici&lt;/a&gt;, en citant David Hilbert qui disait&amp;nbsp;: «&amp;nbsp;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;les
règles pour écrire une démonstration doivent être si claires que si
quelqu’un&amp;nbsp;vous propose une démonstration, alors une procédure mécanique
doit pouvoir assurer que la démonstration est correcte, c’est-à-dire
qu’elle obéit aux règles&lt;/span&gt;.&amp;nbsp;». Il détaille par ailleurs cet argument, &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;ce
que les Grecs – par exemple Euclide – considéraient comme une
démonstration est aujourd’hui encore, moyennant quelques adaptations
dans le style et les notations, toujours considéré comme une
démonstration. En revanche, nous avons beaucoup avancé sur les
notations, la structure logique des&amp;nbsp;arguments, et la compréhension de
ce qu’il est possible d’attendre de la méthode axiomatique. Nos
notations et la logique mathématique ont tellement progressé que,
contrairement aux Grecs, nous savons formaliser les démonstrations que
nous écrivons&lt;/span&gt;.&quot;&lt;br /&gt;Bref, pour ma part, je trouve cela tellement
élégant (et surtout je sais que Roger est beaucoup plus compétent en
maths que moi) que je ne m&amp;rsquo;empêcherais pas de mettre ici le compte
rendu de mes lectures&amp;thinsp;! Merci Roger, et Olivier....</description>
    
    
    
      </item>
    
  <item>
    <title>Discussions géométriques du soir (partie 2)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/07/Discussions-geometriques-du-soir-2</link>
    <guid isPermaLink="false">urn:md5:8b674cba072a10c9a4d1a904f2d27cd3</guid>
    <pubDate>Mon, 07 Jun 2010 23:26:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>bois</category><category>paradoxe</category><category>probabilité</category><category>triangle</category>    
    <description>    &lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/bambou.png&quot; alt=&quot;&quot; style=&quot;margin: 0 0 1em 1em; float: right;&quot; title=&quot;bambou.png, juin 2010&quot; /&gt;J&amp;rsquo;avais raconté l&amp;rsquo;autre jour l&amp;rsquo;aventure de mon fils qui souhaitait faire des triangles avec des bouts de bois (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/04/29/Discussions-g%C3%A9om%C3%A9triques-du-matin-%28partie-1%29&quot;&gt;ici&lt;/a&gt;). Il a récidivé ce soir. Sauf qu&amp;rsquo;il n&amp;rsquo;avait qu&amp;rsquo;un grand baton, et que j&amp;rsquo;avais fermé le portillon qui l&amp;rsquo;empêchait d&amp;rsquo;aller dans la forêt en chercher (la nuance entre romancer et devenir mythomane doit être mince). Je lui ai suggéré de le casser en trois portions, puis de constituer un triangle avec les trois morceaux restant. Manque de bol, l&amp;rsquo;expérience rate (comme l&amp;rsquo;autre fois). Et me souvenant de mes pénibles calculs de la dernière fois, je me suis rappelé qu&amp;rsquo;il avait une chance sur deux de pouvoir effectivement construire un triangle... sauf que la manière d&amp;rsquo;obtenir les trois bouts de bois me semble différente... donc peut être que ce 1/2 n&amp;rsquo;est plus valide&amp;thinsp;?&lt;br /&gt;En fait, je crois qu&amp;rsquo;il faut définir clairement comment on va couper les bouts de bois.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;méthode 1: le coupage simultané&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Je suppose que je peux couper d&amp;rsquo;un coup le bout de bois en deux. Formellement, je tire deux points sur l&amp;rsquo;intevalle correspondant à mon bout de bois, les tirages étant uniformes, et indépendants. On arrive alors à trois morceaux,&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica,'Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png.2.php.png&quot; alt=&quot;alatex2png.2.php.png&quot; /&gt;,&amp;nbsp;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-1.2.php.png&quot; alt=&quot;alatex2png-1.2.php.png&quot; /&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans','Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;et&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica,'Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-2.2.php.png&quot; alt=&quot;alatex2png-2.2.php.png&quot; /&gt;,&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans','Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;en sachant que&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p style=&quot;margin: 0; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-3.2.php.png&quot; alt=&quot;alatex2png-3.2.php.png&quot; /&gt;&lt;/p&gt;
la longueur du bout de bois dont je diposais initialement. On supposera que&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica,'Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/aalatex2png.2.png&quot; alt=&quot;aalatex2png.2.png&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans','Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;=1 pour simplifier (ce qui ne changera rien au résultat final, on s&amp;rsquo;en doute). L&amp;rsquo;ensemble des points que je peux obtenir peuvent alors se visualiser comme des points du simplexe,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-4.2.php.png&quot; alt=&quot;alatex2png-4.2.php.png&quot; /&gt;&lt;/p&gt;
autrement dit, on peut les représenter dans le triangle équilatéral ci-dessous.&lt;br /&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-1.PNG&quot; alt=&quot;&quot; style=&quot;margin: 0 auto; display: block;&quot; title=&quot;triangle-bois-1.PNG, juin 2010&quot; /&gt;Or on ne peut constituer un triangle que si la plus grande des longeurs n&amp;rsquo;excède pas la somme des deux autres. Supposons que&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica,'Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-2.2.php.png&quot; alt=&quot;alatex2png-2.2.php.png&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans','Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&amp;nbsp;soit la plus grande longueur (et qu&amp;rsquo;elle soit visualisée graphiquement par rapport à la distance au côté en bas), le point rouge ci-dessous (correpondant à un triplet de longueurs possibles) ne convient pas. En fait, dès lors que l&amp;rsquo;on entre dans l&amp;rsquo;aire rosée, on ne peut plus constituer un triangle...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-3.PNG&quot; alt=&quot;&quot; title=&quot;triangle-bois-3.PNG, juin 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; /&gt;Moralité, à moins de tomber dans le triangle jaune, on ne peut pas constituer de triangle.... Ce qui veut dire qu&amp;rsquo;on n&amp;rsquo;a plus qu&amp;rsquo;une chance sur quatre&amp;thinsp;!&lt;div&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-2.PNG&quot; alt=&quot;&quot; title=&quot;triangle-bois-2.PNG, juin 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; /&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;méthode 2: le coupage séquentiel&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Une autre méthodde consister à couper d&amp;rsquo;abord en deux (en tirant un point au hasard sur mon intervalle), puis de recouper en deux le&amp;nbsp;&lt;em&gt;plus grand&amp;nbsp;&lt;/em&gt;morceau... Damned, mon fils a de bonne idée, mais ça sent les calculs à n&amp;rsquo;en plus finir ça...Ou alors va falloir continuer à essayer de faire des dessins, car mine de rien, c&amp;rsquo;est plus simple que les calculs de la dernière fois. Bon, la longueur de mon bout de bois est la hauteur de mon triangle. Je commence par le couper en deux, la distance au côté en bas devant être la plus petite des deux.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-4.PNG&quot; alt=&quot;&quot; title=&quot;triangle-bois-4.PNG, juin 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; /&gt;&lt;/div&gt;&lt;div&gt;Une fois fixé la taille de ce petit bout, il me reste à couper le plus grand morceaux en deux. Pour cela, je vais me déplacer le long du segment rouge ci-dessous,&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-5.PNG&quot; alt=&quot;&quot; title=&quot;triangle-bois-5.PNG, juin 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; /&gt;La position sur ce petit segment me donnant ensuite les deux autres longueurs des morceaux. Or rappelons que pour que nos bouts de bois forments un triangle, il faut forcément appartenir au triangle jaune,&lt;br /&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-6.PNG&quot; alt=&quot;&quot; style=&quot;margin: 0 auto; display: block;&quot; title=&quot;triangle-bois-6.PNG, juin 2010&quot; /&gt;Pour résumé, nous avions exclus la partie supérieure du triangle, et conditionnellement au fait que nous sommes dans le lozange inférieur, nous souhaitons être dans le triangle jaune. Arg, cette fois-ci la probabilité passe à une chance sur trois&amp;thinsp;!&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/triangle-bois-7.PNG&quot; alt=&quot;&quot; style=&quot;margin: 0 auto; display: block;&quot; title=&quot;triangle-bois-7.PNG, juin 2010&quot; /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;couper d&amp;rsquo;un coup comme découpage séquentiel aléatoire&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/aspirinenew.png&quot; alt=&quot;&quot; title=&quot;ASPIRIN.PNG, juin 2010&quot; style=&quot;margin: 0 0 1em 1em; float: right;&quot; /&gt;Mais attends deux minutes mon bonhomme (oui, je parle à mon fils). Si j&amp;rsquo;avais choisi de découper le plus petit morceau, on sait qu&amp;rsquo;il est impossible de constituer un triangle car par définition&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica,'Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-5.2.php.png&quot; alt=&quot;alatex2png-5.2.php.png&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans','Lucida Grande','Lucida Sans Unicode',Arial,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Supposons que l&amp;rsquo;on casse le baton en deux, et que l&amp;rsquo;on tire ensuite au hasard (avec probabilité 1/2 et 1/2) quelle partie sera alors coupée en deux, on doit se ramener au cas précédant non&amp;thinsp;? La probabilité de constituer un triangle doit alors être&lt;p style=&quot;margin: 0; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/alatex2png-6.2.php.png&quot; alt=&quot;alatex2png-6.2.php.png&quot; /&gt;&lt;/p&gt;
Damned, mais ça ne fait pas un quart ça&amp;thinsp;! Bon, je crois que je vais prendre une aspirine et aller demander à mon fils d&amp;rsquo;aller ranger ses bâtons&amp;thinsp;!&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/div&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Comprendre les tableaux croisés, 1</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/07/Comprendre-les-tableaux-crois%C3%A9s%2C-1</link>
    <guid isPermaLink="false">urn:md5:331e02e352203d9dce65205557654713</guid>
    <pubDate>Mon, 07 Jun 2010 11:12:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>AFC</category><category>chi</category><category>contingence</category><category>doctorants</category><category>France</category><category>Maître de Conférences</category><category>Pearson</category><category>résidus</category><category>tableau croisé</category>    
    <description>    &lt;p&gt;Je voulais faire quelques billets rapides sur les tableaux croisés,
suite à des demandes consécutives à mon billet sur le sexe des bébés (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/05/23/Sexe-et-naissances&quot;&gt;ici&lt;/a&gt;).
Pour commencer, je vais m&amp;rsquo;intéresser au cas où les variables supposées
indépendantes (d&amp;rsquo;autres billets seront l&amp;rsquo;occasion de tester d&amp;rsquo;autres
types d&amp;rsquo;hypothèses). Histoire de trouver des données un peu originales,
on peut traîner sur internet. Etant tombé (presque) par hasard sur le
fichier pdf &lt;a href=&quot;http://media.enseignementsup-recherche.gouv.fr/file/statistiques/27/6/orig2008_60276.pdf&quot;&gt;ici&lt;/a&gt;, j&amp;rsquo;ai voulu m&amp;rsquo;intéresser à l&amp;rsquo;&lt;em&gt;origine des enseignants-chercheurs recrutés lors de la campagne 2008&lt;/em&gt;
(comme le dit le titre du document en ligne sur le site du ministère).
Prenons deux variables catégorielles géographiques, par exemple &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-01.png&quot; /&gt;, ville (au sens large) où l&amp;rsquo;on a soutenu sa thèse &lt;/li&gt;
&lt;li&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-02.png&quot; /&gt;, ville (au sens large) où l&amp;rsquo;on a obtenu un poste de maître de conférence&lt;/li&gt;
&lt;/ul&gt;
Compte
tenu des règles de non-recrutement local, on devrait pouvoir supposer
que ces variables sont indépendantes. En fait, je ne raisonne pas ici
par université, mais par ville, ce qui correspond à un recrutement
local au sens large (passer de Paris 6 à Paris 7 sera ici considéré
comme &quot;&lt;em&gt;local&lt;/em&gt;&quot;). &lt;br /&gt;L&amp;rsquo;étude a
été faite à partir des données disponibles &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/contingence-universite_1.csv&quot;&gt;ici&lt;/a&gt; et &lt;a href=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/contingence-universite_2.csv&quot;&gt;là&lt;/a&gt;. Petite précaution
d&amp;rsquo;usage: ce sont les données de la campagne 2008, avant que les comités
de sélection ne soient mis en place. Il conviendrait de refaire l&amp;rsquo;étude
une fois les nouvelles données publiques. On a deux bases, une en
droit-économie-gestion, et une en sciences. J&amp;rsquo;insiste sur le fait que
l&amp;rsquo;on a des données sur une année seulement, donc avec peu
d&amp;rsquo;observations... Mais comme l&amp;rsquo;indique le titre, je vais parler des
outils visualisation des tableaux croisés, pas faire un billet sur le
recrutement local. Voilà pour les précautions d&amp;rsquo;usage...&lt;br /&gt;Pour
visualiser ici, j&amp;rsquo;ai fait des regroupements, car avec 25 villes, ça ne
tient pas dans mon billet (mais par la suite, l&amp;rsquo;analyse sera plus
fine). Les données de base sont les suivantes, les lignes étant
l&amp;rsquo;endroit où un doctorant a soutenu sa thèse (en économie ou droit), et
en colonnes, l&amp;rsquo;endroit où a été recruté un maître de conférence,&lt;br /&gt;&lt;table style=&quot;text-align: left; width: 352px; height: 204px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province &lt;br /&gt;(autre)&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région&lt;br /&gt;parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;8&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;13&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province (autre)&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;124&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;23&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;150&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;13&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;49&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;63&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;9&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;145&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;72&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 0);&quot;&gt;226&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Classiquement, on peut retraduire ces chiffres (qui sont des comptages) sous la forme de probabilités,&lt;br /&gt;&lt;table style=&quot;text-align: left; width: 391px; height: 204px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province &lt;br /&gt;(autre)&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région&lt;br /&gt;parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;2,21%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;3,54%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;5,75%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province (autre)&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;1,32%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;54,86%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;10,18%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;66,37%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0.44%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;5,75%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;21,68%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;27,88%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;3,98%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;64,15%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;31,86%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 0);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Les probabilités qui apparaissent sur les &lt;em&gt;totaux&lt;/em&gt;
sont les probabilités marginales. Aussi, au bout de la première ligne
on trouve que 5,75% des doctorants qui ont eu un poste en 2008 avaient
soutenu leur thèse à Rennes (ou dans la région, i.e. les universités de
Rennes 1, de Rennes 2 et de Brest). De manière similaire, en bas de la
première colonne, 3,98% des maîtres de conférences recrutés en 2008 ont
été recrutés à Rennes. &lt;br /&gt;Deux autres tableaux classiques sont alors les profils ligne et profils colonnes, c&amp;rsquo;est à dire les probabilités conditionnelles,&lt;br /&gt;&lt;table style=&quot;text-align: left; width: 391px; height: 204px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province &lt;br /&gt;(autre)&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région&lt;br /&gt;parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;38,46%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;61,54%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province (autre)&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;2,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;82,67%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;15,33%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;1,58%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;20,64%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;77,78%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;3,98%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;64,15%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;31,86%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 0);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;par
ligne, autrement dit, pour un étudiant qui a soutenu sa thèse à Rennes
(et qui a eu un poste de Maître de Conférences), il avait &amp;nbsp;38,46% de
chance de rester à Rennes (ou plutôt en Bretagne), et 61,54% de chance
d&amp;rsquo;aller dans une autre ville de province. Côté colonnes,&lt;br /&gt;&lt;table style=&quot;text-align: left; width: 391px; height: 204px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province &lt;br /&gt;(autre)&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région&lt;br /&gt;parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;55,56%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;5,52%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;5,75%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province (autre)&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;33,33%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;85,52%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;31,94%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;66,37%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;11,11%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;8,96%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;68,06%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;27,88%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;100,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;100,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;100,00%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 0);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Ici,
on lit que pour un Maître de Conférences recruté sur la région
parisienne, il y avait 68,06% de chances pour qu&amp;rsquo;il ait fait en région
parisienne.&lt;br /&gt;Bref, à partir de ces tableaux, on peut essayer de
tester l&amp;rsquo;hypothèse d&amp;rsquo;indépendance, et si cette dernière n&amp;rsquo;est pas
vérifiée, on va essayer de comprendre pourquoi.&lt;br /&gt;Mais avant, rappelons que l&amp;rsquo;hypothèse d&amp;rsquo;indépendance se traduit par le fait que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-03.png&quot; /&gt;&lt;/div&gt;La
valeur de gauche est la probabilité jointe (que l&amp;rsquo;on retrouve au coeur
du second tableau), alors que les deux autres sont les probabilités
marginales, qui apparaissent en bas, et à droite (dans les totaux).
Bref, on pourrait construire le tableau des probabilités que l&amp;rsquo;on
devrait avoir &lt;em&gt;sous hypothèse d&amp;rsquo;indépendance&lt;/em&gt;,&lt;br /&gt;&lt;table style=&quot;text-align: left; width: 391px; height: 204px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province &lt;br /&gt;(autre)&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région&lt;br /&gt;parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0,22%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;3,69%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;1,83%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;5,75%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province (autre)&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;2,64%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;42,58%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;21,14%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;66,37%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;1,11%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;17,88%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;8,88%&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;27,88%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;3,98%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;64,15%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;31,86%&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 0);&quot;&gt;100,00%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;que l&amp;rsquo;on peut retraduire en terme d&amp;rsquo;effectif espéré, toujours sous l&amp;rsquo;hypothèse d&amp;rsquo;indépendance. Pour
ceux qui connaissent les copules, on change juste la structure de
dépendance ici, pas les lois marginales (ou les effectifs marginaux)
qui restent inchangés.&lt;br /&gt;&lt;table style=&quot;text-align: left; width: 352px; height: 204px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province &lt;br /&gt;(autre)&lt;/td&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région&lt;br /&gt;parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Rennes&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;0,5&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;8,3&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;4,2&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;13&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Province (autre)&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;6,0&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;96,2&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;47,8&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;150&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;background-color: rgb(255, 255, 102); text-align: center;&quot;&gt;Région parisienne&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;2,5&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;40,5&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 255, 0);&quot;&gt;20&lt;/td&gt;&lt;td style=&quot;text-align: center; color: rgb(0, 0, 0); background-color: rgb(255, 204, 102);&quot;&gt;63&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;9&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;145&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 102);&quot;&gt;72&lt;/td&gt;&lt;td style=&quot;text-align: center; background-color: rgb(255, 204, 0);&quot;&gt;226&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;L&amp;rsquo;outils de base pour comparer ces données est la distance du chi-deux.&lt;br /&gt;La statistique du chi-deux est &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-04.png&quot; /&gt;&lt;/div&gt;ou encore&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-05.png&quot; /&gt;&lt;/div&gt;Karl
Pearson avait été un des premiers à étudier ces grandeurs, sous des
hypothèses de normalité (des sommes de lois normales indépendantes au
carré se ramenant à des lois du chi-deux).&lt;br /&gt;On notera qu&amp;rsquo;une approche alternative est de supposer que les nombres (ou les effectifs) suivent une loi de &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Poisson&lt;/span&gt;. On peut alors se demander si&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-06.png&quot; /&gt;&lt;/div&gt;Si on suppose avoir une loi de Poisson, on peut s&amp;rsquo;intéresser aux &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;résidus de Pearson&lt;/span&gt;,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-07.png&quot; /&gt;&lt;/div&gt;autrement
dit, on retrouve des grandeurs très proches de la contribution au
chi-deux (en prenant le carré). On aussi le signe qui nous indique s&amp;rsquo;il
y a trop peu de monde, ou au contraire par assez....&lt;br /&gt;Si je travaille sur la base totale, soit environ 25 &quot;&lt;em&gt;villes&lt;/em&gt;&quot;, on obtient&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; cont1=read.table(&quot;http://perso.univ-rennes1.fr/arthur.charpentier/contingence-universite_1.csv&quot;,&lt;br /&gt;+ header=TRUE,sep=&quot;;&quot;)&lt;br /&gt;&amp;gt; cont2=cont1&lt;br /&gt;&amp;gt; for(i in 1:ncol(cont2)){&lt;br /&gt;+ for(j in 1:nrow(cont2)){&lt;br /&gt;+ if(is.na(cont2[j,i]==TRUE)){cont2[j,i]=0}&amp;nbsp;} }&lt;br /&gt;&amp;gt; X=as.matrix(cont2[1:nrow(cont2),2:ncol(cont2)])&lt;br /&gt;&amp;gt; rownames(X)=as.character(cont2[,1])&lt;br /&gt;&amp;gt; colnames(X)=names(cont2[2:ncol(cont2)])&lt;br /&gt;&amp;gt; X=X[,-2]&lt;br /&gt;&amp;gt; X=X[-2,]&lt;br /&gt;&amp;gt; X=X[,-9]&lt;br /&gt;&amp;gt; X=X[-9,]&lt;br /&gt;&amp;gt; Z=X[-nrow(X),]&lt;br /&gt;&amp;gt; Z=Z[,-ncol(Z)]&lt;br /&gt;&amp;gt; Z=Z[-nrow(Z),]&lt;br /&gt;&amp;gt;&amp;nbsp;chisq.test(Z)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pearson&amp;rsquo;s Chi-squared test&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;data:&amp;nbsp; Z &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;X-squared = 1342.546, df = 576, p-value &amp;lt; 2.2e-16&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;La
base est assez sale, j&amp;rsquo;ai fait un copier/coller rapide du fichier pdf
(et je vire les Antilles et la Réunion car après je voudrais faire un
peu de visualisation sur une carte). Autrement dit, l&amp;rsquo;hypothèse
d&amp;rsquo;indépendance ne semble pas validée par le test du chi-deux. Essayons
maintenant de comprendre un peu mieux les interactions dans notre
carré...&lt;br /&gt;Si on regarde les problèmes de recrutement local, il faut regarder ce qui se passe sur la &lt;em&gt;diagonale&lt;/em&gt; de la matrice des résidus,&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt; CT=chisq.test(Z)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Message d&amp;rsquo;avis&amp;nbsp;:&lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;In chisq.test(Z)&amp;nbsp;: l&amp;rsquo;approximation du Chi-2 est peut-être incorrecte&lt;/span&gt;&lt;br /&gt;&amp;gt; Dia=diag(CT$residuals)&lt;br /&gt;&amp;gt; names(Dia)=rownames(Z)&lt;br /&gt;&amp;gt; Dia&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;AIX-MARSEILLE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BESANCON&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BORDEAUX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAEN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLERMONT&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.43901593&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.26116568&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.37261202&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10.53607373&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.12692873 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CORSE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIJON&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GRENOBLE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LILLE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIMOGES&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.56426340&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.10931024&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9.18869705&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7.59456681&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.56426340 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LYON&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MONTPELLIER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NANCY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NANTES&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NICE&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.16119625&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.18366071&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.84765951&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.67087742&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7.86973591 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORLEANS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; POITIERS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REIMS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RENNES&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROUEN&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.79480842&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.81144228&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.06651901&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.22963060&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.57435350 &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STRASBOURG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOULOUSE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARIS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CRETEIL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERSAILLES&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(204, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.64850464&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.12289099&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.46092001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.22061860&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.01351350 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Visuellement, sur une carte de France, on obtient la distribution ci-dessous, pour les postes en économie et droit,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.france-Dia-ED_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et ci-dessous pour les postes en sciences et pharmacie,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.france-Dia-SP_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Si
on regarde le tableau des résidus on obtient les valeurs suivantes sur
la ligne correspondant à Rennes, i.e. les endroits où vont les
étudiants ayant soutenu leur thèse à Rennes,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.doct-mdc-rennes-droit-eco_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
avec en &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;bleu&lt;/span&gt; les valeurs positives, et en &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt;
les valeurs négatives. A droite sont représentées les lignes, i.e. les
endroits d&amp;rsquo;où viennent les Maîtres de Conférences recrutés à Rennes.&lt;br /&gt;Au
lieu de regarder ville par ville, on peut aussi faire une petite
animation, soit sur les endroits où sont partis les doctorants,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot; id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/eco-droit-doctorant.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
ou les endroits d&amp;rsquo;où viennent les Maîtres de Conférence recrutés,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot; id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/eco-droit-mdc.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; id=&quot;media-original-image&quot;&gt;On peut également s&amp;rsquo;il existe des interactions, ou des échanges d&amp;rsquo;une ville à l&amp;rsquo;autre. Dans ce cas, les résidus croisées&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-08.png&quot; /&gt; et&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/cont-09.png&quot; /&gt; doivent être positifs.&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.interaction-uvic_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot; id=&quot;media-original-image&quot;&gt;Bref, au delà du &quot;recrutement local&quot; on voit également apparaître de fortes interactions régionales (Rennes-Nantes, Toulouse-Bordeaux, Orléans-Paris). &lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; id=&quot;media-original-image&quot;&gt;Avant de conclure, il existe une autre technique permettant de mieux visualiser les interactions, c&amp;rsquo;est l&amp;rsquo;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;analyse factorielle des correspondances&lt;/span&gt;
(je renvois &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/?q=AFC&quot;&gt;ici&lt;/a&gt; pour des slides). Si on regarde les 2 premiers axes
principaux, en sciences (à gauche) et en droit et économie (à droite),
on obtient les projections suivantes des modalités, avec en &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;bleu&lt;/span&gt; les villes où les étudiants ont soutenu leur thèse, en &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt; les villes où les postes de Maître de Conférences ont été obtenus,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.afc-univ-12_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et sur les les 2 axes suivants&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.afc-univ-34_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
comme souvent en statistique, afin de mieux comprendre&amp;nbsp;un ajustement de
modèle (ou comme ici lors la réalisation d&amp;rsquo;un test d&amp;rsquo;hypothèse) la
visualisation des résidus est la technique de base (c&amp;rsquo;était l&amp;rsquo;idée
d&amp;rsquo;ailleurs du commentaire que j&amp;rsquo;avais fait &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/03/25/Le-bagplot%2C-comme-extension-du-boxplot&quot;&gt;là&lt;/a&gt;).&lt;br /&gt;Voilà pour la première partie, sur les modèles où l&amp;rsquo;on suppose l&amp;rsquo;indépendance. La prochaine fois, on verra d&amp;rsquo;autres formes d&amp;rsquo;hypothèses.</description>
    
    
    
      </item>
    
  <item>
    <title>Le paradoxe de Saint Péterbourg, partie 1</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/04/Le-paradoxe-de-Saint-P%C3%A9terbourg%2C-partie-1</link>
    <guid isPermaLink="false">urn:md5:5e4e68fdf489dd7a53bb89ec4363fd98</guid>
    <pubDate>Fri, 04 Jun 2010 21:50:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>dessin</category><category>géometrique</category><category>saint petersbourg</category>    
    <description>    &lt;p&gt;Pour répondre à une question sur mon précédant billet (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/04/Z%C3%A9non%2C-sommes-infinies-et-loi-g%C3%A9om%C3%A9trique&quot;&gt;ici&lt;/a&gt;),
je vais revenir sur un paradoxe assez classique, le paradoxe de Saint
Petersbourg. Mais avant de parler du paradoxe, et de ses implications
en théorie de la décision dans l&amp;rsquo;incertain, je voulais présenter le
jeu, et en profiter pour jouer à faire des dessins puisque j&amp;rsquo;ai cru
remarquer que j&amp;rsquo;avais des amateurs d&amp;rsquo;explications géométriques.&lt;br /&gt;Le jeu est simple, c&amp;rsquo;est un jeu de pile ou face répété, le jeu s&amp;rsquo;arrêtant à la sortie du premier &quot;&lt;em&gt;face&lt;/em&gt;&quot; (et on le verra par la suite, l&amp;rsquo;idée est de doubler ses gains chaque fois que &quot;&lt;em&gt;pile&lt;/em&gt;&quot; sort).&lt;br /&gt;Aussi, le temps d&amp;rsquo;arrêt du jeu est&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-01.png&quot; /&gt; dont la loi est simplement&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-02.png&quot; /&gt; &amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-03.png&quot; /&gt;&lt;br /&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-04.png&quot; /&gt; &amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-05.png&quot; /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;... etc. On
retrouve ainsi une loi géométrique de paramètre 1/2. L&amp;rsquo;espérance du
nombre de lancers que l&amp;rsquo;on ferra avant que le jeu ne s&amp;rsquo;arrête est fini
(alors qu&amp;rsquo;on le verra le gain espéré est infini), et vaut l&amp;rsquo;inverse de
cette probabilité, i.e. 2. Pour ceux qui ont oublié la formule (que
l&amp;rsquo;on obtient de manière assez calculatoire, en faisant une dérivation
dans une série), on peut refaire le calcul,&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-06.png&quot; /&gt;&lt;/div&gt;Personnellement, je ne sais pas calculer cette somme (infinie), mais comme dans mon précédant billet (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/04/Z%C3%A9non%2C-sommes-infinies-et-loi-g%C3%A9om%C3%A9trique&quot;&gt;ici&lt;/a&gt;), il existe une somme que l&amp;rsquo;on peut calculer simplement en faisant un petit dessin,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.st-peterbourg_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
J&amp;rsquo;ai 1 carré (&lt;span style=&quot;color: rgb(204, 51, 204);&quot;&gt;mauve&lt;/span&gt;) de surface 1, 2 (&lt;span style=&quot;color: rgb(51, 204, 255);&quot;&gt;bleus&amp;nbsp;&lt;/span&gt;) de surface 1/2, puis 3 (&lt;span style=&quot;color: rgb(51, 255, 51);&quot;&gt;verts&lt;/span&gt;) de surface 1/4, puis 4 (&lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;jaunes&lt;/span&gt;) de surface 1/8, puis 5 (&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;rouges&lt;/span&gt;) de surface 1/16, 6 (&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;oranges&lt;/span&gt;) de surface 1/32, etc. Autrement dit&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/stpb-07.png&quot; /&gt;&lt;/div&gt;Or
l&amp;rsquo;espérance que l&amp;rsquo;on cherche à calculer, c&amp;rsquo;est cette somme, à un
facteur 2 près.... &amp;nbsp;Aussi, en moyenne, on peut espérer faire 2 lancers
(la moitié de la surface)&amp;thinsp;! Ce qui correspond précisément à l&amp;rsquo;espérance
d&amp;rsquo;une loi géométrique de paramètre 1/2. Décidément, on peut faire plein
de choses avec des petits dessins..</description>
    
    
    
      </item>
    
  <item>
    <title>Zénon, sommes infinies et loi géométrique</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/04/Z%C3%A9non%2C-sommes-infinies-et-loi-g%C3%A9om%C3%A9trique</link>
    <guid isPermaLink="false">urn:md5:b2468d87f01af221b0de99a25e765d18</guid>
    <pubDate>Fri, 04 Jun 2010 15:02:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>mathématiques</category>
        <category>Canard</category><category>Chatel</category><category>infini divisibilité</category><category>infinie</category><category>loi géométrique</category><category>somme</category><category>Zénon</category>    
    <description>    &lt;p&gt;&lt;img title=&quot;zenon-canard.PNG, juin 2010&quot; style=&quot;margin: 0 0 1em 1em; float: right;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zenon-canard.PNG&quot; /&gt;Ayant parlé plusieurs fois de Luc Chatel sur mon blog je n&amp;rsquo;ai pas pu m&amp;rsquo;enpêcher de mettre l&amp;rsquo;image qui est à la une du &lt;em&gt;Canard&lt;/em&gt; de cette semaine. &lt;br /&gt;Pour
ceux qui se souviennent de leurs cours de philo au lycée, c&amp;rsquo;est le
paradoxe de Zénon (ou presque). Pour cela il faut fermer les yeux et
imaginer une flèche en vol (en fait non, je viens de faire
l&amp;rsquo;expérience, si on ferme les yeux, on ne peut pas lire la suite, ça ne
marche qu&amp;rsquo;en cours cette histoire). La flèche est lancée à 10 mètre de
sa cible. Il faut un certain temps, non nul, à cette pierre pour
parcourir la moitié de la distance qui la sépare de la cible. Ensuite,
il lui reste encore 5 mètres à parcourir,
dont elle accomplit d&amp;rsquo;abord la moitié, 2,5 mètres, ce qui lui prend un
certain temps. Puis elle parcourt la moitié, puis la moitié, et cela -
à chaque fois - avec un temps non nul.&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;&amp;nbsp;Zénon&lt;/span&gt; (Ζήνων, parfois appelé aussi Zénon d&amp;rsquo;Elée)&amp;nbsp; en conclut que la pierre
ne pourra frapper l&amp;rsquo;arbre qu&amp;rsquo;au bout d&amp;rsquo;un temps infini, c&amp;rsquo;est-à-dire
jamais (ou pour la version illustrée, je peux renvoyer à un extrait de Kid Paddle, &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/zenon-kid-paddle.jpg&quot;&gt;ici&lt;/a&gt;). En fait, Zénon introduit&amp;nbsp; la notion d&amp;rsquo;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;infini divisibilité&lt;/span&gt;
(on dira qu&amp;rsquo;un élément est indéfiniment divisible, c&amp;rsquo;est d&amp;rsquo;ailleurs
surprenant ce lien en français entre l&amp;rsquo;infini et l&amp;rsquo;indéfini), qui
philosophiquement, est un complexe qui a mis du temps à s&amp;rsquo;imposer: une
somme infinie d&amp;rsquo;éléments non nuls peut être finie (je renvois &lt;a href=&quot;http://www.ac-nice.fr/massena/clubs/philo/pdf/infini.pdf&quot;&gt;ici&lt;/a&gt; par exemple).&lt;/p&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Formellement, l&amp;rsquo;histoire de la flèche revient à se demander si on peut calculer quelquechose qui ressemble à&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-01.png&quot; /&gt;&lt;/div&gt;&lt;/div&gt;soit, de manière plus formelle,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-07.png&quot; /&gt;&lt;/div&gt;on retrouve la somme d&amp;rsquo;une série géométrique (au premier terme près), dont on sait que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-03.png&quot; /&gt;&lt;/div&gt;Un application intéressante est que la &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;loi géométrique&lt;/span&gt;, vérifiant&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-06.png&quot; /&gt; &lt;/div&gt;est effectivement une loi de probabilité,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/zenon-05.png&quot; /&gt;&lt;/div&gt;(les
termes sont positifs, et la somme vaut 1). Il existe une démonstration
élégante de ce dernière résultat, qui tient en un dessin (à condition
d&amp;rsquo;accepter ce principe un peu fractal d&amp;rsquo;infini divisibilité):&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.loi-geometrique-ccarre-geo_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Je
reviendrais un jour sur les lois de probas infiniment divisibles, car
elles sont très très intéressantes de par certaines propriétés....</description>
    
    
    
      </item>
    
  <item>
    <title>Les abaques comme outils de pédagogie statistique</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/04/Les-abaques-comme-outils-de-p%C3%A9dagogie-statistique</link>
    <guid isPermaLink="false">urn:md5:86179af8a8ab61cc0d869336bb0071f0</guid>
    <pubDate>Fri, 04 Jun 2010 10:18:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>abaque</category><category>actualisation</category><category>COR</category><category>retraites</category><category>statistiques</category>    
    <description>    &lt;p&gt;Comme je l&amp;rsquo;avais mentionné à propos d&amp;rsquo;un vieux papier paru dans &lt;em&gt;Le Canard&lt;/em&gt;,
c&amp;rsquo;est souvent compliqué de communiquer sur les retraites. C&amp;rsquo;est un
sujet complexe et assez rapidement technique. Historiquement, les
abaques sont les tables de calculs,&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.Rechentisch_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Mais il faut admettre que retrouve un peu n&amp;rsquo;importe quoi dans ce terme d&amp;rsquo;abaque.... Certaines sont évoquées &lt;a href=&quot;http://www.campingcar-bricoloisirs.net/bricolage/panneau/abaque_cable.png&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://www.reunion.iufm.fr/recherche/irem/spip.php?article190&quot;&gt;là&lt;/a&gt;, voire &lt;a href=&quot;http://fr.wikipedia.org/wiki/Abaque_de_Smith&quot;&gt;là&lt;/a&gt;
pour quelque chose de très joli. On notera qu&amp;rsquo;il existe une idée sous
jacente commune, à savoir construire un outil graphique permettant de
visualiser comment 3 paramètres peuvent être liés (générallement, ils
sont liés par une fonction complexe).&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Abaques et retraites&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Parmi les outils que l&amp;rsquo;on retrouve dans les documents du COR, j&amp;rsquo;ai été surpris de voir ressortir l&amp;rsquo;utilisation des &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;abaques&lt;/span&gt; (par exemple &lt;a href=&quot;http://www.cor-retraites.fr/IMG/pdf/doc-721.pdf&quot;&gt;ici&lt;/a&gt;). On nous en fait même la promotion en vidéo,&lt;br /&gt;

&lt;object width=&quot;450&quot; height=&quot;270&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/bFNwPybnwNs&amp;hl=fr_FR&amp;fs=1&amp;&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/bFNwPybnwNs&amp;hl=fr_FR&amp;fs=1&amp;&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;450&quot; height=&quot;270&quot;&gt;&lt;/embed&gt;&lt;/object&gt;

&lt;br /&gt;Pour la petite histoire, j&amp;rsquo;avais évoqué son utilisation dans un graphique &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/02/02/Intervalle-de-confiance-pour-une-proportion&quot;&gt;ici&lt;/a&gt; sur les problèmes d&amp;rsquo;échantillonnage. C&amp;rsquo;est effectivement un outil graphique intéressant, à condition de savoir le décoder...&lt;br /&gt;L&amp;rsquo;idée est simple, à savoir lier les trois paramètres &lt;em&gt;essentiels&lt;/em&gt; (ou supposés comme tels) du bilan d&amp;rsquo;un système de retraite, à savoir&lt;br /&gt;&lt;ul style=&quot;color: rgb(153, 51, 153);&quot;&gt;&lt;li&gt;&lt;span id=&quot;fullpost&quot;&gt;le niveau des prélèvements, &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span id=&quot;fullpost&quot;&gt;le niveau de l’âge effectif de départ en retraite&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span id=&quot;fullpost&quot;&gt;le niveau des pensions.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span id=&quot;fullpost&quot;&gt;La
difficulté est de trouver une forme graphique permettant de relier ces
trois niveaux (la dimension 3 étant souvent trop abstraite). &lt;/span&gt;Par exemple dans les sondages, pour construire un intervalle de confiance, les abaques sont utilisées (comme &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/02/02/Intervalle-de-confiance-pour-une-proportion&quot;&gt;ici&lt;/a&gt;) pour relier&lt;br /&gt;&lt;ul&gt;&lt;li&gt;le niveau des intervalles de confiance (5%-95% ou 10%-90%)&lt;/li&gt;
&lt;li&gt;le niveau de probabilité attendu dans le sondage&lt;/li&gt;
&lt;li&gt;la taille de l&amp;rsquo;échantillon interrogé&lt;/li&gt;
&lt;/ul&gt;
On peut d&amp;rsquo;ailleurs trouver d&amp;rsquo;autres exemple en statistiques &lt;a href=&quot;http://archive.numdam.org/ARCHIVE/RSA/RSA_1960__8_2/RSA_1960__8_2_77_0/RSA_1960__8_2_77_0.pdf&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://archive.numdam.org/ARCHIVE/RSA/RSA_1957__5_4/RSA_1957__5_4_87_0/RSA_1957__5_4_87_0.pdf&quot;&gt;là&lt;/a&gt;. Mais pour revenir au problème des retraite, sur le graphique ci-dessous (appendix 1 &lt;a href=&quot;http://www.cor-retraites.fr/IMG/pdf/doc-1327.pdf&quot;&gt;ici&lt;/a&gt;), &lt;span id=&quot;fullpost&quot;&gt;en abscisse on met le &lt;span style=&quot;color: rgb(204, 0, 0); font-weight: bold;&quot;&gt;taux de remplacement&lt;/span&gt; (c&amp;rsquo;est à dire le ratio de la pension moyenne par rapport au revenu moyen) et en ordonnée
on met le &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;niveau d&amp;rsquo;un hausse du taux de cotisation&lt;/span&gt; (en points de cotisation). chaque ligne représente un âge moyen de départ en retraite effectif.&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.abaque-cor_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;span id=&quot;fullpost&quot;&gt;On
se fixe alors des scénarios d&amp;rsquo;équilibre et on regarde la manière dont
se déplacent les équilibres. J&amp;rsquo;avais prévu toute une analyse technique,
mais je viens de me rendre compte qu&amp;rsquo;Antoine a mis en ligne un billet
remarquable sur le sujet sur http://www.ecopublix.eu/ (&lt;a href=&quot;http://www.ecopublix.eu/2010/05/retraites-1041-labaque-des-retraites.html&quot;&gt;ici&lt;/a&gt;),
que je ne pourrais jamais égaler en clareté. Donc je vais proposer une
autre construction d&amp;rsquo;abaque afin de montrer son intérêt pédagogique.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Comprendre l&amp;rsquo;actualisation&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Sur le site http://images.math.cnrs.fr/ (&lt;a href=&quot;http://images.math.cnrs.fr/Petite-lecon-sur-le-calcul-des.html&quot;&gt;ici&lt;/a&gt;),
Xavier Caruso explique son émerveillement devant la difficulté de faire
des calculs d&amp;rsquo;actualisation. En un sens, ça me rassure de voir que les
calculs actuariels ne paraissent pas triviaux à tout le monde (et
surtout plein de contre-intuitions). Xavier essaye d&amp;rsquo;expliquer la
différence entre &lt;br /&gt;
&lt;ul class=&quot;spip&quot;&gt;&lt;li&gt;ouvrir un compte rémunéré à 4,5% sur lequel on dépose 500 euros chaque mois pendant 10 ans&lt;/li&gt;
&lt;li&gt;ouvrir un compte rémunéré
à 4,5% sur lequel on dépose 60000 euros initialement sans plus jamais
l’alimenter ensuite.&lt;/li&gt;
&lt;/ul&gt;
Si
effectivement la somme des 120 versements de 500 euros correspond aux
60000 euros, la valeur intégrant les intérêts n&amp;rsquo;est pas du tout la même
au bout de 10 ans, car dans le premier car, comme le disent les
banquiers, &quot;l&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;es intérêts se capitalisent&lt;/span&gt;&quot;.
Bon, si Xavier fait des maths (et donc des développements limités par
avoir des formules fermés), on va plutôt faire ici un peu de calculs
numériques. Tout d&amp;rsquo;abord, pour visualiser l&amp;rsquo;évolution des montants
disponibles sur les comptes, rien de plus simple,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; tps=1/12*(1:120)&lt;br /&gt;&amp;gt; plot(tps,60000*(1+0.045)^tps,ylim=c(0,100000))&lt;br /&gt;&amp;gt; lines(tps,cumsum(500*(1+0.045)^(tps)))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;les montants au bout de 10 ans étant&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; sum(500*(1+0.08525)^(1/12*(1:120)))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 93180.33&lt;/span&gt;&lt;br /&gt;&amp;gt; sum(500*(1+0.045)^(1/12*(1:120)))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 75514.32&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ce
qui confirme l&amp;rsquo;intuition que nous avions. Comme le note Xavier, il
faudrait un taux d&amp;rsquo;intérêt deux fois plus grand pour le placement
mensuel, la preuve&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; sum(500*(1+0.09)^(1/12*(1:120)))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 95543&lt;/span&gt;&lt;br /&gt;&amp;gt; sum(500*(1+0.08525)^(1/12*(1:120)))&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 93180.33&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Xavier obtient cette valeur en effectuant des développements limités. Il résume ça à l&amp;rsquo;aide du dessin&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.interets3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;On
peut aller plus loin, en notant qu&amp;rsquo;à taux sur le placement mensuel
donné, ainsi que la maturité, le taux sur le placement bloqué qui
rapporte la même valeur à échéance est donné par&lt;/p&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; ((sum(500*(1+0.09)^(1/12*(1:120))))/(500*12*10))^(1/10)-1&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 0.04762238&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;(dans
le cas d&amp;rsquo;un placement rapportant 9%). En fait, si on regarde le montant
dont on dispose sur les comptes à chaque date, on obtient précisément
les valeurs suivantes, en fonction du temps,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.grph-interet-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
on
retrouve effectivement qu&amp;rsquo;à 4,5%, les deux placements ne donnent pas le
même montant à échéance (ici 10 ans). Alors que si le placement
alimenté tous les mois rapportait 8,525%, on aurait exactement la même
somme au bout de 10 ans&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.grph-interet-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
ou si on compare avec un placement à 9% (le double, ce qui est obtenu par développement limité), on obtient&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.grph-interet-5_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pour trouver la valeur &lt;em&gt;exacte &lt;/em&gt;du multiplicateur en fonction du taux offert sur le compte bloqué et la maturité, la fonction est tout simplement&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; taux=4.5/100&lt;br /&gt;&amp;gt; T=10&lt;br /&gt;&amp;gt; f=function(k){(1*12*T)*(1+taux)^T-sum(1*(1+k*taux)^(1/12*(1:(12*T))))&amp;nbsp;}&lt;br /&gt;&amp;gt; uniroot(f,interval=c(0,20))$root&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;[1] 1.894332&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;L&amp;rsquo;idée d&amp;rsquo;utiliser une abaque peut s&amp;rsquo;avérer intéressante, car on essaye ici de relier&lt;br /&gt;&lt;ul style=&quot;color: rgb(153, 51, 153);&quot;&gt;&lt;li&gt;&lt;span id=&quot;fullpost&quot;&gt;le taux de rendement de l&amp;rsquo;argent bloqué &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span id=&quot;fullpost&quot;&gt;le taux proposé pour le placement alimenté tous les mois&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span id=&quot;fullpost&quot;&gt;la durée envisagée du placement&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Je
peux mettre en abscisse le taux du placement bloqué. En ordonné, je met
le multiplicateur utilisé pour le placement alimenté tous les mois. A
maturité donné (par exemple 10 ans en rouge), on peut regarder la
valeur du multiplicateur pour que les valeurs à échéance coïncident,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/abaque-rendement.PNG&quot;&gt;&lt;img style=&quot;border: 0 solid ; width: 448px; height: 244px;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.abaque-rendement_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
On
retrouve directement que le taux équivalent pour un placement alimenté
tous les mois doit être 1,89 fois le taux offert sur le placement
bloqué si on se fixe une échéance de 10 ans pour égaliser les
placements. Le code est simplement le suivant&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; tx=seq(0.005,.05,by=.001)&lt;br /&gt;&amp;gt; tps=seq(5,25,by=.25)&lt;br /&gt;&amp;gt; M=matrix(NA,length(tps),length(tx))&lt;br /&gt;&amp;gt; for(i in 1:length(tps)){&lt;br /&gt;+ for(j in 1:length(tx)){&lt;br /&gt;+ T=tps[i]&lt;br /&gt;+ taux=tx[j]&lt;br /&gt;+ f=function(k){&lt;br /&gt;+ (1*12*T)*(1+taux)^T-sum(1*(1+k*taux)^(1/12*(1:(12*T))))&lt;br /&gt;+ }&lt;br /&gt;+ M[i,j]=uniroot(f,interval=c(0,2))$root&lt;br /&gt;+ }}&lt;br /&gt;&amp;gt; contour(tps,tx,M,lwd=2,&lt;br /&gt;+ xlab=&quot;Durée du placement (en années)&quot;,ylab=&quot;Taux (du placement bloqué)&quot;)&lt;br /&gt;&amp;gt; abline(v=seq(5,25,by=1),lty=2,col=&quot;grey&quot;)&lt;br /&gt;&amp;gt; abline(h=seq(0,.05,by=.005),lty=2,col=&quot;grey&quot;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Bref,
l&amp;rsquo;actualisation est un sujet délicat (même ce n&amp;rsquo;est que des calculs de
sommes et de puissances). Et faire des petits dessins permet souvent de
mieux comprendre...&lt;/object&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Qu'est ce que la modélisation économétrique (3) ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/03/Qu-est-ce-que-la-mod%C3%A9lisation-%C3%A9conom%C3%A9trique-%283%29</link>
    <guid isPermaLink="false">urn:md5:bff43cedeca184c801dd5e5e9aac6ab9</guid>
    <pubDate>Thu, 03 Jun 2010 15:00:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>économétrie - M1-09/10</category>
        <category>Angrist</category><category>effectifs</category><category>Lavy</category><category>école</category><category>économétrie</category>    
    <description>    &lt;p&gt;Compte tenu du nombre de billets qui agitent la blogosphère en ce
moment, je me suis senti obligé de reprendre la plume pour poursuivre
le billet précédant (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/02/Qu-est-ce-que-la-mod%C3%A9lisation-%C3%A9conom%C3%A9trique-%282%29&quot;&gt;ici&lt;/a&gt;).
Initialement, le but était de montrer aux élèves comment mener une
étude économétrique et de répondre à une question simple (en
l&amp;rsquo;occurence &quot;&lt;em&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;la taille d&amp;rsquo;un classe a-t-elle un impact positif ou négatif sur les résultats scolaires&amp;thinsp;?&lt;/span&gt;&lt;/em&gt; &quot;).
Malheureusement, j&amp;rsquo;ai été rattrapé par l&amp;rsquo;actualité. Le premier billet
montrait qu&amp;rsquo;en faisant un modèle de régression simple, l&amp;rsquo;effet semblait
positif: plus la taille est grande, meilleure est la moyenne. Dans le
second billet, nous avions noté que cet effet pouvait cacher
quelquechose, comme des conditions socioéconomiques. Essayons donc
d&amp;rsquo;aller un peu plus loin....&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Régression multiple&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
En faisant une estimation par moindres carrés sur les deux variables, on obtient&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; summary(lm(avgverb~tipuach+classize,data=base0))&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
(Intercept) 80.26363&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.74472 107.777&amp;nbsp;&amp;nbsp; &amp;lt;2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
tipuach&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.34994&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01077 -32.486&amp;nbsp;&amp;nbsp; &amp;lt;2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
classize&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.03146&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02221&amp;nbsp; -1.416&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.157&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
---&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;
Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
L&amp;rsquo;impact de l&amp;rsquo;indice socio-économique est clairement
négatif, et si l&amp;rsquo;effet taille a un impact négatif, ce
dernier n&amp;rsquo;est pas significatif. Il va falloir essayer d&amp;rsquo;aller un peu plus loin....&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Approche nonlinéaire&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
On peut ragarder rapidement ce qu&amp;rsquo;aurait donné une régression nonlinéaire&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; library(mgcv)&lt;br /&gt;&amp;gt; reg=gam(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;avgverb&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;~s(tipuach,classize),data=base0)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; reg=gam(avgmath~s(tipuach,classize),data=base0)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;soit visuellement, les prédictions suivantes pour l&amp;rsquo;épreuve de lecture&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.classe-PD-surface-verbal_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et la surface ci-dessous pour l&amp;rsquo;épreuve de maths,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.classe-PD-surface-maths_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
l&amp;rsquo;effet ne parait pas forcément simple, même si l&amp;rsquo;on intuite une
évolution croissante. Mais depuis le début, nous omettons un point
important sur la base de Joshua Angrist et Victor Lavy: dans ces écoles
israëliennes, la règle de Maimonides est supposer s&amp;rsquo;appliquer... et
jusqu&amp;rsquo;à présent je n&amp;rsquo;en ai jamais parlé&amp;thinsp;!&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Prise en compte de la règle de Maimonides&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Compte
tenu de la règle de Maimonides, la taille des classes en fonction de la
taille de l&amp;rsquo;école n&amp;rsquo;est pas du tout linéaire, comme le montre la figure
ci-dessous,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.ecole-stats-1_m.jpg&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.ecole-stats-1_m.jpg&quot; /&gt;&lt;/div&gt;&lt;br /&gt;En fait, si on défini le nombre &lt;em&gt;théorique &lt;/em&gt;d&amp;rsquo;élèves dans les classes, avec cette méthode (ce que j&amp;rsquo;avais détaillé dans la section 3 &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/10/30/Qu-est-ce-que-la-mod%C3%A9liation-%28%C3%A9conom%C3%A9trique%2C-ou-statistique%29-%281%29&quot;&gt;ici&lt;/a&gt;), on obtient des résultats qui pourrait ressemblerà ce que nous avions observé sur le nombre &lt;em&gt;réel &lt;/em&gt;d&amp;rsquo;élèves dans les classes,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; reg=lm(avgverb~func1,data=base0)&lt;br /&gt;&amp;gt;&amp;nbsp; summary(reg)&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;(Intercept) 70.62076&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.88004&amp;nbsp;&amp;nbsp; 80.25&amp;nbsp; &amp;lt; 2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;func1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.12159&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02789&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.36 1.37e-05 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;On retrouve un effet positif (significatif) qui se visualise sur le graphique ci-dessous,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.maimonides-theorique-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et surtout, le modèle devient particulièrement intéressant si on régresse sur cette effectif théorique et l&lt;em&gt;e &quot;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;percent disadantaged&lt;/span&gt;&lt;/em&gt;&quot; (PD, décrit dans le précédant billet, &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/02/Qu-est-ce-que-la-mod%C3%A9lisation-%C3%A9conom%C3%A9trique-%282%29&quot;&gt;là&lt;/a&gt;)&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; reg=lm(avgverb~func1+tipuach,data=base0)&lt;br /&gt;&amp;gt;&amp;nbsp; summary(reg)&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Coefficients:&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Estimate Std. Error t value Pr(&amp;gt;|t|)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;(Intercept) 82.91057&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.78669 105.392&amp;nbsp; &amp;lt; 2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;func1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.11160&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02321&amp;nbsp; -4.809 1.63e-06 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;tipuach&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.35943&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01050 -34.229&amp;nbsp; &amp;lt; 2e-16 ***&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;---&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Signif. codes:&amp;nbsp; 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;où
cette fois l&amp;rsquo;impact de la taille de la classe est clairement
significatif, et négatif: à charactéristiques socio-économique
identiques, si la taille des classes suivait la règle de&amp;nbsp;Maimonides, la
taille de la classe aurait un impact négatif sur les résultats
scolaires....&lt;br /&gt;Une solution est d&amp;rsquo;utiliser une régression par
variables instrumentales où l&amp;rsquo;instrument permet
précisément de prendre en compte cette
discontinuité. L&amp;rsquo;idée est ici qu&amp;rsquo;il existe une variable&amp;nbsp;&lt;img alt=&quot;L'image “http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/maimo-02.png” ne peut être affichée car elle contient des erreurs.&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/maimo-02.png&quot; /&gt; telle que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;L'image “http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/maimo-01.png” ne peut être affichée car elle contient des erreurs.&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/maimo-01.png&quot; /&gt;&lt;/div&gt;On
voit alors apparaître naturellement l&amp;rsquo;idée d&amp;rsquo;utiliser les &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;variables
instrumentales&lt;/span&gt; pour corriger d&amp;rsquo;un éventuel biais lors de l&amp;rsquo;estimation
des coefficients lors de la régression (comme cela est&amp;nbsp;développé dans
le chapitre 25.7 du &lt;em&gt;microeconometrics &lt;/em&gt;de
Colin Cameron et Pravin Trivedi). Et c&amp;rsquo;est précisément ce qui survient
dans nos écoles compte tenu de la règle de Maimonides, On utilise la
variable que nous avions définie comme le nombre &lt;em&gt;théorique&lt;/em&gt; d&amp;rsquo;élèves dans la classe&amp;thinsp;!&lt;br /&gt;Damned,
l&amp;rsquo;étude n&amp;rsquo;est donc toujours pas finie, il va falloir creuser encore
davantage (surtout qu&amp;rsquo;il reste un paquet de variables dans cette
base)... mais pour les impatients, la conclusion à laquelle arrivent
Joshua Angrist et Victor Lavy est résumé dans le tableau ci-dessous,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.agnrist-tab5_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Espérance de vie et retraite</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/03/Esp%C3%A9rance-de-vie-et-retraite</link>
    <guid isPermaLink="false">urn:md5:c9537da8894a2f477b7622b14ad44b54</guid>
    <pubDate>Thu, 03 Jun 2010 11:49:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>60 ans</category><category>Bertrand</category><category>espérance de vie</category><category>gain</category><category>naissance</category><category>retraite</category><category>trimestre</category>    
    <description>    &lt;p&gt;Dans un billet qui a presque un an (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/06/28/on&quot;&gt;ici&lt;/a&gt;), j&amp;rsquo;étais revenu sur l&amp;rsquo;idée reçue comme quoi &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;tous les ans, on gagne un trimestre d’espérance de vie&lt;/span&gt;&quot;
. J&amp;rsquo;avais du alors expliquer que c&amp;rsquo;était effectivement le cas, en tous
les cas pour l&amp;rsquo;espérance de vie à la naissance. C&amp;rsquo;est ce que raconte le
graphique ci-dessous, avec une projection par la méthode de Lee &amp;amp;
Carter, pour les femmes uniquement&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.esp-vie-0_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt;&amp;nbsp; library(demography)&lt;br /&gt;&amp;gt;&amp;nbsp; france.LC1 &amp;lt;- lca(fr.mort,adjust=&quot;e0&quot;,series=&quot;female&quot;,years=c(1900,2040))&lt;br /&gt;&amp;gt;&amp;nbsp; france.fcast &amp;lt;- forecast(france.LC1)&lt;br /&gt;&amp;gt;&amp;nbsp; L2 &amp;lt;- lifetable(france.fcast)&lt;br /&gt;&amp;gt;&amp;nbsp; ex2=L2$ex&lt;br /&gt;&amp;gt;&amp;nbsp; L1=lifetable(fr.mort,series=&quot;female&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp; ex1=L1$ex&lt;br /&gt;&amp;gt; age=0&lt;br /&gt;&amp;gt;&amp;nbsp; exF=c(ex1[age+1,],ex2[age+1,])&lt;br /&gt;&amp;gt;&amp;nbsp; plot(1816:2056,ex,col=&quot;blue&quot;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;On peut alors faire une régression pour quantifier un peu mieux ce qui s&amp;rsquo;est passé au cours des 50 dernières années.&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt;&amp;nbsp; I=(1950:2000)-1815&lt;br /&gt;&amp;gt;&amp;nbsp; y=exF[I]&lt;br /&gt;&amp;gt;&amp;nbsp; x=1950:2000&lt;br /&gt;&amp;gt; lm(y~x)&lt;br /&gt;Coefficients:&lt;br /&gt;(Intercept)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; &lt;br /&gt;&amp;nbsp; -438.7249&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2611&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Avec
un pente de 0.26, effectivement, pour une année de plus (entre 1980 et
1981 par exemple), l&amp;rsquo;espérance de vie à la naissance gagne 0,26 année,
soit un trimestre. Pour les hommes, on a&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&lt;br /&gt;&amp;gt;&amp;nbsp; I=(1950:2000)-1815&lt;br /&gt;&amp;gt;&amp;nbsp; y=exH[I]&lt;br /&gt;&amp;gt;&amp;nbsp; x=1950:2000&lt;br /&gt;&amp;gt;&amp;nbsp; abline(lm(y~x),col=&quot;red&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp; points(x,y,pch=19,col=&quot;red&quot;)&lt;br /&gt;&amp;gt;&amp;nbsp; points(x,y,pch=19,col=&quot;red&quot;)&lt;br /&gt;&amp;gt; lm(y~x)&lt;br /&gt;Coefficients:&lt;br /&gt;(Intercept)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; &lt;br /&gt;&amp;nbsp; -357.9901&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2164&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;que l&amp;rsquo;on pourrait trouver très proche.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.esp-vie-0-M_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
J&amp;rsquo;ai été un peu&lt;img style=&quot;width: 240px; height: 189px; float: right;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.ageca_s.jpg&quot; alt=&quot;&quot; /&gt;
surpris de voir cet argument du trimestre gagné avancé lors du débat
sur les retraites. Pour commencer, j&amp;rsquo;ai été surpris de voir Xavier
Bertrand prétendre que &quot;&lt;em style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Quand vous preniez votre retraite à 60 ans en 1982, vous aviez dix
ans d’espérance de vie, aujourd’hui vous avez vingt ans d’espérance de
vie. Cette formidable bonne nouvelle, il faut la financer&lt;/em&gt;&quot;. Vérifions puisqu&amp;rsquo;on a les codes, il suffit de refaire tourner le programme avec&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; age=60&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Le graphique est alors &lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.esp-vie-60_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
pour les femmes, et pour les hommes, on a&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.esp-vie-60-F_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Côté chiffres, pour les femmes,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; exF[&quot;1982&quot;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1982 &lt;br /&gt;22.69534 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;et pour les hommes,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; exH[&quot;1982&quot;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1982 &lt;br /&gt;17.65394 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Bref, j&amp;rsquo;ai du mal à trouver d&amp;rsquo;où sortent ces dix ans.&amp;nbsp;Quant à aujourd&amp;rsquo;hui, pour les femmes,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; exF[&quot;2010&quot;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2010 &lt;br /&gt;26.44607 &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;et pour les hommes,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; exH[&quot;2010&quot;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2010 &lt;br /&gt;21.11194 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;autrement dit on a dépassé les 20 ans.&amp;nbsp;&lt;br /&gt;Si on calcule la pente de la régression, on obtient pour&amp;nbsp;les femmes,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; lm(y~x)&lt;br /&gt;Coefficients:&lt;br /&gt;(Intercept)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; &lt;br /&gt;&amp;nbsp; -281.0926&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1533&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;et pour les hommes,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 9px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; lm(y~x)&lt;br /&gt;Coefficients:&lt;br /&gt;(Intercept)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; &lt;br /&gt;&amp;nbsp; -192.7518&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1063&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Autrement
dit le gain qui est de l&amp;rsquo;ordre du trimestre par an à la naissance est
plutôt de l&amp;rsquo;ordre de 2 mois pour les femmes et de 5 semaines pour les
hommes. En gros, le gain est divisé par deux entre la naissance et 60
ans. Le graphique ci-dessous montre le gain annuel d&amp;rsquo;espérance de vie
en fonction de l&amp;rsquo;âge (je suis passé en jours en ordonnées), avec les
femmes (en &lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;rouge&lt;/span&gt;) et les hommes (en &lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;&quot;&gt;bleu&lt;/span&gt;)&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.gain-esp-vie-age_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
si le gain a été très important à la naissance (la surmortalité
infantile ayant fortement chuté depuis les années 50), il n&amp;rsquo;est pas
aussi important par la suite, et chute même passé 55 ans&amp;thinsp;! Autrement
dit un bébé vivra - en moyenne - plus longtemps qu&amp;rsquo;un bébé né en 1950.
Mais une personne de 70 ans vivra à peine plus longtemps - en moyenne -
qu&amp;rsquo;une personne de 70 ans en 1950. Bref, parler de ce gain d&amp;rsquo;un
trimestre par an dans un débat sur les retraites (comme cela est fait &lt;a href=&quot;http://www.lefigaro.fr/retraite/2010/05/18/05004-20100518ARTFIG00604-un-peu-de-discernement-de-realisme-ne-nuirait-pas-au-ps.php&quot;&gt;ici&lt;/a&gt; par une députée de Meurthe-et-Moselle) n&amp;rsquo;a pas de sens.&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Foot, probabilité, et assurance, partie 2</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/03/Foot%2C-probabilit%C3%A9%2C-et-assurance%2C-partie-2</link>
    <guid isPermaLink="false">urn:md5:001502af322a6559f0ab7198253a3675</guid>
    <pubDate>Thu, 03 Jun 2010 10:05:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Risques</category>
        <category>arbitrage</category><category>bets</category><category>cote</category><category>coupe du monde</category><category>football</category><category>pari</category><category>probabilité</category><category>risque neutre</category>    
    <description>    &lt;p&gt;Continuons le billet commencé &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/05/17/Foot,-probabilit%C3%A9,-et-assurance,-partie-1&quot;&gt;ici&lt;/a&gt;, où j&amp;rsquo;essayais noté que les enseignes qui se sont engagé à faire des cadeaux en cas de victoire de l&amp;rsquo;équipe de France s&amp;rsquo;étaient couvertes via des contrats d&amp;rsquo;assurance. En fait, elles peuvent également se couvrir sur les marchés (en l&amp;rsquo;occurrence les sites de paris en ligne). Il existe plusieurs façons de faire des paris. La
première est de faire (ou d&amp;rsquo;acheter) un pari sur un
événement (la France ira en finale de la coupe du monde, par exemple).
Ce pari est assorti d&amp;rsquo;une cote que défini le bookmaker. A une
cote de 20 contre 1, si je paris 1 euro, je gagne 20 euros en cas de
qualification pour la finale. &lt;br /&gt;
Dans ce cas particulier, le bookmaker est un agent important dans le marché, car il fixe le prix. Le site &lt;strong&gt;oddschecker.com&lt;/strong&gt; (&lt;a href=&quot;http://www.oddschecker.com/football/internationals/world-cup/win-market&quot;&gt;ici&lt;/a&gt;) permet de voir les cotes offertes par différents bookmakers.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.pari-foot1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Mais il existe aussi des marchés de paris, sans bookmakers. Il
s&amp;rsquo;agit réellement d&amp;rsquo;un marché, où les parieurs
prennent des positions les uns contre les autres, le bookmaker ne
servant que d&amp;rsquo;intermédiaire et d&amp;rsquo;animateur sur ce marché.
C&amp;rsquo;est le cas sur &lt;strong&gt;betfair.com&lt;/strong&gt; (&lt;a href=&quot;http://soccer.betfair.com/&quot;&gt;là&lt;/a&gt;) qui est un site d&amp;rsquo;échange de paris.&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.paris-foot-bet_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pour commencer simplement, imaginons que nous sommes quelques jours
avant une finale opposant la Corée du Sud aux Etats-Unis. Comme
il ne peut y avoir qu&amp;rsquo;un vainqueur il existe des contrats &lt;img style=&quot;width: 225px; height: 240px; float: right;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.818_s.jpg&quot; alt=&quot;&quot; /&gt;symétrique,
où l&amp;rsquo;on peut gagner 20 euros si la Corée gagner (et rien
si elle perd) et un autre où l&amp;rsquo;on peut gagner 20 euros si la
Corée perd. Bref, soit je suis acheter sur la Corée, soit
je suis vendeur. Le prix de ces contrats indiquent la
probabilité qu&amp;rsquo;a la Corée de gagner. On parle aussi de
back or lay, deux évènements étant possibles.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Lecture d&amp;rsquo;une cote&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Regardons maintenant le match d&amp;rsquo;ouverture, opposant l&amp;rsquo;Afrique du Sud au
Mexique. Les cotes sont les suivantes, &quot;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Mexique 6/4, Afrique du Sud
15/8 et Draw (match nul) 11/5&lt;/span&gt;&quot; sur un des sites. Le premier nombre
indique ce que l&amp;rsquo;on gagne (net) en misant le second, si mon pari est
gagnant. Autrement dit, si je paris 5 euros sur un match nul, et que
match nul il y a, alors mon bénéfice sera de 11 (que je
touche en plus de ma mise). La cote est alors de 1+11/5, soit 16/5
(j&amp;rsquo;avais fait ici un billet sur le lien entre cote et
probabilité). Elle indique non plus le bénéfice,
mais le gain: en misant 5 euros, j&amp;rsquo;empoche 16 euros. On parlera de
paris 1X2.&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.paris-foot2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Pour aller plus loin, on peut aussi parier sur le nombre de buts marqués. On parlera de paris over/under.&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.paris-foot-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Chez le même bookmaker, si je paris 1 euro que la France gagne la
coupe du monde, je fais un bénéfice de 18 euros.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Cote ou probabilité&amp;thinsp;?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Lorsque j&amp;rsquo;avais essayé d&amp;rsquo;expliquer l&amp;rsquo;origine de la loi
logistique (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/10/12/Mais-d-o%C3%B9-sort-la-r%C3%A9gression-%22logisitique%22&quot;&gt;ici&lt;/a&gt;), j&amp;rsquo;avais expliqué qu&amp;rsquo;il existait un lien simple
entre probabilité et cote, la cote étant la
probabilité que l&amp;rsquo;évènement se réalise,
divisé par la probabilité qu&amp;rsquo;il ne se réaliste
pas. Malheureusement, les choses sont un peu plus complexes dans les
paris... &lt;br /&gt;Zoomons un peu sur le match d&amp;rsquo;ouverture,&lt;br /&gt;
&lt;p style=&quot;text-align: center;&quot; id=&quot;media-original-image&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/zoom-cotes-probas.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
La cote est la valeur offerte la par le bookmarker, à laquelle on ajoute 1. La &quot;&lt;em&gt;probabilité&lt;/em&gt;&quot; est alors l&amp;rsquo;inverse de cette cote.&lt;br /&gt;
&lt;table style=&quot;text-align: left; width: 343px; height: 164px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;background-color: rgb(255, 255, 0);&quot;&gt;&lt;em&gt;résultat&lt;/em&gt;&lt;/td&gt;
&lt;td style=&quot;background-color: rgb(255, 255, 0);&quot;&gt;Bookie Offers&lt;/td&gt;
&lt;td style=&quot;background-color: rgb(255, 255, 0);&quot;&gt;Cote&lt;/td&gt;
&lt;td style=&quot;text-align: right; background-color: rgb(255, 255, 0);&quot;&gt;&quot;probabilités&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;Mexico&lt;/td&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;11/8&lt;/td&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;2.375&lt;/td&gt;
&lt;td style=&quot;text-align: right; color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;42.10%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;South Africa&lt;/td&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;13/8&lt;/td&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;2.623&lt;/td&gt;
&lt;td style=&quot;text-align: right; color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;38.09%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;Draw&lt;/td&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;11/5&lt;/td&gt;
&lt;td style=&quot;color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;3.200&lt;/td&gt;
&lt;td style=&quot;text-align: right; color: rgb(102, 0, 0); background-color: rgb(255, 255, 204);&quot;&gt;31.25%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;total&lt;/em&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;111.45%&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;A-t-on raté quelquechose&amp;thinsp;? car visiblement la &quot;&lt;em&gt;probabilité&lt;/em&gt;&quot; n&amp;rsquo;est pas une vraie probabilité...
En fait, supposer que l&amp;rsquo;on puisse construire une&amp;nbsp;mesure de
probabilité à partir des cotes doit pouvoir être
relié au &quot;&lt;em&gt;théorème fondamental d&amp;rsquo;asset pricing&lt;/em&gt;&quot; (et de probabilités risques neutres mentionnés tout à l&amp;rsquo;heure)
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Relecture des cotes à l&amp;rsquo;aide du théorème fondamental&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img style=&quot;width: 215px; height: 240px; float: right;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.odds-bet-vintages_s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Autrement dit, on suppose qu&amp;rsquo;il existe une mesure&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-01.png&quot; /&gt; telle que&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-02.png&quot; /&gt;&lt;/div&gt;
où&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-03.png&quot; /&gt; est l&amp;rsquo;ensemble des gains possibles, et&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-04.png&quot; /&gt; un équivalent certain.&lt;br /&gt;
On suppose qu&amp;rsquo;il existe un ensemble d&amp;rsquo;évènements&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-05.png&quot; /&gt;
(mutuellement exclusif comme on dit, formant une partition de&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-06.png&quot; /&gt;),
un seul pouvant survenir (en l&amp;rsquo;occurrence l&amp;rsquo;équipe qui reçoit gagne, ou
l&amp;rsquo;équipe qui reçoit perd, ou il y a match nul). On considère un
bookmaker qui accepte
de payer&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-08.png&quot; /&gt; si l&amp;rsquo;évènement i survient à un joueur
qui aura parié 1 euro. On pourra légitimement pense que&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-09.png&quot; /&gt;. Notre souhait est de relier ces&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-08.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-08.png&quot; /&gt; et &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-10.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-10.png&quot; /&gt;, si un
lien quelconque pouvait exister. Ce problème avait
été soulevé par Ramsey ou de Finetti.&lt;br /&gt;
En notant&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-11.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-11.png&quot; /&gt; le montant total placé sur
l&amp;rsquo;évènement&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-12.png&quot; /&gt;. On pourra dire que l&amp;rsquo;on est à
l&amp;rsquo;équilibre si&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-13.png&quot; /&gt; est constant. Autrement dit,&amp;nbsp;le ratio des cotes doit être l&amp;rsquo;inverse des ratios de montants placés,&lt;br /&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-15.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-15.png&quot; /&gt;&lt;br /&gt;
On peut ainsi s&amp;rsquo;intéresser à &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-16.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-16.png&quot; /&gt;&lt;/div&gt;qui est la fraction de l&amp;rsquo;argent qui sera effectivement
rétribuée aux parieurs, ou&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-17.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-17.png&quot; /&gt; sera la &amp;nbsp;part gardée
par le bookmaker. On peut penser qu&amp;rsquo;un bookmaker fixe&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-18.png&quot; /&gt;, et alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-20.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-20.png&quot; /&gt;&lt;/div&gt;En fait, k peut être vu comme un taux d&amp;rsquo;actualisation
(l&amp;rsquo;équivalent d&amp;rsquo;un&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-22.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-22.png&quot; /&gt; en mathématique
financière). On peut d&amp;rsquo;ailleurs noter que si on note&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-25.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-25.png&quot; /&gt; le produit&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-26.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-26.png&quot; /&gt;&lt;/div&gt;
alors la stratégie consistant à parier&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-27.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-27.png&quot; /&gt;&lt;/div&gt;
sur l&amp;rsquo;évènement &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-12.png&quot; /&gt;,
pour tout les évènements, aura un coût unitaire (j&amp;rsquo;ai ici constitué mon
portefeuille si on revient à la théorie de l&amp;rsquo;arbitrage). Aussi&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-29.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-29.png&quot; /&gt;&lt;/div&gt;En l&amp;rsquo;occurrence, sur le match d&amp;rsquo;ouverture de la coupe du monde, on obtient &amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-18.png&quot; /&gt; de l&amp;rsquo;ordre de 90% (l&amp;rsquo;inverse de la somme de la dernière colonne). Autrement dit, le bookmaker prend de l&amp;rsquo;ordre de 10%.&lt;br /&gt;A partir de là, on peut en déduire de ces prix d&amp;rsquo;Arrow
Debreu une &quot;probabilité implicite&quot; qui est la probabilité
risque neutre, ou la croyance des investisseurs dans la survenance des
évènements. Pour cela, on pourrait poser&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-30.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-30.png&quot; /&gt;&lt;/div&gt;
sauf que dans ce cas, compte tenu de la dernière relation, &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-34.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-34.png&quot; /&gt;. On définie alors la probabilité implicite des parieurs sous la forme&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-35.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-35.png&quot; /&gt;&lt;/div&gt;On a réussit à construire une mesure de probabilité &lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/foot-pari-01.png&quot; /&gt;,
qui correspond à l&amp;rsquo;intuition des parieurs... mais qui n&amp;rsquo;a rien à voir
avec la probabilité réelle. Si l&amp;rsquo;on compare les bookmakers, on note que
les probabilités induites sont très proches,&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.proba-implicites-ouverture_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
et si on compare la part prise par le bookmaker sur ce match, on est là aussi sur des ordres de grandeurs comparables,&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.part-book-ouverture_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;Justin Wolfers et Eric Zitzewitz, dans&lt;em&gt; Prediction Markets&lt;/em&gt;
paru dans le&amp;nbsp;Journal of Economic Perspectives de 2004&amp;nbsp;(&lt;a href=&quot;http://bpp.wharton.upenn.edu/jwolfers/Papers/PredictionMarkets%28Palgrave%29.pdf&quot;&gt;ici&lt;/a&gt;)
expliquent d&amp;rsquo;ailleurs tout cela très clairement. Je peux aussi
renvoyer à un document de travail datant de novembre dernier de
Egon Franck, Erwin Verbeek, et Stephan Nüesch (en ligne &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1503375&quot;&gt;ici&lt;/a&gt;).&lt;br /&gt;
J&amp;rsquo;ai parlé tout à l&amp;rsquo;heure de probabilité risque
neutre, mais cela sous-entend que l&amp;rsquo;on puisse supposer les
marchés efficients, et qu&amp;rsquo;il n&amp;rsquo;y ait absence
d&amp;rsquo;opportunité d&amp;rsquo;arbitrage. C&amp;rsquo;est précisément ce
qu&amp;rsquo;avait regardé Steven Levitt et Richard Gill &lt;a href=&quot;http://people.ucsc.edu/%7Ergil/world_cup.pdf&quot;&gt;ici&lt;/a&gt;, dans un vieux papier, évoqué également &lt;a href=&quot;http://freakonomics.blogs.nytimes.com/2006/07/04/what-can-the-world-cup-teach-us-about-markets/&quot;&gt;là&lt;/a&gt;.
Pour résumer les conclusions, il n&amp;rsquo;y a pas d&amp;rsquo;opportunités
d&amp;rsquo;arbitrage sur ces marchés, et il existe des &quot;market makers&quot;,
c&amp;rsquo;est à dire des parieurs misant énormément, ce
qui accroît considérablement la liquidité de ces
marchés. Mais cette conclusion sur l&amp;rsquo;absence d&amp;rsquo;opportunité d&amp;rsquo;arbitrage
a été largement remise en cause en pratique. Pour aller plus loin, on
peut aussi regarder un article de Moris Eaton et David Freedman, &lt;em&gt;Dutch Book against some &amp;rsquo;Objective&amp;rsquo; Prior&lt;/em&gt;,
paru dansBernoulli en 2004, en ligne &lt;a href=&quot;http://www.google.fr/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=4&amp;amp;ved=0CCEQFjAD&amp;amp;url=http%3A%2F%2Fwww.stat.berkeley.edu%2F%7Ecensus%2F642.pdf&amp;amp;ei=-l0HTMD4NOWW4gbRxoSXAQ&amp;amp;usg=AFQjCNEwDdjl700GLpauwqZxgF0UNpanjw&amp;amp;sig2=ThB1Y1j6Vo_B4ZvsZ80RUg&quot;&gt;là&lt;/a&gt;. C&amp;rsquo;est marrant car cette relecture
Bayésienne des jeux de pari peut être étudier en
pratique, pour la coupe du monde de foot sur&lt;strong&gt; worldcup.bayesialab.com&lt;/strong&gt; (&lt;a href=&quot;http://worldcup.bayesialab.com/&quot;&gt;là&lt;/a&gt;,
merci Avner pour le
lien). Je vais continuer de suivre ça lorsque les matchs commençerons,
afin de voir les mises à jour des paris au fur et à mesure de
l&amp;rsquo;évolution des matchs... à suivre donc.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.foot-bayes_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Des dangers de la corrélation (de Pearson)</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/02/Des-dangers-de-la-corr%C3%A9lation-%28de-Pearson%29</link>
    <guid isPermaLink="false">urn:md5:d5bd3f8ad34b8710b8f51f6050ec6da8</guid>
    <pubDate>Wed, 02 Jun 2010 23:52:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Statistiques</category>
        <category>corrélation</category><category>hydrologie</category><category>Pearson</category><category>Seine</category><category>Spearman</category>    
    <description>    &lt;p&gt;Suite à mon billet sur les copules empiriques, un ancien collègue m&amp;rsquo;a
fait remarqué que je parlais peu des problèmes de corrélation ou de
copules, voire de &lt;em&gt;tail dependence&lt;/em&gt;,
alors que ça a été mes sujets de prédilection pendant quelques années.
Histoire de le faire mentir, je vais faire un billet pour raconter une
aventure étrange que j&amp;rsquo;ai vécue pas plus tard qu&amp;rsquo;avant hier sur un
problème de corrélation.&lt;br /&gt;La corrélation au sens de Pearson est
utilisée partout, par exemple sur les séries temporelles quand on
regarde les autocorrélations.&lt;br /&gt;Pour montrer un petit exemple et faire
un peu réfléchir, considérons un petit exemple simple (qui devrait
faire réfléchir les banquiers qui ont à faire face à des problèmes
similaires). Considérons deux villes ou passe la Seine, l&amp;rsquo;une étant -
on s&amp;rsquo;en doute - en amont de l&amp;rsquo;autre. &lt;br /&gt;Il existe des cartes construites par des hydrologues de vitesse d&amp;rsquo;avancée moyenne de l&amp;rsquo;eau.&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px; line-height: 15px; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.propagation-crues-jours_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;En
tant que statisticien, je me disait qu&amp;rsquo;il serait possible d&amp;rsquo;étudier les
séries&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/latezx2png.2.php.png&quot; alt=&quot;latezx2png.2.php.png&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&amp;nbsp;et&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/latexz2png-1.2.php.png&quot; alt=&quot;latexz2png-1.2.php.png&quot; /&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;où&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/latexz2png-2.2.php.png&quot; alt=&quot;latexz2png-2.2.php.png&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&amp;nbsp;serait a priori proche de la valeur indiquée
par les hydrologues. Dans un monde idéal,&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/latexz2png-2.2.php.png&quot; alt=&quot;latexz2png-2.2.php.png&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'DejaVu Sans', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;pourrait aussi être un
processus stochastique, mais je débute dans les problèmes de
changements de temps. &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Naturellement, comme tout statisticien qui
a pratiqué (et même enseigné) les séries temporelles, je voulais
utiliser la corrélation entre les séries, pour trouver la valeur de h
optimale. A priori, résoudre &lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px; line-height: 15px; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/latexz2png-3.2.php.png&quot; alt=&quot;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;devrait être une bonne idée.&lt;br /&gt;Compte
tenu des données dont je dispose (en l&amp;rsquo;occurrence les points sont séparés par une journée sur la figure ci-dessus), en extrapolant un peu à l&amp;rsquo;occasion
(de manière linéaire), je peux regarder des décalages horaires. Étrangement, j&amp;rsquo;obtiens la courbe suivante pour l&amp;rsquo;évolution de la
corrélation,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px; line-height: 15px; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.fleuve-pearson-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;Autrement dit, la corrélation (au sens de Pearson)
donne une intuition assez étrange, à savoir qu&amp;rsquo;il pourrait être
intéressant de regarder la série décalée de l&amp;rsquo;ordre d&amp;rsquo;une semaine.&lt;br /&gt;En
fait, si j&amp;rsquo;avais regardé la corrélation au sens de Spearman, &amp;nbsp;j&amp;rsquo;obtiens
des résultats beaucoup plus en accord avec l&amp;rsquo;intuition physique,&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px; line-height: 15px; &quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.fleuve-speaman-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;Étonnant, non&amp;thinsp;? Moralité, il faut toujours se méfier de la corrélation&amp;thinsp;!&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Qu'est ce que la modélisation économétrique (2) ?</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/02/Qu-est-ce-que-la-mod%C3%A9lisation-%C3%A9conom%C3%A9trique-%282%29</link>
    <guid isPermaLink="false">urn:md5:9f71773f25914d53c7c0b975c073f4f1</guid>
    <pubDate>Wed, 02 Jun 2010 14:10:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>économétrie - M1-09/10</category>
        <category>Angrist</category><category>Chatel</category><category>effectifs</category><category>Gary Bobo</category><category>Lavy</category><category>Maimonides</category><category>résultats</category><category>taille</category><category>école</category>    
    <description>    &lt;p&gt;
En début de semaine, Luc Chatel semblait noter &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;les
études les plus récentes indiquent que la diminution des
effectifs dans les classes n&amp;rsquo;a pas d&amp;rsquo;effet avéré sur les
résultats des élèves&lt;/span&gt;&quot;. Tout a été repris, et détaillé &lt;a href=&quot;http://www.cafepedagogique.net/lexpresso/Pages/2010/05/CommentLChatelvareduirepostes.aspx&quot;&gt;ici&lt;/a&gt;, avec d&amp;rsquo;ailleurs une copie de &amp;nbsp;la fiche donnée aux inspecteur, &lt;a href=&quot;http://www.cafepedagogique.net/lexpresso/Documents/Fiches/1_Augmentationtailleclasses.doc&quot;&gt;là&lt;/a&gt;.&lt;br /&gt;
Je suis un peu surpris car un peu de bon sens (et peut être
d&amp;rsquo;expérience) me laisser penser le contraire. Je me demandais
qui avait bien pu conclure à une chose pareil. J&amp;rsquo;ai
traîné un peu sur le net, je suis tombé sur le
rapport de Thomas Piketty et Mathieu Valdenaire par exemple (&lt;a href=&quot;http://www.jourdan.ens.fr/piketty/fichiers/public/PikettyValdenaire2006.pdf&quot;&gt;ici&lt;/a&gt; pour le rapport et &lt;a href=&quot;http://www.jourdan.ens.fr/piketty/fichiers/public/PikettySlides.pdf&quot;&gt;là&lt;/a&gt;
pour les slides), qui avait fait de l&amp;rsquo;économétrie sur le
panel primaire de 1997, montrant par exmple que la réduction
d&amp;rsquo;un élève par classe en CE1 augmentait de 0,7 points les
résultats en maths en début de CE1. Bref, sur le lien
effectifs et résultats, j&amp;rsquo;avais l&amp;rsquo;impression que l&amp;rsquo;effet
était avéré. Les papiers de Robert Gary Bobo (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=924950&quot;&gt;ici&lt;/a&gt;) allaient dans le
même sens. Mais qui donc avait pu pondre ces &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;études les plus récentes&lt;/span&gt;&quot;&amp;thinsp;?&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://vidberg.blog.lemonde.fr/2008/12/11/dark-vados/&quot;&gt;&lt;img style=&quot;border: 0 solid ; width: 448px; height: 408px;&quot; title=&quot;Merci à Martin Vidberg, http://vidberg.blog.lemonde.fr/2008/12/11/dark-vados/&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.282-darkvados2.1229020944_m.jpg&quot; alt=&quot;Merci à Martin Vidberg, http://vidberg.blog.lemonde.fr/2008/12/11/dark-vados/&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
Après avoir cherché un peu, j&amp;rsquo;ai fini par trouver un élément de réponse sur mon blog (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2009/10/30/Qu-est-ce-que-la-mod%C3%A9liation-%28%C3%A9conom%C3%A9trique%2C-ou-statistique%29-%281%29&quot;&gt;ici&lt;/a&gt;):
dans un billet sur la modélisation économétrique,
j&amp;rsquo;avais commencé à reprendre le papier de Joshua Angrist et Victor Lavy, &quot;&lt;em&gt;using Maimonides’ rule to estimate the effect the effect of class size on scholastic achivemen&lt;/em&gt;t&quot; (publié que le QJE en 1999, &lt;a href=&quot;http://www.pse.ens.fr/gurgand/AngristLavy99.pdf&quot;&gt;ici&lt;/a&gt;).
Malheureusement mon billet était long, j&amp;rsquo;avais fait une
régression simple, et conclu à un effet croissant de
l&amp;rsquo;effectif (ici en abscisse) sur les résultats scolaires: plus grande est la classe, meilleurs sont les résulats&amp;thinsp;!&amp;nbsp;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso2/.reg-2-class_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Damned, &amp;nbsp;c&amp;rsquo;est moi
le fautif&amp;thinsp;? Je devrais me rejouir que Luc lise mon blog (maintenant
que je sais qu&amp;rsquo;il lit mon blog, je peux l&amp;rsquo;appeler par son
prénom), sauf que mon billet se terminait par une mise en garde.
Ce que l&amp;rsquo;on mesure est probablement un effet caché, la mesure
d&amp;rsquo;autre chose.... Afin de justifier ce point, je vais enfin me lancer
(avec 10 mois de retard) dans la rédaction de la suite&amp;thinsp;!&lt;br /&gt;En fait, comme le notent
Joshua Angrist et Victor Lavy, une variable importante dans l&amp;rsquo;analyse est le &lt;em&gt;&quot;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;school level index of student&amp;rsquo;s socioeconomic status&lt;/span&gt;&lt;/em&gt;&quot;, appelé dans le texte original &lt;em&gt;&quot;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;percent disadantaged&lt;/span&gt;&lt;/em&gt;&quot; (PD).
Cet indice est suffisement sérieux pour que le Ministère de l&amp;rsquo;Education
l&amp;rsquo;utilise. Il est fonction du niveau d&amp;rsquo;éducation du père, et de la
taille de la famille de l&amp;rsquo;enfant scolarisé. On le voit très clairement,
plus l&amp;rsquo;indice est élevé, i.e. plus l&amp;rsquo;école est situé dans un endroit
défavorisé, moins bons sont les résultats scolaires.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.ecole-resultat-tipuach-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
pour ceux qui concluaient après le précédant billet qu&amp;rsquo;il fallait faire
des classes les plus grands possibles pour avoir de meilleurs
résultats, ici on pourrait conclure qu&amp;rsquo;il faut interdire aux enfants de
familles nombreuses, ou celles dont le père n&amp;rsquo;a pas fait de longues
études, d&amp;rsquo;aller à l&amp;rsquo;école. C&amp;rsquo;est un peu stupide. Mais on se doute que
tout cela est sûrement très lié. Moralité, il faudra faire une étude
plus poussée pour voir si, à contexte socio-économique identique, la
taille des classes et le résultat aux tests sont positivement ou
négativement corrélés... à suivre donc....</description>
    
    
    
      </item>
    
  <item>
    <title>Arrêtez donc vos singeries !</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/01/Arr%C3%AAtez-donc-vos-singeries-%21</link>
    <guid isPermaLink="false">urn:md5:cf6d1685b595f74552f76a14bea06455</guid>
    <pubDate>Wed, 02 Jun 2010 00:23:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>on souffle un peu</category>
        <category>experience</category><category>Malkiel</category><category>monkey</category><category>ouragans</category><category>singe</category><category>trader</category><category>wall street</category>    
    <description>    &lt;p&gt;&lt;img title=&quot;kiki-singe.PNG, juin 2010&quot; style=&quot;margin: 0 0 1em 1em; float: right;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.kiki-singe_s.jpg&quot; /&gt;Tout le monde connaît l&amp;rsquo;expérience&amp;nbsp;où l&amp;rsquo;on compare les gains
financiers obtenus par un traders expérimenté et un singe. Même si
beaucoup de sites évoquent &quot;&lt;em&gt;la célèbre expérience&lt;/em&gt;&quot;, je n &amp;rsquo;en ai pas trouvé beaucoup - en France - qui donnent une référénce claire. Cette expérience &amp;nbsp;était née d&amp;rsquo;une&amp;nbsp;&lt;em&gt;théorie&lt;/em&gt; de Burton Malkiel dans son livre &lt;em&gt;a random walk down wall street&lt;/em&gt;,&amp;nbsp;qui affirmait&amp;nbsp;&quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;a blindfolded monkey throwing darts at&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;a newspaper’s financial pages
could select a portfolio that would do just as well as one carefully
selected by experts&lt;/span&gt;&quot;. En 1988, le Wall Street Journal a pris Burton Malkiel au mot, et a tenté l&amp;rsquo;expérience.Mais
ils n&amp;rsquo;utilisèrent pas des singes, et ce furent des journalistes qui
tiraient au hasard les actions sur lesquelles ils investiraient (alors
que parallèlement, les mêmes sommes étaient confiées à des vrais
inverstisseurs). Après 6 mois d&amp;rsquo;expérience, ils firent le bilan. &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;On
October 7, 1998 the Journal presented the results of the 100th
dartboard contest. So who won the most contests and by how much? The
pros won 61 of the 100 contests versus the darts. That’s better than
the 50% that would be expected in an efficient market. On the other
hand, the pros losing 39% of the time to a bunch of darts certainly
could be viewed as somewhat of an embarrassment for the pros.
Additionally, the performance of the pros versus the Dow Jones
Industrial Average was less impressive. The pros barely edged the DJIA
by a margin of 51 to 49 contests. In other words, simply investing
passively in the Dow, an investor would have beaten the picks of the
pros in roughly half the contests (that is, without even considering
transactions costs or taxes for taxable investors). The pro’s picks
look more impressive when the actual returns of their stocks are
compared with the dartboard and DJIA returns. The pros average gain was
10.8% versus 4.5% for the darts and 6.8% for the DJIA.&lt;/span&gt;&quot; Il
semble que l&amp;rsquo;Expansion en France ait aussi voulu tenter l&amp;rsquo;expérience. &lt;/p&gt;
&lt;p&gt;La conclusion de cette expérience est qu&amp;rsquo;en moyenne, il est dur de battre le hasard&amp;thinsp;! Une autre
conclusion peut aussi&amp;nbsp;être qu&amp;rsquo;en mettant 500 singes dans une salle de
marchés, au bout d&amp;rsquo;un certain temps on peut en trouver un qui sera
aussi riche que Georges Soros, comme le disait&amp;nbsp;Jean-Philippe Bouchaud.
On peut parler de grandes déviations éventuellement...&lt;br /&gt;Cette histoire peut prêter à sourire, effectivement, mais un &lt;em&gt;think tank&lt;/em&gt; plutôt conservateur outre atlantique (le &lt;em&gt;National Center for Public Policy Research&lt;/em&gt;)
envisage de faire la même chose pour prédire les ouragans: au lieu
d&amp;rsquo;écouter les climatologues, ils envisagent de faire appel à un singe
(comme mentionné &lt;a href=&quot;http://www.prnewswire.com/news-releases/think-tank-says-trained-chimp-can-predict-hurricanes-better-than-noaa----and-puts-it-to-the-test-94145264.html&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://www.prnewswire.com/news-releases/think-tank-says-trained-chimp-can-predict-hurricanes-better-than-noaa----and-puts-it-to-the-test-94145264.html&quot;&gt;là&lt;/a&gt;).&amp;nbsp;
Même si les prévisions des chercheurs ne sont pas toujours&amp;nbsp;très fiables
(en particulier sur les catastrophes comme les séismes ou les
ouragants), elles reposent sur des éléments rationnels, avec souvent
des intervalles de confiance.... Oui, je suis le premier à râler quand Météo France prévoit un beau week end et qu&amp;rsquo;au final il
pleut, mais je suis agacé parces démagogues qui critiquent le travail des scientifiques (surtout qu&amp;rsquo;en l&amp;rsquo;occurence, je pense que le NCPPR confond&amp;nbsp;
météo et climat, mais c&amp;rsquo;est un autre débat). Il y a un an, la
communauté scientifique essayait de faire comprendre qu&amp;rsquo;elle n&amp;rsquo;était
pas un parasite, voilà que maintenant il faut que l&amp;rsquo;on se batte pour
faire comprendre qu&amp;rsquo;on fait des choses qu&amp;rsquo;un chimpanzé ne saurait pas
faire&amp;thinsp;! On est décidément tombé bien bas...&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Copules et processus empiriques</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/01/Copules-et-processus-empiriques</link>
    <guid isPermaLink="false">urn:md5:11c66d432045c83f7488544a40e0079a</guid>
    <pubDate>Tue, 01 Jun 2010 13:07:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Jury</category>
        <category>copules</category><category>Deheuvels</category><category>empiriques</category><category>processus</category><category>Ruymgaart</category><category>thèse</category><category>Zari</category>    
    <description>    &lt;p&gt;Tarek Zari a soutenu sa thèse au début du mois, présentant une &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;contribution&amp;nbsp; à l&amp;rsquo;étude du processus empirique de copule&lt;/span&gt;&quot;, et sa thèse est en ligne &lt;a href=&quot;http://tel.archives-ouvertes.fr/docs/00/48/50/20/PDF/These.pdf&quot;&gt;ici&lt;/a&gt;. Je mets aussi une copie de ses slides &lt;a href=&quot;file:///H:/MES%20DOCUMENTS/slides-these-tarek.pdf&quot;&gt;là&lt;/a&gt;.
Historiquement, il semble que Frits Ruymgaart a été le premier a parler
de processus empirique de copules, en 1973 (sa thèse est en ligne &lt;a href=&quot;http://oai.cwi.nl/oai/asset/12708/12708A.pdf&quot;&gt;ici&lt;/a&gt;). &lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.cop-emp-01_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Paul Deheuvels avait également introduit la notion en copule empirique dès 1979 sous le nom de &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;fonction de dépendance empirique&lt;/span&gt;&quot;. A la même époque, Ludger Rüschendorf proposait également une étude asymptotique des processus empiriques de copules (&lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aos/1176343588&quot;&gt;ici&lt;/a&gt; en 1976), ou encore Gäenssler&amp;nbsp;et Stute dans leur &lt;em&gt;seminar on empirical processes &lt;/em&gt;et Winfried Stute dans les années 80 (&lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aop/1176993295&quot;&gt;là&lt;/a&gt;). Une revue de la littérature sur les processus empiriques multivariés a été publié à cette époque, en ligne &lt;a href=&quot;http://arno.uvt.nl/show.cgi?fid=14217&quot;&gt;là&lt;/a&gt;. Depuis Jean-David Fermanian a publié un papier &lt;a href=&quot;http://www.e-fern.org/public/files/file0027505.pdf&quot;&gt;ici&lt;/a&gt;
sur la convergence faible, et Paul Deheuvels ou&amp;nbsp;Ludger Rüschendorf ont
publié énormément de choses, en particulier sur la vitesse de
convergence...</description>
    
    
    
      </item>
    
  <item>
    <title>Fibonacci: des lapins à l'actualisation</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/06/01/Fibonacci%3A-des-lapins-%C3%A0-l-actualisation</link>
    <guid isPermaLink="false">urn:md5:29220076305bbc346e1774917f938dbb</guid>
    <pubDate>Tue, 01 Jun 2010 09:48:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Finance</category>
        <category>actualisation</category><category>Fibonacci</category><category>finance</category><category>lapins</category><category>Liber Abaci</category><category>nombre d or</category>    
    <description>    &lt;br /&gt;&lt;img title=&quot;0195175719.jpg, juin 2010&quot; style=&quot;margin: 0 1em 1em 0; float: left;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/0195175719.jpg&quot; /&gt;Depuis
qu&amp;rsquo;on peut facilement commander des livres d&amp;rsquo;occasion outre-atlantique,
j&amp;rsquo;avoue en abuser un peu... La dernière commande que j&amp;rsquo;ai faite est le &quot;&lt;em&gt;origins of value&lt;/em&gt;&quot; de Richard Michod, Lynn Nadel et Michael Hechter. Cet ouvrage, qui est une compilation d&amp;rsquo;articles d&amp;rsquo;histoire de la finance, contient un chapitre passionnant sur  &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Leonardo Pisano&lt;/span&gt; alias &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Fibonacci&lt;/span&gt;. Pour remettre dans le contexte, Fibonacci vivait il y a fort fort
longtemps, autour de 1200 (300 ans avant la renaissance et Léonard de
Vinci). Je peux renvoyer &lt;a href=&quot;http://tony.reix.free.fr/EdouardLucas/LUCAS_BOOK_LEONARD_DE_PISE.PDF&quot;&gt;ici&lt;/a&gt; par exemple pour une analyse de quelques uns de ses ouvrages.&lt;br /&gt;Pour
moi, Fibonnaci, c&amp;rsquo;était l&amp;rsquo;histoire de la reproduction des lapins, c&amp;rsquo;est
à dire, l&amp;rsquo;étude&lt;img style=&quot;width: 170px; height: 240px; float: left;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.rabbit_000000659930Small_s.jpg&quot; alt=&quot;&quot; /&gt; des suites récurrentes pour ceux qui se souviennent de
leurs cours de lycée, avec des suites de la forme&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-001.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-001.png&quot; /&gt;&lt;/div&gt;Le problème&amp;nbsp;que l&amp;rsquo;on cherche à résoudre - posé par Fibonacci - est &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;partant
d&amp;rsquo;un couple, combien de couples de lapins obtiendrons-nous après un
nombre donné de mois sachant que chaque couple produit chaque mois un
nouveau couple, lequel ne devient productif qu&amp;rsquo;après deux mois&amp;thinsp;?&lt;/span&gt;
&quot;. Pour ceux qui se souviennent de la résolution, l&amp;rsquo;équation caractéristique de cette relation de récurrence est un polynôme de
degré 2, &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-002.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-002.png&quot; /&gt;&lt;/div&gt;dont les solutions sont&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-003.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-003.png&quot; /&gt;&lt;/div&gt;et&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-004.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/fibo-004.png&quot; /&gt;&lt;/div&gt;Le premier nombre est souvent connu comme étant le &lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;nombre d&amp;rsquo;or&lt;/span&gt; (&lt;a href=&quot;http://fr.wikipedia.org/wiki/Nombre_d%27or&quot;&gt;ici&lt;/a&gt;).
Bref, Fibonacci a été recyclé abondamment par l&amp;rsquo;utilisation ésotérique
de cette racine de polynôme de degré 2. Aussi, lorsque j&amp;rsquo;ai vu évoqué
le nom de Fibonacci dans cet ouvrage de finance, j&amp;rsquo;ai eu peu peur,
d&amp;rsquo;autant plus que certaines personnes faisant de l&amp;rsquo;&lt;em&gt;analyse chartiste &lt;/em&gt;utilisent
ce nombre d&amp;rsquo;or (comme l&amp;rsquo;évoque rapidement certains site, comme
http://www.forexfibonacci.com/ ou http://www.fibonaccitrader.com/).
Aussi, parler de Fibonacci en finance, c&amp;rsquo;est un peu comme parler de
Nostradamus dans les modèles de prévisions.&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.FIBONACCI_SPIRAL_drawing_GT__s.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Que nenni mon ami&amp;thinsp;! Fibonacci est l&amp;rsquo;auteur d&amp;rsquo;un &amp;nbsp;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;Liber Abaci&lt;/span&gt;, correspondant à un &lt;em&gt;livre des calculs&lt;/em&gt;.
En fait, Leonardo s&amp;rsquo;est énormément inspiré des &lt;img style=&quot;width: 215px; height: 170px; float: right;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/fibo-image.PNG&quot; alt=&quot;&quot; /&gt;mathématiques arabes,
alors que la norme était plutôt l&amp;rsquo;arithmétique romaine. Pour ceux qui
ont essayé un jour dans leur vie de lire des nombres latins (même dans
Astérix), la logique est assez déroutante&amp;thinsp;! Par exemple 888 s&amp;rsquo;écrit
DCCCLXXXVIII... Essayez avec cette écriture de poser une addition&amp;thinsp;! Les
nombres arabes - eux - utilisaient le système décimale, ce qui a fait gagné
énormément de temps de calcul (on peut aussi remonter à l&amp;rsquo;arithmétique
indienne, mais on sort largement du cadre de mon billet). Fibonacci
évoque d&amp;rsquo;ailleurs constamment l&amp;rsquo;utilisation de la&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt; règle de trois &lt;/span&gt;(sans l&amp;rsquo;appeler ainsi, j&amp;rsquo;étais revenu &lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/02/25/Provisionnement-et-r%C3%A8gle-de-trois&quot;&gt;ici&lt;/a&gt; sur l&amp;rsquo;origine de cette règle).&lt;br /&gt;Dans
son livre d&amp;rsquo;arithmétique des nombres arabes, Fibonacci montre une
application intéressante: le calculs d&amp;rsquo;actualisation et des marges
commerciales. William &lt;img title=&quot;fibo-origins-4.PNG, juin 2010&quot; style=&quot;margin: 0 1em 1em 0; float: left;&quot; alt=&quot;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/fibo-origins-4.PNG&quot; /&gt;Goetzmann reprend tout cela dans un article publié en 2003, &quot;
&lt;em&gt;Fibonacci and the Financial Revolution&lt;/em&gt;&quot; en ligne &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=461740&quot;&gt;ici&lt;/a&gt;.
Il faut aller pour cela dans le chapitre 12 du Liber Abaci, où
Fibonacci parle de partage du profit (ce que nous appellerions
l&amp;rsquo;allocation de capital, et que l&amp;rsquo;on retrouve dans les travaux sur les
jeux coopératifs, en particulier les travaux de Shapley), mais aussi d&amp;rsquo;&lt;span style=&quot;font-weight: bold; color: rgb(204, 0, 0);&quot;&gt;actualisation&lt;/span&gt;
de flux futurs, et surtout, de réflexions sur la différence entre un
taux annuel et un taux trimestriel. La version en anglaise est la
suivante&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.fibo-origins-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;ou encore&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.fibo-origins-2_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;Dans la version originale, cela donne&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.fibo-origins-3_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Quand
on pense qu&amp;rsquo;auparavant l&amp;rsquo;arithmétique se faisait en chiffre romain, et
n&amp;rsquo;autorisait pas de raisonnements aussi subtils, on peut légitimement
penser que Fibonacci est révolutionné le calcul actuariel (certes, en
se contentant de traduire des textes arabes). Si on cherche à remonter
encore dans le temps, on peut également citer un mathématicien indien,
Brahmagupta, ब्रह्मगुप्त, vers 650, qui semble également avoir beaucoup
inspiré Fibonacci.</description>
    
    
    
      </item>
    
  <item>
    <title>Histoire éthylique, partie 4</title>
    <link>http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/05/31/Histoire-%C3%A9thylique%2C-partie-4</link>
    <guid isPermaLink="false">urn:md5:d3bfe7554ce9be3fe2bf9d3d8149f5e5</guid>
    <pubDate>Mon, 31 May 2010 17:05:00 +0200</pubDate>
    <dc:creator>Arthur Charpentier</dc:creator>
        <category>Finance</category>
        <category>alcool</category><category>américaine</category><category>CRAN</category><category>exercice</category><category>finance</category><category>frontière</category><category>option</category><category>R</category><category>Rennes</category><category>rue de la soif</category>    
    <description>    &lt;p&gt;&lt;img style=&quot;width: 118px; height: 240px; float: left;&quot; src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.lampe-biere_s.jpg&quot; alt=&quot;&quot; /&gt;suite aux pressions générales, je vais reprendre mes discussions
d&amp;rsquo;alcoolique.... ou plutôt reprendre des classiques de finance, en
expliquant que ce
sont simplement des problèmes que se posent les amateurs de boissons
fortes (de là à conseiller plutôt de recruter dans les bars qu&amp;rsquo;à la
sortie des grandes écoles...).&lt;br /&gt;Bref, avant d&amp;rsquo;avoir entamé sa marche aléatoire dans la rue de la soif (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/04/26/Histoire-%C3%A9thylique,-partie-3&quot;&gt;ici&lt;/a&gt;, correspondant aux problèmes d&amp;rsquo;options à barrière traduit en termes financier), puis d&amp;rsquo;avoir un soucis avec ses clés (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/04/14/Histoire-%C3%A9thylique%2C-partie-1&quot;&gt;là&lt;/a&gt;), puis la maréchaussée
 (&lt;a href=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/index.php/post/2010/04/19/Histoire-%C3%A9thylique%2C-partie-2&quot;&gt;ici&lt;/a&gt;), notre héros (car on peut maintenant l&amp;rsquo;appeler un &lt;em&gt;héros&lt;/em&gt;
après 4 billets qui lui sont consacrés) avait du choisir son bar... Le
problème est loin d&amp;rsquo;être simple. Il y a 20 bars dans la rue (disons&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-50.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-50.png&quot; /&gt; pour faire quelque chose de plus formel). Il arrive de la place sainte Anne, et là, il souhaite choisir le bar le moins cher. Le soucis est qu&amp;rsquo;il n&amp;rsquo;a pas le droit de faire demi-tour&lt;sup&gt;1&lt;/sup&gt;
et il ne connaît pas les prix pratiqués dans les différents bars. Il
part avec un a priori qui est que le prix d&amp;rsquo;une pinte est compris entre
3 et 6 euros, que le prix est uniformément réparti entre ces deux prix,
et que les prix sont indépendants d&amp;rsquo;un bar à l&amp;rsquo;autre. Pour les
financiers, il a une option (de commander une bière), et peut l&amp;rsquo;exercer
quand il le souhaite. Une option américaine en quelque sorte. Supposons
qu&amp;rsquo;on soit arrivé au bar&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-01.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-01.png&quot; /&gt;. On peut soit payer&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-02.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-02.png&quot; /&gt;
(qui est supposé aléatoire, uniformément distribué et indépendant des
autres bars), soit espérer que l&amp;rsquo;on puisse payer moins cher plus loin,&lt;br /&gt;Soit&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-03.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-03.png&quot; /&gt; la valeur de cette option, alors&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-04.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-04.png&quot; /&gt;&lt;/div&gt;i.e.&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-05.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-05.png&quot; /&gt;&lt;/div&gt;soit &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-06.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-06.png&quot; /&gt;&lt;/div&gt;où&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-07.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-07.png&quot; /&gt; désigne la loi du prix de la bière (soit ici une loi uniforme) avec une condition terminale de la forme &lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-09.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-09.png&quot; /&gt;&lt;/div&gt;car il a soif, et ne quitera pas la rue sans avoir bu un verre&amp;thinsp;!&lt;br /&gt;Classiquement, par backward induction, on peut résoude ce programme, à partir de la loi de&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-10.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-10.png&quot; /&gt;. Posons&amp;nbsp;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-12.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-12.png&quot; /&gt;. Alors&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-13.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-13.png&quot; /&gt;&lt;/div&gt;et&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-14.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-14.png&quot; /&gt;&lt;/div&gt;soit simplement&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-16.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-16.png&quot; /&gt;&lt;/div&gt;soit enfin&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-18.png&quot; src=&quot;http://perso.univ-rennes1.fr/arthur.charpentier/latex/opt-am-18.png&quot; /&gt;&lt;/div&gt;Je
laisse les plus courageux simplifier les calculs. La &quot;frontière
d&amp;rsquo;exercice&quot; est alors obtenue par récurence. Numériquement, le code est
alors simplement&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; n=20&lt;br /&gt;&amp;gt; u=rep(NA,n)&lt;br /&gt;&amp;gt; b=6;a=3&lt;br /&gt;&amp;gt; u[n]=(b+a)/2&lt;br /&gt;&amp;gt; for(k in (n-1):1){&lt;br /&gt;+ u[k]=1/(b-a)*(u[k+1]*(b-u[k+1])+(u[k+1]^2-a^2)/2)&lt;br /&gt;+ }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.bars-continus-rennes-1_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Dès
qu&amp;rsquo;on atteind la barrière, on s&amp;rsquo;assoit au bar. On note que plus on
avance dans la rue, moins on est exigent: au tout début, on ne s&amp;rsquo;assoit
pas à moins de 3 euros 30... mais plus on avance, plus on relève le
seuil d&amp;rsquo;exigence. Le calcul sous forme intégrale donne ici&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; u=rep(NA,n)&lt;br /&gt;&amp;gt; b=6;a=3&lt;br /&gt;&amp;gt; u[n]=(b+a)/2&lt;br /&gt;&amp;gt; for(k in (n-1):1){&lt;br /&gt;+ g=function(x){pmin(x,rep(u[k+1],length(x)))/(b-a)}&lt;br /&gt;+ u[k]=integrate(g,lower=a,upper=b)$value&lt;br /&gt;+ }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;J&amp;rsquo;avais
déjà abordé ce problème dans un précédant billet, sur les options
américaines, mais on peut maintenant aller un peu plus loin... que se
passe-t-il si on suppose que les prix sont discret (par exemple par
tranches de 50 centimes ou 1 euro)&amp;thinsp;? L&amp;rsquo;avantage avec ces méthodes
numériques est que l&amp;rsquo;on peut très facilement enlever des hypothèses,
par exemple ici on aurait&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9px; line-height: 20px; font-family: Arial;&quot;&gt;&lt;span style=&quot;border-width: 0; margin: 0; padding: 0; color: rgb(0, 0, 153); font-family: Georgia;&quot;&gt;&amp;gt; h=2&lt;br /&gt;&amp;gt; K=(b-a)*h+1&lt;br /&gt;&amp;gt; PRIX=seq(a,b,by=1/h)&lt;br /&gt;&amp;gt; u2=rep(NA,n)&lt;br /&gt;&amp;gt; b=6;a=3&lt;br /&gt;&amp;gt; u2[n]=(b+a)/2&lt;br /&gt;&amp;gt; for(k in (n-1):1){&lt;br /&gt;+ g=function(x){pmin(x,rep(u[k+1],length(x)))}&lt;br /&gt;+ u2[k]=sum(g(PRIX)*1/K)}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;pour des seuils à 1 euros (les seuls prix possibles étant 3,4,5 ou 6 euros).&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.pinte-rennes-1-euros-20_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;Ou la frontière suivante si les prix varient par tranche de 50 centimes. &lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.pinte-rennes-50-centimes-20_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Compte tenu de la discrétisation, notons que la vraie frontière devient alors ici&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogperso.univ-rennes1.fr/arthur.charpentier/public/perso3/.trunc-inf-pinte_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
Bref,
comme toujours, les problèmes d&amp;rsquo;alcooliques rejoignent les problèmes
d&amp;rsquo;exercice optimal d&amp;rsquo;options américaines, problème classique en finance
de marché...&lt;br /&gt;&lt;sup&gt;1&lt;/sup&gt;&amp;nbsp;pour rendre cette histoire crédible, à
chaque bar rencontré il demande le prix d&amp;rsquo;une pinte. S&amp;rsquo;il estime que
c&amp;rsquo;est trop cher, il s&amp;rsquo;exclame &quot;&lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;mais c&amp;rsquo;est bien trop cher ici&amp;thinsp;!&lt;/span&gt;&quot;
et s&amp;rsquo;en va. Sinon il commande et s&amp;rsquo;installe. Cette exclamation rend
improbable - à ses yeux - l&amp;rsquo;idée de revenir finallement s&amp;rsquo;intaller au
bar....</description>
    
    
    
      </item>
    
</channel>
</rss>