Category Archives: Economics

Is there discrimination against the poor?

(With Laurence Barry, we wrote a short article on discrimination against the poor, in French)

In 2013, Martin Hirsch (former director of Emmaüs and Assistance publique – Hôpitaux de Paris) stated “it’s getting expensive to be poor”. This reality was confirmed by a recent study, in France, by the Banque Postale*, which showed that on average, a poor household has to pay 1,500 euros more each year to access the same goods and services as a better-off household, introducing a “double poverty penalty**”. Unfortunately, insurance is not left out: the use of credit scores in many countries reinforces what could be a form of discrimination against the poor. In the United States, where the practice is more common than elsewhere, a commission of inquiry recently tried to explain the link between credit score and claims frequency: is it because, as some insurers argue, people with lower scores are also less careful than others? Or is it because, having less financial means than others, they more naturally ask to be compensated for the losses incurred? And, in this second case, are we not also making them pay twice for their condition?

From excellence to wealth as a virtue

On what criteria do we admire people? For the Greeks, excellence, or arête (ἀρετή), was a major virtue. This excellence went beyond moral excellence: in the Greco-Roman world, the term evoked a form of nobility, recognizable by the beauty, strength, courage, or intelligence of the person. Now this excellence had little to do with wealth: thus Herodotus is astonished that the winners of the Olympian games were content with an olive wreath and a “glorious renown,” peri-bones (περὶ ἀρετῆς). In the Greek ethical vision, especially among the Stoics, a “good life” does not depend on material wealth – a precept pushed to its height by Diogenes who, seeing a child drinking from his hands at the fountain, throws away the bowl he had for all crockery, telling himself that it is again useless wealth.

Greek society is nevertheless a deeply hierarchical society, even if it is organized around values other than material wealth. We can then ask ourselves at what point in Western history wealth became the measure of all things. One thinks then of Max Weber’s theory: the ethics of Protestantism pushes for work and earthly success as a revelation of a divine election to come: the rich of this world would be the chosen of the next. In the same way Adam Smith, taking a critical look at the birth of capitalism in the society of his time, titles a chapter of The Theory of Moral Sentiments (1759) “Of the corruption of our moral feelings occasioned by that disposition to admire the rich and great, and to despise or neglect the poor and lowly.”

Today, the cult of wealth seems to have never been so strong and material success is almost elevated to the rank of virtue. On the other hand, poverty becomes a stigma that is hard to get rid of; but history shows us that this is not natural.

From “good” to “bad” poor

Indeed, the poor have not always been “bad”. As Fulconis & Kikuchi (2017) remind us, the Church has largely contributed to disseminating the image of the “good poor”, as it appears in the Gospels: “happy are you poor, the kingdom of God is yours”; or “God could have made all men rich, but he wanted there to be poor people in this world, so that the rich would have an opportunity to redeem their sins”. Beyond this, the poor is seen as an image of Christ, Jesus having said “whatever you do to the least of these, you will do to me”. Helping the poor, doing a work of mercy, is a means of salvation.

For Saint Thomas Aquinas, charity is thus essential to correct social inequalities by redistributing wealth through almsgiving***. In the Middle Ages, merchants were seen as useful, even virtuous, since they allowed wealth to circulate within the community. Priests played the role of social assistants, helping the sick, the elderly and the disabled. The hospices and xenodochia of the Middle Ages (ξενοδοχεῖον, that “place for strangers,” ξένος) are the symbol of this care of the poor. And quite often, poverty is not limited to material capital, but also social and cultural, to use a more contemporary terminology.

Towards the end of the Middle Ages, the figure of the “bad poor”, the parasitic and dangerous vagabond, appeared. In line with Weber, Todeschini (2021) insists on the increasing value attached to work and social “usefulness”. Brant (1494), the first, begins to denounce these welfare recipients, “some become beggars at an age when, young and strong, and in full health, one could work: why bother”. For Fulconis & Kikichi (2017), this mistrust is reinforced with the great pandemic of the Black Death. Colombi (2020) returns to this turning point, at the end of the Middle Ages, when in the cities, the bourgeois closed their districts with chains, to avoid that “poor and foreigners” settle there. The hygienic theories of the end of the 19th century added the final touch: if fevers and diseases were caused by insalubrity and poor living conditions, then by keeping the poor out, they were protected from disease.

Poor… by choice?

In the words of Mollat (2006) “the poor are those who, permanently or temporarily, find themselves in a situation of weakness, dependence, humiliation, characterized by the deprivation of means, variable according to the times and the societies, of power and social consideration”. Recently, Cortina (2022) proposed the term “aporophobia”, or “pauvrophobia”, to describe a whole set of prejudices that exist towards the poor. The unemployed are said to be welfare recipients and lazy, says Lamy; it is also the famous “where there is a will there is a way”, (which can be found in contemporary expressions such as “those who don’t want to do anything, those who don’t want to work” or “I’ll cross the street and find you a job”). And as is often the case, these prejudices, which stigmatize a group, “the poor”, lead to fear or hatred, generating an important cleavage, and finally a form of discrimination. Cortina’s (2022) “pauvrophobia” is a discrimination against social precariousness, which would be almost more important than “usual” forms of discrimination, such as racism or xenophobia. Cortina ironically notes that rich foreigners are often not rejected.

But these prejudices also turn into accusations. Szalavitz (2017) thus abruptly asks the question, “Why do we think poor people are poor because of their own bad choices?”. The “actor-observer” bias provides one element of an answer: we often think that it is circumstances, which constrain our own choices, but that it is the behavior of others that changes theirs. In other words, others are poor because they made bad choices, but if I am poor, it is because of an unfair system. This bias is also valid for the rich: winners often tend to believe that they got where they are by their own hard work, and that they therefore deserve what they have.

Social science studies show, however, that the poor are rarely poor by choice, and increasing inequality and geographic segregation do not help. The lack of empathy then leads to more polarization, more rejection and, in a vicious circle, even less empathy.

Links between wealth and risk(s)

To discriminate is to distinguish (exclude or prefer) a person because of his/her “personal characteristics”. Can we then speak of discrimination against the poor? Is poverty (like gender or skin color) a personal characteristic? In Quebec, “social condition” (which explicitly includes poverty) is one of the protected variables and therefore prohibited discrimination. This is not the case in France. As Barry & Charpentier (2021) remind us, when actuaries calculate a premium, discrimination directly linked to risk, and provided that the variable is not protected, is generally seen as legitimate. However, it is well known that wealth or social status has a lot to do with risk, whatever it may be. At the global level, Denis Hatzfeld reminds us that “earthquakes are much more deadly in poor countries than in developed countries, which have gradually learned to protect themselves from them. Similarly, Le Hir (2010) states that “A schoolboy is 400 times more likely to die in an earthquake in Kathmandu than in Tokyo”.

This is true for most risks. In France, we find in the deaths due to road accidents 3% of executives and 15% of workers, while they represent nearly 20% of the working population each, according to ONISR (2022). Blanpain (2018) points out that the gap in life expectancy at birth is 13 years between the most affluent and the most modest men. Recently, Allain (2022) noted that the most modest French people, at comparable age and sex, had almost three times more diabetes, twice as much liver or pancreatic disease, 1.6 times more chronic respiratory disease, etc. than the average. Cambois, Laborde and Robine (2008) similarly noted that the number of years of disability for blue-collar workers is also much higher, over a shorter life span on average.

The use of credit scores in insurance

In North America, companies such as Experian, Equifax and TransUnion keep records of the borrowing and repayment activities of all individuals with bank accounts. FICO (Fair Isaac Corporation) offers a formula to convert these records into a score, the credit score. This score is a function of debt and available credit, income and its variations, and history of incidents, bankruptcies or simple delinquencies. It is often seen as an assessment of a person’s creditworthiness, or the likelihood that he or she will repay debts. It is by nature closely related to income (Crowe 2022), making the credit score a robust proxy for wealth. Fourcade and Healy (2013) show that, as a good credit score has become a necessary condition for obtaining credit and maintaining purchasing power, this system has come to create an impenetrable wall between advantaged and disadvantaged classes. In a sense, a bad credit score becomes a self-fulfilling prophecy: people with a bad score (and therefore considered high risk by banks) become dependent on short-term alternatives. This increases the costs of future financing, thus the probability of default (François 2021) but also the probability of not finding a job (this score can be requested by employers****). “Using credit scores to punish the poor exacerbates existing socioeconomic inequalities,” Wang (2018) thus aptly asserts.

As an example, Table 1 compares a few parameters based on people’s credit scores, including the rate obtained for a $150,000 loan over a 30-year horizon, and the average insurance premium charged for car insurance (for a 30-year-old driver, driving 20,000km per year, in the city).

Table 1: Actual price of a $150,000 loan and the amount of a car insurance premium (for comparable coverage and risk profile), based on credit score (ranging from 300 to 850). Source: InCharge Debt Solutions.

Kiviat (2019) has extensively studied the use of credit scores in the pricing of auto insurance in the United States. The US regulator has indeed looked at the proven link between bad credit score and auto risk. What explanation can be given for this correlation? Wouldn’t the score be an indicator of poverty and not a proxy for the driver’s prudence as insurers claim? For if social condition is not a protected variable as it is in Canada, it is still largely associated with skin color, which is a prohibited variable. Discriminating on the basis of credit score could therefore amount to prohibited racial discrimination. By examining the debates around these issues, Kiviat highlights the ethical complexity of using facially neutral variables. And if, as noted above, poor living conditions increase risk in general, it is worth asking whether insurance is not helping to apply the double whammy that Martin Hirsch spoke of to the poor.


Allain, S. (2022). Les maladies chroniques touchent plus souvent les personnes modestes et réduisent davantage leur espérance de vie. DREES, 1243
Blanpain, N. (2018). L’espérance de vie par niveau de vie : chez les hommes, 13 ans d’écart entre les plus aisés et les plus modestes. Insee, Insee Première, 1687.
Bourdelais, P. (2001) Les hygiénistes: enjeux, modèles et pratiques. Éditions Belin.
Brant, S. (1494). La Nef des fous (Das Narrenschiff).
Cambois, E., Laborde, C & Robine, J.M. (2008). La “double peine” des ouvriers : plus d’années d’incapacité au sein d’une vie plus courte. Population & Sociétés, n° 441.
Caplovitz, D. (1963). Poor pay more; consumer practices of low-income families. Free Press.
Colombi, D., (2020). Où va l’argent des pauvres. Payot.
Cortina, A. (2022). Aporophobia: Why We Reject the Poor Instead of Helping Them. Princeton University Press.
Crowe, A. (2022). The Relationship Between Income and Credit Score. Credit Sesame Personal Finance and Credit Survey,
Fourcade, M. & Healy, K. (2013). Classification situations: Life-chances in the neoliberal era, Accounting, Organizations and Society, 38 (8): 559–572
François, P. (2021). Catégorisation, individualisation. Retour sur les scores de crédit. Chaire PARI, WP #24.
Fulconis, M. & Kikuchi, C. (2017) Vu du Moyen Âge : du « bon pauvre » au « mauvais pauvre ». The Conversation.
Grossetête, M. (2012) Accidents de la route et inégalités sociales. Les morts, les médias et l’État, Éditions du Croquant.
Kiviat, B. (2019). The moral limits of predictive practices: The case of credit-based insurance scores. American Sociological Review, 84(6), 1134-1158.
Lamy, T. (2022) Assistés, paresseux… pour 50% des Français, les chômeurs sont responsables de leur situation. Capital, décembre 2022
Lauer,J. (2017) Creditworthy: A History of Consumer Surveillance and Financial Identity in America, Columbia University Press.
Le Hir, P. (2010). Catastrophes et pauvreté, la double peine. Le Monde, 22 janvier,
Merton, R. (1968). The Matthew effect in science, Science, vol. CLIX, n° 3810
Mollat, M. (2006). Les pauvres au moyen age (Vol. 11). Éditions Complexe.
ONISR (2022). La sécurité routière en France, bilan de l’accidentalité de l’année 2021.
Pratchett, (1993) Men at Arms, 15ème tome du cycle Discworld, Victor Gollancz Ed.
Smith, A. (1759). La Théorie des sentiments moraux. Presses Universitaires de France, Quadrige.
Szalavitz, M. (2017). Why do we think poor people are poor because of their own bad choices. The Guardian, 5 Juillet
Todeschini, G. (2021) Moyen Âge. La pauvreté a-t-elle un sens ? L’Histoire, février 2021.
Wang, J. (2018), Carceral Capitalism, MIT Press.
Weber, M. (1990 [1904]). L’éthique protestante et l’esprit du capitalisme, Pocket.

* Study entitled “Study of the double poverty penalty in France“, published at the end of 2022 by Action Tank Entreprise & Pauvreté, Boston Consulting Group and the Banque Postale

** This phenomenon, widely studied in the 1960s, see Caplovitz (1963), is known in economics as the “boot theory” (popularized by Pratchett’s novel (1993)), “take boots, for example. A really good pair of leather boots costs fifty dollars. But an affordable pair of boots, which were sort of OK for a season or two and then leaked like hell when the cardboard gave out, cost about ten dollars (…). But the thing was that good boots lasted for years and years.”

*** The notion of redistribution can be contrasted with the “Matthew effect” as defined by Merton (1950). Inspired by a passage from the Gospel according to St. Matthew (which he reverses), he states that “to him who has shall be given, and he shall have plenty; but to him who has not, even that which he has shall be taken away.”

**** This rating practice is actually not new and dates back to the late 19th century: Josh Lauer (2017) shows that as early as 1870, so well before big data or even credit cards, US banks employed assessors to make financial strength reports on people. For Lauer, it is a gigantic surveillance system that was set up at the beginning of the 20th century, leading to the algorithmic credit scores as we know them today (see also François (2021)).

Reinforcement Learning in Economics and Finance, a state-of-the-art

Our joint paper, with Romuald Elie and Carl Remlinger entitled Reinforcement Learning in Economics and Finance just appeared in Computational Economics,

Reinforcement learning algorithms describe how an agent can learn an optimal action policy in a sequential decision process, through repeated experience. In a given environment, the agent policy provides him some running and terminal rewards. As in online learning, the agent learns sequentially. As in multi-armed bandit problems, when an agent picks an action, he can not infer ex-post the rewards induced by other action choices. In reinforcement learning, his actions have consequences: they influence not only rewards, but also future states of the world. The goal of reinforcement learning is to find an optimal policy — a mapping from the states of the world to the set of actions, in order to maximize cumulative reward, which is a long term strategy. Exploring might be sub-optimal on a short-term horizon but could lead to optimal long-term ones. Many problems of optimal control, popular in economics for more than forty years, can be expressed in the reinforcement learning framework, and recent advances in computational science, provided in particular by deep learning algorithms, can be used by economists in order to solve complex behavioral problems. In this article, we propose a state-of-the-art of reinforcement learning techniques, and present applications in economics, game theory, operation research and finance.

Concilier risques collectifs et décisions individuelles

cet article a été co-écrit avec Laurence Barry.

Les débuts de la pandémie de SARS-CoV-2 (ou COVID-19) ont vu se multiplier les appels à la « responsabilité individuelle », en commençant par de fortes demandes (voire une obligation dans certains pays, dont la France) à rester chez soi autant que possible, au début du printemps 2020, avant qu’il ne soit obligatoire de porter un masque dans les lieux publics (souvent fermés) au cours de l’été. En paraphrasant Coluche, « dire qu’il suffirait que les gens restent chez eux pour qu’on puisse sortir… ». Cet appel à la responsabilité de chacun est faite au nom de tous et pour le bien de tous, venant symboliser cette solidarité toute particulière que nous rappelle la pandémie : le risque que je choisis de courir ne concerne pas seulement ma personne mais constitue aussi un risque pour ceux qui m’entourent. Pour le formuler en terme probabiliste, McKendrick (1926) affirmait « la probabilité d’occurrence augmente avec le nombre de cas existants ». Assez intuitive a priori, cette conception de la responsabilité individuelle va en réalité à l’encontre de la conception classique en économie : l’individu rationnel (et responsable) fait des choix le concernant, et ne concernant que lui. Le bien collectif se déduit par sommation des utilités individuelles, indépendantes les unes des autres. Seulement voilà ; avec l’épidémie se crée une interdépendance des utilités qui fait que le bien-être d’Untel, qui choisit de ne pas porter de masque, peut nuire à la santé et donc l’utilité de beaucoup d’autres personnes. Comment penser alors en termes économiques cette « responsabilité individuelle » dans le contexte de l’épidémie ?

Des préférences individuelles au bien-être collectif

L’hypothèse centrale de la théorie économique du comportement est que chacun est capable de classer, par ordre de préférence, toutes sortes d’alternatives qui lui sont proposées. Et si je dois choisir une parmi deux, je choisirai systématiquement celle que je préfère. Comme le montre Mas-Colell et al. (1995), une simple hypothèse de continuité des préférences se traduit alors par l’existence d’une fonction d’utilité individuelles traduisant ces préférences. Cette approche pourrait suffire dans l’état de nature de Jean-Jacques Rousseau, lorsque l’homme est imaginé vivant en solitaire. Mais en société il convient d’être plus réaliste, et de tenir compte des interactions entre les individus. Organiser la vie en société, en favorisant la coopération et en cherchant à assurer un bien-être collectif, ne peut en effet se faire en se contentant de comprendre le bien-être individuel. Pour reprendre un exemple de Jean-Jacques Rousseau, plusieurs chasseurs ont intérêt à collaborer pour traquer un cerf, car aucun chasseur ne saurait y arriver seul[i] (Rousseau, 1755). La première difficulté est donc d’assurer une collaboration pour la chasse, mais aussi et surtout, si un cerf est tué, se pose le problème de la répartition de la viande.

Tout au long du XVIIIème siècle Francis Hutcheson et Adam Smith en Angleterre, Jean-Charles de Borda et Nicolas de Condorcet ont tenté de formaliser cette notion de « bien-être collectif », montrant qu’il existait malheureusement de très nombreux paradoxes, en particulier quand il s’agit du bien être d’une nation. A la même époque, Kant formalise l’impératif catégorique : « Agis uniquement d’après la maxime qui fait que tu puisses vouloir en même temps qu’elle devienne une loi universelle ». Autrement dit, avant de prendre une décision pour agir, il convient de se demander ce qui se passerait si tout le monde agissait de cette manière. La rationalité de l’individu se doit d’être collective, et de prendre en compte l’humanité dans son ensemble. Dans sa lecture de Kant, Arendt (1991) met en avant le sensus communis, ce sens commun à tous les hommes et qui rattache le jugement de chacun « à la raison humaine tout entière ». Penser par soi-même devient alors « penser en se mettant à la place de tout autre, dans ce qu’elle appelle une « mentalité élargie ».

Tocqueville quant à lui renverse les termes de l’équation. Dans les pays démocratiques selon lui, on ne peut plus mettre en avant la valeur du sacrifice de soi : il faut pouvoir démontrer que « l’homme en servant ses semblables se sert lui-même (…) Aux Etats-Unis on ne dit presque point que la vertu est belle. On dit qu’elle est utile ». Cela implique cependant de « petits sacrifices », consentis car ils se révèlent bénéfiques pour celui qui les consent. Tocqueville (1981) exhorte alors ses lecteurs à agir dans leur intérêt « bien entendu », c’est-à-dire en tenant compte de l’intérêt de tous.

Cette rationalité collective est en réalité une pratique habituelle au sein de petits groupes, comme la famille. Il n’est pas rare, en effet, de mettre de côté son intérêt personnel pour le bien de la famille. Mais elle est plus complexe à mettre en œuvre au sein d’un groupe plus important, plus hétérogène, voire plus abstrait.

Le passager clandestin contre les intérêts communs

Une vision résolument optimiste consisterait en effet à croire que si tous les membres d’un groupe ont des intérêts communs, alors chacun va agir pour les atteindre. Un exemple bien connu est celui du réchauffement climatique : collectivement, l’intérêt de tous est la réduction des gaz à effet de serre au niveau mondial ; mais individuellement, chaque pays a la tentation de retarder la mise en place de mesures qui pourraient pénaliser son économie, en espérant toutefois bénéficier d’actions précoces de pays voisins. C’est le principe du passager clandestin : il y aurait un bénéfice collectif à tirer d’une coopération, mais les individus ont davantage d’incitations à chercher à profiter de la « coopération » des autres. En termes économiques, ils cherchent à avoir une prestation sans en assumer les coûts.

Ce problème, largement étudié dans Olson (1965), est classique pour la majorité des « biens publics[ii] » qui satisfont deux caractéristiques : être non-rival et non-excluable, c’est-à-dire dont la consommation par les uns ne diminue pas la quantité disponible pour les autres et dont on ne peut par ailleurs restreindre l’accès. Axelrod & Hamilton (1981) expliquaient que la coopération nécessaire à la promotion de biens communs ne dépendait pas forcément d’une forme d’altruisme, mais plus simplement d’une réciprocité entre les agents, basée sur une coopération conditionnelle : ils coopèrent s’ils pensent que les autres vont faire de même. Plusieurs études ont montré que la majorité des gens fonctionnent de la sorte, mais leur comportement est très sensible à leurs croyances, d’où l’importance de maintenir leurs convictions en matière d’égalité (ou d’égalitarisme) : tout le monde doit coopérer, personne ne doit bénéficier d’un traitement de faveur. Fehr & Fischbacher (2004) ont ainsi montré qu’il suffit d’une petite proportion de passagers clandestins pour provoquer une rupture[iii] de la coopération. Ceci explique probablement les diverses normes injonctives autour de la « distanciation sociale », assurant qu’une personne qui resquille soit sanctionnée de manière exemplaire. En effet, comme le soulignent Brito et al. (1991) à propos des vaccins, même si l’obligation de vacciner est sous-optimale, elle peut être nécessaire si la proportion de gens prêts à se porter volontaires est en dessous du seuil nécessaire à l’immunité de la population dans son ensemble.

Le cas de la vaccination

La vaccination est en fait un exemple presque parfait de ce problème de passager clandestin, via la notion d’immunité de groupe. Plus le taux de personnes immunisées augmente, dans un groupe, plus le risque pour une personne non-immunisée de rencontrer une personne infectieuse diminue, et au-delà d’un certain seuil (de l’ordre de 80% pour la plupart des maladies, comme la coqueluche, la variole, la polio, etc), il devient impossible pour la maladie de se maintenir dans la population et elle finit par disparaître. Pour les maladies contagieuses bénéficiant d’un vaccin, au niveau collectif, il est souhaitable que 80% de la population soit vaccinée ; mais si la vaccination a des effets secondaires conséquents, il peut être rationnel au niveau individuel de ne pas souhaiter être vacciné.

Deux aspects importants entrent alors en jeu : la perception des risques, et la croyance dans le comportement des risques des autres membres de la communauté. Avoir une minorité de passagers clandestins (disons moins de 20%), parce qu’ils pensent les risques trop grands, n’est pas problématique. Mais si la perception des risques change, on peut observer la rupture de l’équilibre, et l’immunité de groupe n’existe plus. Aussi, la confiance dans l’autorité est essentielle, comme le rappelait Charpentier (2020).

L’immunité collective fonctionne grâce à un contrat social implicite : ceux qui sont médicalement capables de se faire vacciner doivent se faire vacciner. La contrepartie est que les personnes que ne souhaitent pas respecter ce contrat devraient s’engager à ce que leurs actions n’entraînent pas de coût supplémentaire pour ceux qui le respectent, en particulier en s’imposant une forte distanciation sociale, en évitant les lieux publics, de manière à ne pas contaminer des personnes ayant de faibles défenses immunitaires, et qui sont, elles, dans l’obligation de compter sur l’immunité collective.

Les pandémies et leurs réponses individuelles

Comme le disait Daniel Kahneman dans Konnikova (2020), « people, certainly including myself, don’t seem to be able to think straight about exponential growth. What we see today are infections that occurred 2 or 3 weeks ago and the deaths today are people who got infected 4 or 5 weeks ago. All of this is I think beyond intuitive human comprehension ». Le fait d’adopter une attitude de passager clandestin et de ne pas respecter les contraintes de distanciation sociale tient peut-être simplement du fait qu’on ne comprend simplement pas ce qu’est une croissance exponentielle : on ne mesure pas vraiment l’impact de sa propre contagion sur le groupe dans son ensemble.

Ce point a été montré dans Lammers et al. (2020) à partir de l’interprétation du nombre de reproduction de base R0 des modèles épidémiologiques. Le  Rcorrespond au nombre moyen de personnes qu’une personne contagieuse peut infecter : il constitue ainsi une visualisation de la contagiosité d’un individu sur son entourage. Avec un R0 de 1, la pandémie est contrôlée, et la croissance est linéaire. Mais s’il excède 1, la croissance est exponentielle. Avec un R0 de 1.5, 4 personnes vont en contaminer 6 autres, qui à leur tour vont en contaminer 9 autres, etc. En une quinzaine d’itérations, 1 750 personnes seront contaminées. Avec un R0 de 2, ces 4 individus auront contaminé plus de 130 000 personnes (soit 75 fois plus), en une quinzaine d’itération ! Autrement dit, alors qu’au niveau de l’individu spécifique l’augmentation est à peine perceptible (il contamine 2 personnes au lieu de 1.5 en moyenne), l’effet collectif est, lui, extrêmement important et difficilement concevable.

Figure 1 : nombre de personnes contaminées après 1, 3, 5, 7, 9 itérations, pour différentes valeurs de R0 (entre 1.8 en haut à gauche et 2.4 en bas à droite).

De nombreuses études en science du comportement ont montré que nous sommes davantage sensibilisés face à une seule personne identifiable qu’en étant noyé sur une avalanche de chiffres. Ce serait alors par l’exemple que l’on pourrait se convaincre mutuellement de coopérer pour le bien commun. Le port du masque facial est intéressant, car si des sondages ont montré qu’une majorité des gens portaient un masque pour se protéger, les masques ont surtout pour effet de protéger les autres personnes d’une transmission asymptomatique du SARS-CoV-2. Il présente aussi l’avantage de rendre visible la nouvelle norme sociale et d’impliquer activement tous les membres de la communauté. En devenant un symbole de la solidarité, le port du masque engage ainsi la coopération de chacun. A l’inverse, les photos de personnes à la plage ou dans les parcs publics qui ne respectent pas la distanciation sociale ont probablement eu un impact préjudiciable en termes de changement de comportement.

Les débats autour des applications de traçage sont un autre exemple frappant de la difficulté de faire accepter la coopération. Comme pour le masque, elles sont présentées le plus souvent comme permettant d’être alerté si l’on a été en contact avec une personne contaminée, donc comme un moyen de se protéger soi-même ; beaucoup plus rarement est mise avant la possibilité de prévenir autrui de sa propre contamination, parfois un inconnu qu’on ne pourra jamais alerter sans l’application. De plus, alors qu’elles étaient recommandées par de nombreux épidémiologistes (di Domenico et al. 2020; Ferguson et al. 2020; Ferretti et al. 2020), elles ont été dénoncées soit parce qu’elles porteraient atteinte à la liberté individuelle, soit parce qu’elles présenteraient des dangers de détournement. Dans une importante contribution, des experts en cryptographie ont ainsi tenté d’alerter l’opinion publique sur les possibles usages malveillants de ces applications ; au travers d’une quinzaine d’exemples qui cherchent à marquer l’imagination, ce n’est plus le passager clandestin qui est mis en avant pour saper la coopération mais l’individu franchement malveillant qui chercherait à nuire à ses voisins (Vuillot et al. 2020).

De la place de la liberté individuelle

Dans le contexte de la vaccination, et plus récemment sur le port du masque, l’argument de la liberté de choix est souvent avancé par les opposants, laissant croire que l’exercice de la liberté se faisait sans contraintes. Comme le note Frankfurt (2003), la plupart des religions limite le comportement d’une personne dans la mesure où elle agit en accord avec les préceptes de son Dieu ou de son église. Dans un contexte plus laïque, Jean-Jacques Rousseau affirmait que « l’obéissance à la loi qu’on s’est prescrite est liberté ». Car le concept de liberté s’accompagne toujours de la notion de responsabilité : je suis libre lorsque deux conditions sont réunies. Premièrement, j’ai la capacité d’agir (ou de ne pas agir) d’une manière particulière, et deuxièmement, j’accepte la responsabilité de mes actes. Quand je refuse de porter un masque en période de pandémie, j’accepte la première condition mais rejette la seconde. Autrement dit, j’affirme mon droit d’agir, ou de ne pas agir, mais je le fais de manière à refuser d’accepter toute responsabilité pour les conséquences que mes actions (ou inactions) peuvent entraîner. Comme l’affirmait Friedrich Hayek, « la liberté ne signifie pas seulement qu’une personne a le droit de choisir et qu’elle porte le fardeau de ses choix, mais aussi qu’elle doit assumer les conséquences de ses actes, pour lesquels elle sera félicitée ou blâmée. Liberté et responsabilité sont indissociables ».

L’assurance comme réponse collective ?

Dans le contexte de la santé, Wikler (2002) affirmait « if people know they are taking risks but accept them as the price of pursuing goals to which they assign higher priority, then it is not the business of public health to insist that health be valued above all ». Si ce précepte peut valoir pour l’assurance santé classique, il est plus difficile à appliquer à l’épidémie ; comme expliqué plus haut, dans les maladies contagieuses le choix individuel de prendre un risque se répercute sur le reste de la collectivité. De plus, la logique assurantielle de couverture de l’aléa grâce à la mutualisation fonctionne mal dans le cadre de l’épidémie ; on est dans le cas classique d’un risque systémique où les individus et leurs risques ne sont pas indépendants. En réalité, la contagion met en avant une solidarité d’un autre ordre que celle promue par l’assurance, comme le note Barry (2020). Il s’agit d’une interdépendance où le comportement de l’un impacte le risque de l’autre et qui exige, pour être contrôlé, la coopération de tous. Penser collectivement, c’est donc finalement adopter des valeurs de solidarité et de coopération.


Arendt, Hannah (1991). Juger – La Philosophie Politique de Kant. Points. Paris: Seuil.

Axelrod, Robert & Hamilton, William (1981). The Evolution of Cooperation. Science, 211 (4489): 1390–96.

Barry, Laurence (2020). Individu/Collectif : L’épidémiologie à l’épreuve Du Big Data (Ou l’inverse) ? Working Paper # 20. Paris: Chaire PARI.

Brito, Dagobert, Sheshinski Eytan & Intriligator Michael (1991). Externalities and Compulsory Vaccinations. Journal of Public Economics 45, 69–90.

Charpentier, Arthur (2020). De la démarche scientifique en période de crise. Risques, 121.

Costa, Dora et Kahn, Matthew (2003). Civic Engagement and Community Heterogeneity: An Economists Perspective. Perspectives on Politics, 1(1): 103-112.

di Domenico, Laura, Giulia Pullano, Chiara Sabbatini, Pierre-Yves Boelle, and Vittoria Colizza. (2020). Expected Impact of Lockdown in Île-de-France and Possible Exit Strategies. 9. Paris: INSERM.

Fehr, Ernst & Fischbacher, Urs (2004). Social norms and human cooperation. Trends in Cognitive Sciences, 8(4), 185-190.

Ferguson, Neil, D. Laydon, G. Nedjati Gilani, N. Imai, K. Ainslie, M. Baguelin, S. Bhatia, A. Boonyasiri, Z. Cucunuba Perez, G. Cuomo-Dannenburg, A. Dighe, I. Dorigatti, H. Fu, K. Gaythorpe, W. Green, A. Hamlet, W. Hinsley, L. Okell, S. Van Elsland, H. Thompson, R. Verity, E. Volz, H. Wang, Y. Wang, P. Walker, C. Walters, P. Winskill, C. Whittaker, C. Donnelly, S. Riley, & A. Ghani. 2020. Report 9: Impact of Non-Pharmaceutical Interventions (NPIs) to Reduce COVID19 Mortality and Healthcare Demand. Imperial College Report.

Ferretti, Luca, Chris Wymant, Michelle Kendall, Lele Zhao, Anel Nurtay, Lucie Abeler-Dörner, Michael Parker, David Bonsall, & Christophe Fraser. (2020). Quantifying SARS-CoV-2 Transmission Suggests Epidemic Control with Digital Contact Tracing. Science, Vol. 68 #619, 1-8.

Frankfurt, Harry, (2003) Freedom of the Will and a Concept of a Person, in Gary Watson (ed), Free Will, 2nd edition, Oxford University Press,  322-336.

Konnikova, Maria (2020). Why We Underestimated COVID-19. New Yorker, 3 avril 2020,

Lammers, Joris, Crusius, Jan et Gast, Anne (2020). Correcting misperceptions of exponential coronavirus growth increases support for social distancing. PNAS, 117 (28).

Lim, Wooyoung & Zhang, Pengfei (2020). Herd immunity and a vaccination game: An experimental study. PLoS One. 5(5), e0232652.

McKendrick, A. G. (1926). Applications of Mathematics to Medical Problems. Proceedings of the Edinburgh Mathematical Society 44, 98–130.

Mas-Colell, Andreu, Whinston, Michael et Green, Jerry (1995). Microeconomic Theory. Oxford University Press.

Olson, Mancur (1965). The Logic of Collective Action: Public Goods and the Theory of Groups. Harvard University Press.

Rousseau, Jean-Jacques (1755). Discours sur l’origine et les fondements de l’inégalité parmi les hommes. Garnier Flammarion.

Skyrms, Brian (2004) The Stag Hunt and the Evolution of Social Structure. Cambridge: Cambridge University Press.

Tocqueville, Alexis. (1981). De La Démocratie En Amérique – 2. Flammarion.

Vuillot, Xavier, Anne Bonnetain, Veronique Canteaut, Pierrick Cortier, Lucca Gaudry, Steve Hirschi, Stéphanie Kremer, Gaëtan Lacour, Matthieu Leurent, Léo Lequesne, André Perrin, Emmanuel Schrottenloher, Serge Thomé, and Christophe Vaudenay. (2020). Le Traçage Anonyme, Dangereux Oxymore Analyse de Risques à Destination Des Non-Spécialistes. Https://Risques-Tracage.Fr. Retrieved April 25, 2020 (

Wikler, Daniel (2002) Personal and social responsibility for health. Ethics & International Affairs, 16, 47-55.

Wolman, Davis (2020). Yes, the Public Can Be Trusted in a Pandemic. Wired, 27 mars 2020,

[i] Comme le rappelle Skyrms (2004), ce dilemme de chasse au cerf est aussi appelé jeu de l’assurance, en théorie des jeux et de choix sociaux.

[ii] On pourrait aussi penser aux « biens communs », qui sont des biens en capacité limité. Le SARS-CoV-2 a montré que le système de santé pouvait être saturé, ce qui en fait dès lors un bien rival.

[iii] Mathématiquement, cette rupture est intéressante car on peut alors voir la vaccination comme un jeu non-linéaire de bien public, comme le fait Lim & Zhang (2020).

Gini index, poverty and top shares

Consider some ordered income \{y_1,y_2,\dots,y_n\}, with y_1\leq y_2\leq\dots\leq y_n. A classical tool to visualize inequality is Lorenz curve: define the proportion of people F_{i}=i/n (with the convention F_{0}=0); then the cumulated wealth S_{i}=\sum_{j=1}^{i}y_{j} and the fraction of cumulated wealth L_{i}=S_{i}/S_{n} (with again {\displaystyle L_{0}=0}). Then Lorenz curve is simply the plot \{F_i,L_i\} : it plots the proportion of the total income of the population (y axis) that is cumulatively earned by the bottom x\% of the population. And Gini index is the ratio of the area that lies between the line of equality (the first diagonal, (0,0)-(1,1)) and the Lorenz curve over the total area under the line of equality. A simple formula would be {\displaystyle G={\frac {2\sum _{i=1}^{n}iy_{i}}{n\sum _{i=1}^{n}y_{i}}}-{\frac {n+1}{n}}}but let us keep in mind simply the fact that it is simply the area below the first diagonal. Note further that the Lorenz curve is increasing, and convex. So actually, for a given Gini index – say G=60\%, we can have the two following situations below : on the left, 60% of the poor people get absolutely nothing, and the top 40% shares equally the remaining wealth; on the right, one person gets 60% of the wealth, and everyone else shares equally the remaining wealth.

The two areas are equals (the triangles are the same – up to some symmetrys and rotations) so the two Lorenz curve exhibit the same Gini index. On the left, the 10% the poorest own 0% of the wealth (in green) while the 10% of the richest own 25% of the wealth (in red). On the right the 10% the poorest own 4% of the wealth (in green) while the 10% of the richest own 64% of the wealth (in red). Which can be seen as some sort of paradox : the two cases exhibit the same over inequality, but the one where the poorest get more is also the one where the richest get more.

More on Random dollars for everyone !

Following my post of yesterday evening, Alex (@AlexSablay) suggested me to look at the Boltzman-Gibbs distribution (e.g. in Yakovenko & Rosser (2009)). There are indeed interesting ideas, and it looks it is more or less what we tried to do in our previous post

Again, I found that article hard to read, but at some point, it looks like they mention that the limiting distribution could be a discrete version that tends to the exponential distribution when the size of the population tends to infinity. Here we have 2000 people, so it should be possible to see it..

If we go for 100,000 rounds, the range of wealth is

so it is still hard to say about the upper bound… For the distribution of the wealth, at the end we obtain the following histogram

and the empirical cumulative distribution function is

Here the red line is the exponential distribution…

So, indeed, it seems that there is a limiting distribution, and it is the exponential one… And the good thing with stable distributions is that they are some sort of fixed point : if we start with that distribution, we should not move (too much) from is. For instance, if we start with an exponential distribution

x = rexp(n,1/init)
x = x*init/mean(round(x))
x = round(x)

the range of the wealth remains very stable

as well as the density (again, it is a (symmetric)-kernel based estimate, with a multiplicative bias in 0, and some negative values)

If we plot Lorenz curve, we can see that inequalities do not change here

In that case, it is well known that the Lorenz curve is u\mapsto u+(1-u)\log(1-u) and Gini coefficient is exactly 1/2.

Random dollars for everyone !

During the week-end, Philippe Rivière made me discover an interesting problem,

Everyone in a room keeps giving dollars to random others.
You’ll never guess what happens next.f

It was coming from a post, a few years ago on… This problem was mentioned in recent post since it is related to an article published in the American Scientist in november 2019, Is Inequality Inevitable? (that was translated in French last week, for Pour la Science in a section wrongly entitled Economics since it is only a physicist vision of an (old) economic problem) – see also Brewster Kahle’s post.

(for those really interested in mathematics of inequalities, with a (mathematical) economic perspective, there are countless interesting articles…. see at least Thony Atkinson‘s book or several articles published in Econometrica – references are given in the slides of the course I gave a few years ago on that topic).

I wanted to try, on my own, because I did not understood most of the posts. Because my first thought is that the problem is ill-posed. First of all, what is this “giving dollars”? is it a fixed amount or a random one ? Let us start by assuming that it is fixed. Now, if you know a little bit about gambling and ruin, you guess that it’s very likelely that some one will get banckrupt (at least on a very very long range)… what should we do with that person? Actually, those points were clarified in Jordan’s post

“Imagine a room full of 100 people with 100 dollars each. With every tick of the clock, every person with money gives a dollar to one randomly chosen other person. After some time progresses, how will the money be distributed?”

A well-posed problem states that only people with money can give (everyone can receive) and the amount of money given is fixed.

  • A first model (with possible bankruptcy)

First of all, assume that everyone has a fixed amont of money, say 100 (as discussed above). And that each one must give 1 to someone, picked randomly, or more precisely

“every person gives a dollar to one randomly chosen other person”

So, the other people of person i means sampling in \{1,2,\cdots,n\}\backslash\{i\}

n = 2000
ns = 20000
init = 100
x = rep(init,n)
VX = x
VR = c(x[1],x[1])
for(s in 1:ns){
r = function(i) sample((1:n)[-i],size=1)
other = Vectorize(r)(1:n)
dx = table(other)
dx = as.numeric(dx[as.character(1:n)])
x = x -rep(1,n)+dx
if(s %% 200 ==0) VX=cbind(VX,x)

Here, I store the range of the wealth of my 2000 people, and every 200 rounds, I also keep tracks of the wealths. The plot of the evolution of the range is the following,

As expected, some people will be ruined… and so far, I did nothing, they keep playing… An easy solution would have been to given them an initial endowment of 1000, and not 100. But that’s only a temporary solution: over 20,000 rounds, there might have no bankruptcy, but over 200,000 there will be ! Before moving to the reflected problem (where only people with money give a dollar), just look at the evolution of the distribution of wealths,

or the evolution of the cumulative distribution

We clearly have more variability as we play. Here, I cannot compute any inequality indices (Lorenz curve is constructed only for positive wealths for instance).

I did not look at analytical results here. The only thing that I know for sure is that about (if there are enough people sharing money) one third (actually 36.78\% i.e. e^{-1}) will give one dollar, and receive nothing… that’s the law of small numbers (that result was mentioned in Jordan’s post).

  • The reflected problem (with no bankruptcy)

Consider now the reflected problem

“Imagine a room full of people with the same amount of money. With every tick of the clock, every person with money gives a dollar to one randomly chosen other person. After some time progresses, how will the money be distributed?”

(I call that reflected because if someone hits the zero-barrier, it can only go up : that person gives nothing, and can possibly receive)

for(s in 1:ns){
r = function(i) sample((1:n)[-i],size=1)
other = Vectorize(r)(which(x>0))
dx = table(other)
dx = as.numeric(dx[as.character(1:n)])
dx[] = 0
x = x -(x>0)*1+dx
VR = cbind(VR,range(x))
if(s %% 200 ==0) VX = cbind(VX,x)

Here the range is the following

We are bounded from below (it is not possible to have less than 0) and it seems that extremely reach people are less rich than before. We can look now at the cumulative distribution function (since there is no density here, because of the mass at 0)

(for to get some smooth function, I used a symmetric kernel estimate here, so numerically there are values below 0). Since wealths are positive, we can look at Lorenz curves

It seems that there are more and more inequality, as we play that reallocation game. But here again, I will have to run more simulations (and actually a lot more*) to see if there is a non-degenerated limit with such a game. Here, the distribution of wealth after n rounds is an homogenous Markov chain, taking values in \mathbb{N}_+, and using combinatorials, it should be possible to get the transition matrix…

* in did try (during the night) following the advise of Alex (@AlexSablay) advise, and indeed, there is a limiting distribution, see here

  • When the contribution is a fixed part (e.g. 1%) of the wealth

An important issue previously was about additivity : “every person with money gives a dollar“. Inequality measures do not like additive operations, they like multiplicate operations (see Serge Christophe Kohlm’s discussion, for instance), or using other words, changes should be relative, not absolute. What about the following question

“Imagine a room full of 100 people with the same amount of money. With every tick of the clock, every person gives a fixed percentage of his money to one randomly chosen other person. After some time progresses, how will the money be distributed?”

The code will be the following: as previously, we match givers and receivers, but here, we have to compute how people give (here it is 1/100 of the money, at each round). At the very first round, we are strictly equivalent to the previous versions : everyone gives 1. The only thing is that, at the second round, those who got nothing at the first one are required to give “only” 99¢.

frac = 1/100
for(s in 1:ns){
r = function(i) sample((1:n)[-i],size=1)
other = Vectorize(r)(1:n)
df = data.frame(dep = 1:n, arr = other, mont = x*frac)
A = aggregate(df$mont,by=list(df$arr),FUN=sum)
dx = A$x
names(dx) = as.character(A$Group.1)
dx = as.numeric(dx[as.character(1:n)])
dx[] = 0
x = x*(1-frac)+dx
VR = cbind(VR,range(x))
if(s %% 200 ==0) VX = cbind(VX,x)

Here is looks like we have some sort of convergence… at least, no one gets less than 75, and more than 125… The distribution can be visualized below

or via the cumulative distribution function

But to be honest, I don’t know what that distribution is…

To conclude, we can also try something (slightly) different : what if we start with non identical wealths ? Instead of having everyone with wealth 100$, what if it was uniformely distributed between 0$ and 200$ ?

x = seq(0,2*init,length=n)

It looks like we have a convergence towards the same distribution, with clearly less inequality than when we started… Here is the cumulative distribution (that started with the uniform distribution)

Again, if someone know what that limiting distribution is, I’d be glad to know !

Pareto models for risk management

Our paper, with Emmanuel Flachaire, “Pareto models for risk management” is now online…

The Pareto model is very popular in risk management, since simple analytical formulas can be derived for financial downside risk measures (Value-at-Risk, Expected Shortfall) or reinsurance premiums and related quantities (Large Claim Index, Return Period). Nevertheless, in practice, distributions are (strictly) Pareto only in the tails, above (possible very) large threshold. Therefore, it could be interesting to take into account second order behavior to provide a better fit. In this article, we present how to go from a strict Pareto model to Pareto-type distributions. We discuss inference, and derive formulas for various measures and indices, and finally provide applications on insurance losses and financial risks.

Des modeles prédictifs en assurance

Cet post est aussi en ligne sur, il a été coécrit avec Laurence Barry et Ewen Gallic.

Les compagnies d’assurance émettent des contrats qui prévoient des paiements d’indemnités en cas de survenance d’évènements aléatoires (accident, maladie, décès, etc.). En contrepartie, l’assuré doit s’acquitter d’une prime, dont le montant est déterminé ex-ante, avant le début de la période de couverture. Cette prime se décompose en deux termes : une prime pure (destinée à couvrir les pertes anticipées) et un chargement (incluant des commissions à des agents, divers frais, mais aussi couvrant contre le risque de variabilité des pertes). La prime pure est souvent calculée par classe de risque, et une classification est alors nécessaire.

Assurer une population hétérogène, ou l’importance de la classification

Le regroupement des risques selon diverses informations telles l’âge de l’assuré, son état de santé ou encore sa profession constitue ce que l’on appelle la classification des risques. Cette pratique de segmentation se justifie (à des fins d’admissibilité mais aussi de tarification) par la supposition que les risques sont placés dans des groupes relativement homogènes, au sein desquels les probabilités de survenance sont similaires. Pour Schauer (2006), cette « généralisation », qui vise à voir l’individu sous le prisme de sa classe de risque, de généraliser son comportement à partir de quelques variables explicatives, est probablement la raison d’être de l’actuaire : « to be an actuary is to be a specialist  in  generalization,  and  actuaries  engage  in  a form of decision-making that is sometimes called actuarial ». Statistiquement on cherche une méthode de classification aussi « discriminatoire » que possible[1], en gardant en mémoire que la discrimination est interdite, ce qui rend l’exercice périlleux, et souvent critiqué (nous y reviendrons plus loin).

Les assureurs évoquent souvent deux arguments pour justifier une segmentation. Le premier est qu’elle serait rendue économiquement nécessaire par la concurrence ; ne pas classifier conduit à une anti-sélection, les risques importants restant seuls chez les assureurs qui ne segmentent pas. Dans une telle situation, l’équilibre de marché ne serait pas possible puisque les risques faibles seraient chez un concurrent ayant segmenté. Si le facteur de risque était observable, tant par les assurés que les assureurs, il y aurait un phénomène d’auto-sélection, les assurés à risque faible ayant les polices les moins chères. Cette situation constitue un équilibre séparant de Nash. Mais si le facteur de risque n’est pas observable, un équilibre sous-optimal peut être atteint, résultant d’une externalité négative de cette information non-accessible, à la manière de Wilson (1977), tel que décrit dans Cummins et al. (1982) dans le cas des contrats d’assurance-vie. Cela dit, Kleindorfer & Kunreuther (1980) montrent qu’accéder à davantage d’information ne conduit pas nécessairement à une amélioration du bien-être des consommateurs. De plus si la classification n’est pas autorisée, l’équilibre est maintenu, les risques faibles subventionnant les risques élevés.

Le second argument avancé pour justifier une segmentation est que cette dernière (et le fait, par conséquent, d’ajuster les primes au risque) serait juste et équitable. Mais cette vision de l’équité n’a pas toujours été de mise et semble portée par les développements techniques. Ainsi la classification est devenue de plus en plus fine, multipliant les classes de risque et conduisant à des tarifs « personnalisés ». En plus des avancées statistiques, des facteurs économiques pourraient justifier cette sophistication : la concurrence de plus en plus forte sur certaines branches.

Incertitude en assurance

Il y a plusieurs manières de caractériser l’incertitude en assurance. Comme bien souvent quand on fait des prévisions, il convient de distinguer l’incertitude associée à l’estimation des probabilités et l’incertitude réelle sur le résultat (aléa de l’évènement). Pour la seconde notion, Hacking (1975) parle de probabilité structurelle, et c’est celle qui est souvent utilisée pour introduire les concepts de probabilité, par exemple avec des dés ou des jeux de cartes : les probabilités sont connues, seule l’issue du jeu est incertaine. Par exemple je sais que la probabilité d’avoir 6 en lançant un dé est 1/6 (compte tenu de la géométrie du cube).

D’un point de vue statistique, la probabilité se mesure quand on peut observer une fréquence, c’est-à-dire une répétition de risques semblables. Les statisticiens ont ainsi défini une notion de probabilité empirique, basée sur la répétition[2]. Si, en lançant mille dés j’obtiens 173 fois la face 6, la probabilité empirique d’avoir 6 est de 17,3%. La loi des grands nombres nous assure que cette fréquence va tendre vers la vraie valeur en répétant l’expérience, et le théorème central limite permet d’en contrôler les fluctuations. C’est la première incertitude dont nous parlions au début de cette section, que nous appellerions l’erreur d’estimation.

On peut enfin mentionner deux notions supplémentaires ; tout d’abord, les probabilités conditionnelles. Cette idée est introduite en assurance par de Moivre, ou de Witt, lorsqu’ils notaient que pour estimer une probabilité de décès, il fallait considérer des personnes de même âge. C’est cette idée que l’on retrouve quand on considère une classification : on veut des risques homogènes, similaires, sans être pour autant identiques. La probabilité que l’on obtient est alors conditionnelle à ce facteur commun qui caractérise la classe observée. Dans notre exemple des dés, cela revient à dire qu’il ne faut pas lancer mille dés, mais mille fois le même dé – ou à défaut des dés semblables.

Enfin, les probabilités subjectives ont été formalisées par Bruno de Finetti et Leonard Savage (ainsi que plus philosophiquement par Frank P. Ramsey) pour comprendre et modéliser la prise de décision. Elles sont relativement populaires en économie de l’incertain, mais difficile à mettre en œuvre dans un contexte de valorisation de contrats d’assurance automobile ou habitation. Il s’agit d’un jugement, qui ne peut être confronté à la réalité, mais envisageable pour l’assurance de risques encore mal connus (McGrayne (2012) évoque ainsi les premiers contrats d’assurance aviation). Une approche bayésienne consiste alors à combiner cette probabilité subjective avec la probabilité comme fréquence observée d’un phénomène : partant d’une croyance a priori, on affine l’estimation par une mise à jour progressive en répétant les expériences. Classiquement, la probabilité d’avoir la face 6 sera une moyenne entre notre croyance (1 chance sur 6) et une probabilité dite historique, obtenue en faisant quelques lancés (3 sur 20 lancers, par exemple). Les poids attribués aux deux dépendant du nombre d’expériences effectuées : on donnera plus de crédit à l’expérience si on fait mille lancés que si on en fait soixante.

Incertitude sur le résultat, ou aléa fondamental

Les probabilités prédictives, utilisées pour calculer la prime d’un contrat d’assurance, sont la première étape d’un problème de classification. Un outil classique pour juger de la pertinence d’un classifieur est la courbe ROC, décrite dans Kuhn (2018)) : on compare la probabilité individuelle (a priori, telle que résultant du modèle de classification) à un seuil, compris entre 0 et 1; si la probabilité est inférieure au seuil, l’estimation est que la personne survit, sinon qu’elle décède.

On compare ensuite cette estimation aux réalisations (ex-post) de survie et de décès. Pour chaque seuil, on peut considérer la matrice classique dite matrice de confusion de théorie de la décision : elle consiste à répartir les observations suivant le résultat observé (en colonne) et l’estimation résultant du modèle en ligne (en fonction de la probabilité estimée pour l’individu et le seuil que l’on s’est fixé). On peut ainsi partager la population entre les classements corrects, et les erreurs (dont les « faux positifs » si la personne a survécu malgré une probabilité estimée de décès supérieure au seuil, et les « faux négatifs » si la personne décède malgré une probabilité estimée inférieure au seuil).

Figure 1: Courbe ROC et classification pour un seuil de probabilité valant 1.5%.

La courbe ROC est obtenue en faisant varier le seuil. Chaque seuil correspond à un point de la courbe, rapportant graphiquement les taux de faux positifs (en abscisse) et de vrais positifs (en ordonnée), comme sur la Figure 1.

Considérons un groupe de 1000 assurés, où 20 personnes sont décédées l’an passé. Supposons un modèle dans lequel on admet que la population est parfaitement homogène, la probabilité estimée de décès est de 2% pour tout le monde. Dans ce cas pour tout seuil supérieur à 2%, on estimera que la totalité de la population survit : on aura un taux de faux positifs de 0% et un taux de vrais positifs de 0%, d’où un point (0,0) sur le graphe. A l’inverse pour tout seuil inférieur à 2%, on estimera que la totalité de la population décède : on aura un taux de faux positifs de 100% et un taux de vrais positifs de 100%, d’où un point (1,1) sur le graphe. La courbe de ROC de ce modèle uniforme à 2% est donc la diagonale du carré sur la figure 1.

Mais on peut aussi imaginer qu’il existe un peu d’hétérogénéité avec, par exemple, une probabilité de décès de 1% pour une moitié de la population et de 3% pour l’autre moitié, ou encore que le modèle produit des probabilités comprises entre 1% et 3% de façon non dichotomique. Les données simulées pour construire la courbe noire sur la Figure 1 suppose que la population a des probabilités de décès variables, comprises entre 1% et 3%, obtenues par une régression logistique. Comme le montre le tableau de droite, on commet des erreurs, et comme le montre celle de gauche, la nature de celle-ci varie en fonction du seuil choisi, qui modifie les taux de faux positifs et de faux négatifs.

Le cas extrême serait celui où le modèle aurait correctement attribué une probabilité de 100% aux 20 personnes qui sont effectivement décédées. C’est la courbe rouge sur la Figure 1. Ce partage est possible ex-post, une fois réalisation de l’aléa : a posteriori, il y a une certitude de décès pour ceux qui sont effectivement morts. Mais cela n’a cependant pas grande réalité dans l’assurance, à moins d’imaginer que l’actuaire serait un oracle, qui saurait avec certitude qui va mourir, et qui va survivre. La réalité est plutôt celle de la situation intermédiaire entre la courbe rouge et la diagonale, avant d’arriver dans la région hachurée, où le taux d’erreur est faible, mais pas nul : on ne peut pas prédire, avec certitude, qui va décéder. L’assurance n’est possible que si cette borne supérieure n’est pas trop élevée.

Incertitude statistique, données et modèles

Une question fondamentale pour la survie de l’assurance est de savoir où se situe cette borne supérieure : jusqu’où peut-on aller, entre les deux cas extrêmes (population homogène avec une probabilité de 2% pour tous, et une population très discriminée, avec 2% de la population ayant 100% de chances de mourir, et l’autre 0%) ? Et de quoi cette borne dépend-elle ? En particulier, des modèles plus complexes, tels que les réseaux de neurones très profonds permettent-ils vraiment d’améliorer la prévision ? Et l’enrichissement de données, tel qu’on l’observe grâce aux objets connectés et la fusion avec toutes sortes d’informations externes, va-t-il déplacer la borne supérieure vers le haut ?

Si l’apprentissage profond – voir Goodfellow et al. (2018) – permet d’avoir des classifieurs d’images avec un taux d’erreur proche de 0%, il est difficile d’imaginer qu’il sera possible de prévoir, presque un an à l’avance (à la signature du contrat), qui décèdera dans l’année, qui aura la grippe, qui aura un dégât des eaux, etc. Les modèles plus complexes permettent d’améliorer les prévisions, en tenant compte de non-linéarités, d’effets croisés entre les variables tarifaires, mais pas au point de faire disparaître l’aléa. Et tant que l’assurance est envisagée ex-ante (la prime est fixée au début de la période de couverture), il est difficile d’imaginer que rajouter de l’information fera aussi disparaître l’aléa. C’est d’ailleurs le cas pour les tests génétiques qui n’expliquent qu’une (petite) partie du risque de cancer, par exemple. Et rajouter des données revient souvent à rajouter du bruit, ce qui rend le travail d’analyse plus complexe. Cependant, force est de constater que des modèles plus complexes et des données plus riches tendent effectivement à « améliorer » la prévision, en remontant la courbe ROC vers le haut. Mais se pose-t-on les bonnes questions ? Que signifie vraiment une borne très éloignée du cas homogène, sur la diagonale ?

Homogénéité, équité et causalité

Comme nous l’avons vu, la tarification en assurance repose sur une répartition des risques (des contrats) en catégories, au sein desquelles la distribution des pertes peut être estimée, afin de fixer un niveau de primes. La répartition se fait à partir des caractéristiques de l’assuré, et du bien assuré. En retraçant l’histoire de l’assurance, Ewald (1986) montre que les mécanismes de prévoyance se sont mis en place en déplaçant la charge des accidents du travail sur la société : on abandonne l’idée d’une responsabilité individuelle de l’accident en faveur de la solidarité. L’assurance distingue « entre le dommage que subit tel ou tel individu — c’est affaire de chance ou de malchance — et la perte liée au dommage dont l’attribution est, quant à elle, toujours collective et sociale ». Ce principe de solidarité sociale, de mutualisation des risques, fait que le risque (en assurance) est toujours pensé collectivement.

Aujourd’hui, les tarifs sont considérés comme « justes », ou « actuariellement équitables » si chaque prime correspond à la perte attendue (pour ne pas dire « espérée », au sens mathématique) pour chaque assuré. Dans cette perception de l’équité, une hypothèse essentielle est que les classes soient « homogènes ». En effet, dans l’hypothèse inverse, les personnes les moins risquées subventionnent les personnes les plus risquées, ce qui est perçu comme socialement injuste.

On peut décrire cette version de l’équité actuarielle à l’aide de la formule de décomposition de la variance. La variance globale se décompose en effet en deux termes, la variance inter-classes et la variance intra-classes : l’ « équité actuarielle » vise à ce que  les classes de risque soient relativement distinctes les unes des autres, donc une variance inter-classes forte, accompagnée d’une homogénéité des classes, donc une variance intra-classes faible. D’un point de vue statistique, chercher à augmenter l’une est équivalente à faire diminuer l’autre. Cette mécanique n’est pas toujours claire pour des observateurs non avertis ; ainsi dans l’affaire Manhart, un des cas les plus documentés sur la discrimination par le genre en assurance, le juge Stevens affirme : « we focus on fairness to individuals rather than on fairness to classes […] even a true generalization about a class is an insufficient reason for disqualifying an individual to whom the generalization does not apply» (cité dans Anzalone (2016)). Autrement dit, pour la justice, un critère statistique de type « true generalization » ne peut être opposable à un individu.

Une autre critique importante, que l’on retrouve dans la « gender directive », est le lien entre discrimination et causalité. En effet, statistiquement, les actuaires vont chercher des facteurs de classification fortement corrélés avec la sinistralité. Mais il est possible que ces facteurs ne soient qu’un proxy de la vraie variable causale, restée elle inobservée, conduisant à une mauvaise estimation du risque pour certains. Comme le notent Antonio et Charpentier (2017), le genre a ainsi été longtemps utilisé en assurance automobile car très corrélé avec des variables associées au style de conduite et à d’autres variables historiquement non observables (mais qui le sont aujourd’hui grâce aux objets connectés, comme le kilométrage, les heures de conduites, les types de routes utilisés, etc).

Ce lien avec les mécanismes causaux est d’ailleurs relativement profond, et Hacking (1975) y voit une connexion avec la « révolution probabiliste » : on peut assez facilement mettre en évidence des corrélations, mais les causes, si elles existent, nous restent plus opaques. Laplace au début du 19e siècle déclare ainsi que « la probabilité est relative en partie à nos connaissances, en partie à notre ignorance », liant les probabilités à la fois à une vision newtonienne déterministe du monde et à notre incapacité à le connaitre parfaitement. Cette dernière composante fait que l’on ne peut pas annoncer la date exacte du décès d’un individu, mais statistiquement, dans un groupe homogène, on peut prédire le nombre de décès au cours d’une année. Et pour revenir à la relation causale, le tabagisme par exemple ne cause pas forcément une mort prématurée mais fumer sera vu comme dangereux car il augmente la probabilité de décès pendant une période donnée. Ainsi nous montre Hacking (1975), la causalité est pensée aujourd’hui dans un contexte probabiliste, et non plus déterministe.

Abraham, K.S. (1985) Efficiency and fairness in insurance risk classification, Virginia Law Review 71: 403-451.

Anderson, A.W. (1978). A Critique of the Manhart Brief. The Actuary, 12:5.

Antonio, K. & Charpentier, A. (2017). La tarification par genre en assurance, corrélation ou causalité ? Risques, 109.

Anzalone, C.A. (2016). U.S. Supreme Court Cases on Gender and Sexual Equality. Routledge.

Bailey, H., Hutchison, T. & Narber, G. (1975) The regulatory challenge to life insurance classification, Drake Law Review Insurance Law Annual 4: 779-827

Barry L. (2019). Justice ou justesse? L’équité de l’assurance. Working paper #15, chaire PARI.

Charpentier, A. & Denuit, M. (2004). Mathématiques de l’Assurance Non-Vie : Principes Généraux de Théorie du Risque. Economica.

Cramer, H. (1946). Mathematical Methods of Statistics. Princeton University Press.

Cummins, J.D., Smith, B.D., Vance, R.N. & VanDerhai, J.L. (1982). Risk Classification in Life Insurance. Kluwer-Nijhoff Publishing.

Ewald F. (1986). L’État providence. Grasset.

Fisher, R. A. (1936).  The Use of Multiple Measurements in Taxonomic Problems. Annals of Eugenics. 7 (2): 179–188.

Frézal, S. & Barry, L. (2019). Fairness in Uncertainty: Some Limits and Misinterpretations of Actuarial Fairness, Journal of Business Ethics.

Goodfellow, U., Bengio, Y. & Courville, A. (2018) L’apprentissage profond. Massot Edition.

Hacking, I. (1975) The Emergence of Probability. Cambridge University Press

Hoy, M. (1982) Categorizing risks in the insurance industry, The Quarterly Journal of Economics 97: 321-336.

Kleindorfer, P. & Kunreuther, H. (1980) Misinformation and Equilibrium in Insurance Markets, in Economic Analysis of Regulated Markets, Jörg Finsinger Editor, Springer Verlag, 67-90

Kuhn, M. & Johnson, K. (2018). Applied Predictive Modeling. Springer Verlag.

Martin,G.D. (1976) Gender Discrimination in Pension Plans, Journal of Risk and Insurance 43.

McGrayne, S.B. (2012) The Theory That Would Not Die: How Bayes’ Rule Cracked the Enigma Code, Hunted Down Russian Submarines, and Emerged Triumphant from Two Centuries of Controversy. Yale University Press.

Ramsey P.F. (1926). Truth and Probability.

Schauer, F. (2006) Profiles, Probabilities, and Stereotypes. Harvard University Press.

Von Mises, R. (1957). Probability, Statistics and Truth. Dover publications.

Wilson, C. (1977). A model of insurance markets with incomplete information. Journal of Economic Theory, 16:2, 167-207.

[1] Au sens statistique du mot, dans le sens introduit par Fisher (1936).

[2] Dans cette approche fréquentiste, et notamment pour Ronald Fisher et Richard von Mises, la probabilité d’un évènement unique (dit « one shot ») n’a pas de sens.

Big Data, GAFA et Assurance

Les sociétés technologiques et le monde de l’assurance auraient tout pour être opposé. Agilité, rapidité, obsession du futur chez les uns, conservatisme, réflexivité, fascination pour les données passées chez les autres. Et pourtant les deux s’observent, et commencent à nouer des partenariats, comprenant que la donnée est leur cœur de métier.

Continue reading Big Data, GAFA et Assurance

Foundations of Machine Learning, part 5

This post is the nineth (and probably last) one of our series on the history and foundations of econometric and machine learning models. The first fours were on econometrics techniques. Part 8 is online here.

Optimization and algorithmic aspects

In econometrics, (numerical) optimization became omnipresent as soon as we left the Gaussian model. We briefly mentioned it in the section on the exponential family, and the use of the Fisher score (gradient descent) to solve the first order condition \mathbf{X}^T W(\beta)^{-1})[y-\widehat{y}]=\mathbf{0}. In learning, optimization is the central tool. And it is necessary to have effective optimization algorithms, to solve problems (described previously) of the form: \widehat{\beta}\in\underset{\beta\in\mathbb{R}^p}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,\beta_0+\mathbf{x}^T\beta)+\lambda\Vert\boldsymbol{\beta}\Vert\right\rbraceIn some cases, instead of global optimization, it is sufficient to consider optimization by coordinates (widely studied in Daubechies et al. (2004)). If f:\mathbb{R}^d\rightarrow\mathbf{R} is convex and differentiable, if \mathbf{x} satisfies f(\mathbf{x}+h\boldsymbol{e}_i)\geq f(\mathbf{x}) for any h>0 and i\in\{1,\cdots, d\}then f(\mathbf{x})=\min\{f\}, where \mathbf{e}=(\mathbf{e}_i) is the canonical basis of \mathbb{R}^d. However, this property is not true in the non-differentiable case. But if we assume that the non-differentiable part is separable (additively), it becomes true again. More specifically, iff(\mathbf{x})=g(\mathbf{x})+\sum_{i=1}^d h_i(x_i)with\left\lbrace\begin{array}{l}g: \mathbb{R}^d\rightarrow\mathbb{R}\text{ convex-differentiable}\\h_i: \mathbb{R}\rightarrow\mathbb{R}\text{ convex}\end{array}\right.This was the case for Lasso regression, \beta)\mapsto\| \mathbf{y}-\beta_0-\mathbf{X}\beta\|_{\ell_2 }+\lambda\|\beta\|_{\ell_1}, as shown by Tsen (2001). Getting back to our initial notations, we can use a coordinate descent algorithm: from an initial value \mathbf{x}^{(0)}, we consider (by iterating)x_j^{(k)}\in\text{argmin}\big\lbrace f(x_1^{(k)},\cdots,x_{k-1}^{(k)},x_k,x_{k+1}^{(k-1)},\cdots,x_n^{(k-1)})\big\rbrace for j=1,2,\cdots,nThese algorithmic problems and numerical issues may seem secondary to econometricians. However, they are essential in automatic learning: a technique is interesting if there is a stable and fast algorithm, which allows to obtain a solution. These optimization techniques can be transposed: for example, this coordinate descent technique can be used in the case of SVM methods (known as “vector support” methods) when the space is not linearly separable, and the classification error must be penalized (we will come back to this technique in the next section).

In-sample, out-of-sample and cross-validation

These techniques seem intellectually interesting, but we have not yet discussed the choice of the penalty parameter \lambda. But this problem is actually more general, because comparing two parameters \widehat{\beta}_{\lambda_1} and \widehat{\beta}_{\lambda_2} is actually comparing two models. In particular, if we use a Lasso method, with different thresholds \lambda, we compare models that do not have the same dimension. Previously, we have addressed the problem of model comparison from an econometric perspective (by penalizing overly complex models). In the learning literature, judging the quality of a model on the data used to construct it does not make it possible to know how the model will behave on new data. This is the so-called “generalization” problem. The traditional approach then consists in separating the sample (size n) into two parts: a part that will be used to train the model (the training database, in-sample, size m) and a part that will be used to test the model (the testing database, out-of-sample, size n-m). The latter then makes it possible to measure a real predictive risk. Suppose that the data are generated by a linear model y_i=\mathbf{x}_i^T \beta_0+\varepsilon_i where \varepsilon_i are independent and centred law achievements. The empirical quadratic risk in-sample is here\frac{1}{m}\sum_{i=1}^m\mathbb{E}\big([\mathbf{x}_i^T \widehat{\beta}-\mathbf{x}_i^T \beta_0]^2\big)=\mathbb{E}\big([\mathbf{x}_i^T \widehat{\beta}-\mathbf{x}_i^T \beta_0]^2\big),for any observation i. Assuming the residuals \varepsilon Gaussian, then we can show that this risk is worth \sigma^2 \text{trace} (\Pi_X)/m is \sigma^2 p/m. On the other hand, the empirical out-of-sample quadratic risk is here \mathbb{E}\big([\mathbf{x}^T \widehat{\beta}-\mathbf{x}^T \beta_0]^2\big) where \mathbf{x} is a new observation, independent of the others. It can be noted that \mathbb{E}\big([\mathbf{x}^T \widehat{\beta}-\mathbf{x}^T \beta_0]^2\big\vert \mathbf{x}\big)=\text{Var}\big(\mathbf{x}^T \widehat{\beta}\big\vert \mathbf{x}\big)=\sigma^2\mathbf{x}^T(\mathbf{x}^T\mathbf{x})^{-1}\mathbf{x},and by integrating with respect to \mathbf{x}, \mathbb{E}\big([\mathbf{x}^T \widehat{\beta}-\mathbf{x}^T\beta_0]^2\big)=\sigma^2\text{trace}\big(\mathbb{E}[\mathbf{x}\mathbf{x}^T]\mathbb{E}\big[(\mathbf{x}^T\mathbf{x})^{-1}\big]\big).The expression is then different from that obtained in-sample, and using the Groves & Rothenberg (1969) increase, we can show that \mathbb{E}\big([\mathbf{x}^T \widehat{\beta}-\mathbf{x}^T \beta_0]^2\big) \geq \sigma^2\frac{p}{m}which is pretty intuitive, when we start thinking about it. Except in some simple cases, there is no simple (explicit) formula. Note, however, that if \mathbf{X}\sim\mathcal{N}(0,\sigma^2 \mathbb{I}), then \mathbf{x}^T \mathbf{x} follows a Wishart law, and it can be shown that \mathbb{E}\big([\mathbf{x}^T \widehat{\beta}-\mathbf{x}^T \beta_0]^2\big)=\sigma^2\frac{p}{m-p-1}.If we now look at the empirical version: if \widehat{\beta} is estimated on the first m observations,\widehat{\mathcal{R}}^{~\text{ IS}}=\sum_{i=1}^m [y_i-\boldsymbol{x}_i^T\widehat{\boldsymbol{\beta}}]^2\text{ and }\widehat{\mathcal{R}}^{\text{ OS}}=\sum_{i=m+1}^{n} [y_i-\boldsymbol{x}_i^T\widehat{\boldsymbol{\beta}}]^2and as Leeb (2008) noted, \widehat{\mathcal{R}}^{\text{IS}}-\widehat{\mathcal{R}}^{\text{OS}}\approx 2\cdot\nu where \nu represents the number of degrees of freedom, which is not unlike the penalty used in the Akaike test.

Figure 4 shows the respective evolution of \widehat{\mathcal{R}}^{\text{IS}} and \widehat{\mathcal{R}}^{\text{OS}} according to the complexity of the model (number of degrees in a polynomial regression, number of nodes in splines, etc). The more complex the model, the more \widehat{\mathcal{R}}^{\text{IS}} will decrease (this is the red curve, below). But that’s not what we’re interested in here: we want a model that predicts well on new data (i. e. out-of-sample). As Figure 4 shows, if the model is too simple, it does not predict well (as it does with in-sample data). But what we can see is that if the model is too complex, we are in a situation of “overlearning”: the model will start to model the noise. Of course, this figure should remind us of the one we’ve seen in our second post of that series

Figure 4 : Generalization, under- and over-fitting

Instead of splitting the database in two, with some of the data that will be used to calibrate the model and some to study its performance, it is also possible to use cross-validation. To present the general idea, we can go back to the “jackknife”, introduced by Quenouille (1949) (and formalized by Quenouille (1956) and Tukey (1958)) relatively used in statistics to reduce bias. Indeed, if we assume that \{y_1,\cdots,y_n\} is a sample drawn according to a law F_\theta, and that we have an estimator T_n (\mathbf{y})=T_n (y_1,\cdots,y_n), but that this estimator is biased, with \mathbf{E}[T_n (\mathbf{Y})]=\theta+O(n^{-1}), it is possible to reduce the bias by considering \widetilde{T}_n(\mathbf{y})=\frac{1}{n}\sum_{i=1}^n T_{n-1}(\mathbf{y}_{(i)})\text{ where }\mathbf{y}_{(i)}=(y_1,\cdots,y_{i-1},y_{i+1},\cdots,y_n)It can then be shown that \mathbb{E}[\tilde{T}_n(Y)]=\theta+O(n^{-2})The idea of cross-validation is based on the idea of building an estimator by removing an observation. Since we want to build a predictive model, we will compare the forecast obtained with the estimated model, and the missing observation\widehat{\mathcal{R}}^{\text{ CV}}=\frac{1}{n}\sum_{i=1}^n \ell(y_i,\widehat{m}_{(i)}(\mathbf{x}_i))We will speak here of the “leave-one-out” (loocv) method.

This technique reminds us of the traditional method used to find the optimal parameter in exponential smoothing methods for time series. In simple smoothing, we will construct a forecast from a time series as {}_t\widehat{y}_{t+1} =\alpha\cdot{}_{t-1}\widehat{y}_t +(1-\alpha)\cdot y_t, where \alpha\in[0,1], and we will consider as “optimal” \alpha^\star = \underset{\alpha\in[0,1]}{\text{argmin}}\left\lbrace \sum_{t=2}^T \ell({}_{t-1}\widehat{y}_{t},y_{t}) \right\rbraceas described by Hyndman et al (2009).

The main problem with the leave-one-out method is that it requires calibration of n models, which can be problematic in large dimensions. An alternative method is cross validation by k-blocks (called “k-fold cross validation”) which consists in using a partition of \{1,\cdots,n\} in k groups (or blocks) of the same size, \mathcal{I}_1,\cdots,\mathcal{I}_k, and let us note \mathcal{I}_{\bar j}=\{1,\cdots,n\}\setminus \mathcal{I}_j. By noting \widehat{m}_{(j)} built on the sample \mathcal{I}_{\bar j}, we then set:\widehat{\mathcal{R}}^{k-\text{ CV}}=\frac{1}{k}\sum_{j=1}^k \mathcal{R}_j\text{ where }\mathcal{R}_j=\frac{k}{n}\sum_{i\in\mathcal{I}_{{j}}} \ell(y_i,\widehat{m}_{(j)}(\mathbf{x}_i))Standard cross-validation, where only one observation is removed each time (loocv), is a special case, with k=n. Using k=5 or 10 has a double advantage over k=n: (1) the number of estimates to be made is much smaller, 5 or 10 rather than n; (2) the samples used for estimation are less similar and therefore less correlated to each other, which tends to avoid excess variance, as recalled by James et al. (2013).

Another alternative is to use boosted samples. Let \mathcal{I}_b be a sample of size n obtained by drawing with replacement in \{1,\cdots,n\} to know which observations (y_i,\mathbf{x}_i) will be kept in the learning population (at each draw). Note \mathcal{I}_{\bar b}=\{1,\cdots,n\}\setminus\mathcal{I}_b. By noting \widehat{m}_{(b)} built on sample \mathcal{I}_b, we then set :\widehat{\mathcal{R}}^{\text{ B}}=\frac{1}{B}\sum_{b=1}^B \mathcal{R}_b\text{ where }\mathcal{R}_b=\frac{n_{\overline{b}}}{n}\sum_{i\in\mathcal{I}_{\overline{b}}} \ell(y_i,\widehat{m}_{(b)}(\mathbf{x}_i))where n_{\bar b} is the number of observations that have not been kept in \mathcal{I}_b. It should be noted that with this technique, on average e^{-1}\sim36.7\% of the observations do not appear in the boosted sample, and we find an order of magnitude of the proportions used when creating a calibration sample, and a test sample. In fact, as Stone (1977) had shown, the minimization of AIC is to be compared to the cross-validation criterion, and Shao (1997) showed that the minimization of BIC corresponds to k-fold cross-validation, with k=n/\log n.

All those techniques here are mentioned in the “machine learning” section since they rely on automatic, computational techniques, and no probabilistic foundations are necessary. In many cases we did use the notation m^\star (at least in the first posts on “machine learning” techniques) to highlight the fact that we want some sort of “optimal” model – and to make a distinction with estimators \widehat{m} considered earlier, when we had some probabilistic framework. But of course, it is possible (and necessary) to build bridges between those two cultures…

References are online here. As explained in the introduction, it is some sort of online version of an introduction to our joint paper with Emmanuel Flachaire and Antoine Ly, Econometrics and Machine Learning (initially writen in French), that will actually appear soon in the journal Economics and Statistics (in English and in French).

Foundations of Machine Learning, part 4

This post is the eighth one of our series on the history and foundations of econometric and machine learning models. The first fours were on econometrics techniques. Part 7 is online here.

Penalization and variables selection

One important concept in econometrics is Ockham’s razor – also known as the law of parsimony (lex parsimoniae) – which can be related to abductive reasoning.

Akaike’s criterion was based on a penalty of likelihood taking into account the complexity of the model (the number of explanatory variables retained). If in econometrics, it is customary to maximize the likelihood (to build an asymptotically unbiased estimator), and to judge the quality of the ex-post model by penalizing the likelihood, the strategy here will be to penalize ex-ante in the objective function, even if it means building a biased estimator. Typically, we will build: (\widehat{\beta}_{0,\lambda},\widehat{\beta}_{\lambda})=\text{argmin}\left\lbrace\sum_{i=1}^n \ell(y_i,\beta_0+\mathbf{x}^T\beta)+\lambda \text{ penalization}( \boldsymbol{\beta})\right\rbrace, ~~~(11)where the penalty function will often be a norm \|\cdot\| chosen a priori, and a penalty parameter \lambda (we find in a way the distinction between AIC and BIC if the penalty function is the complexity of the model – the number of explanatory variables retained). In the case of the \ell_2 norm, we find the ridge estimator, and for the \ell_1 norm, we find the lasso estimator (“Least Absolute Shrinkage and Selection Operator”). The penalty previously used involved the number of degrees of freedom of the model, so it may seem surprising to use \|\beta\|_{\ell_2} as in the ridge regression. However, we can envisage a Bayesian vision of this penalty. It should be recalled that in a Bayesian model : \underbrace{\mathbb{P}[\boldsymbol{\theta}\vert\boldsymbol{y}]}_{\text{posterior}} \propto \underbrace{\mathbb{P}[\boldsymbol{y}\vert\boldsymbol{\theta}]}_{\text{likelihood}} \cdot \underbrace{\mathbb{P}[\boldsymbol{\theta}]}_{\text{prior}} or\log\mathbb{P}[\boldsymbol{\theta}\vert\boldsymbol{y}]= \underbrace{\log \mathbb{P}[\boldsymbol{y}\vert\boldsymbol{\theta}]}_{\text{log likelihood}} + \underbrace{\log\mathbb{P}[\boldsymbol{\theta}]}_{\text{{penalty}}}In a Gaussian linear model, if we assume that the a priori law of \theta follows a centred Gaussian distribution, we find a penalty based on a quadratic form of the components of \theta.

Before going back in detail to these two estimators, obtained using the \ell_1 or \ell_2 norm, let us return for a moment to a very similar problem: the best choice of explanatory variables. Classically (and this will be even more true in large dimension), we can have a large number of explanatory variables, p, but many are just noise, in the sense that \beta_j=0 for a large number of j. Let s be the number of (really) relevant covariates, s=\#S, with S=\{j=1,\cdots,p:\beta_j\neq 0\}. If we note \mathbf{X}_S the matrix composed of the relevant variables (in columns), then we assume that the real model is of the form y=\mathbf{x}_S^T \beta_S+\varepsilon. Intuitively, an interesting estimator would then be \widehat{\beta}_S=[\mathbf{X}_S^T \mathbf{X}_S ]^{-1} \mathbf{X}_S^T \mathbf{y}, but this estimator is only theoretical because the set S is unknown, here. This estimator can actually be seen as the oracle estimator mentioned above. One may then be tempted to solve (\widehat{\beta}_{0,s},\widehat{\beta}_{s})=\underset{\beta_S\in\mathbb{R}^s}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,\beta_0+\mathbf{x}^T\beta_S)\right\rbrace,\text{ s.t. } \# {S}=s This problem was introduced by Foster & George (1994) using the \ell_0 notation. More precisely, let us define here the following three norms, where \mathbf{a}\in\mathbb{R}^d, \Vert\boldsymbol{a} \Vert_{\ell_0}=\sum_{i=1}^d \mathbf{1}(a_i\neq 0), ~~ \Vert\mathbf{a} \Vert_{\ell_1}=\sum_{i=1}^d |a_i|~~\text{ and }~~\Vert\mathbf{a} \Vert_{\ell_2}=\left(\sum_{i=1}^d a_i^2\right)^{1/2}

Table 1: Constrained optimization and regularization.

Let us consider the optimization problems in Table 1. If we consider the classical problem where the quadratic norm is used for \ell, the two problems of the equation (\ell1) of Table 1 are equivalent, in the sense that, for any solution (\beta^\star,s) to the left problem, there is \lambda^\star such that (\beta^\star,\lambda^\star) is the solution of the right problem; and vice versa. The result is also true for problems(\ell2). These are indeed convex problems. On the other hand, the two problems (\ell0) are not equivalent: if for (\beta^\star,\lambda^\star) solution of the right problem, there is s^\star such that \beta^\star is solution of the left problem, the reverse is not true. More generally, if you want to use an \ell_p norm, sparsity is obtained if p\leq 1 whereas you need p\geq1 to have the convexity of the optimization program.

One may be tempted to resolve the penalized program (\ell0) directly, as suggested by Foster & George (1994). Numerically, it is a complex combinatorial problem in large dimension (Natarajan (1995) notes that it is a NP-difficult problem), but it is possible to show that if \lambda\sim\sigma^2 \log(p), then \mathbb{E}\big([\mathbf{x}^T \widehat{\beta}-\mathbf{x}^T \beta_0]^2\big) \leq \underbrace{\mathbb{E}\big(\mathbf{x}_{ {S}}^T\widehat{\beta}_{{S}}-\mathbf{x}^T \beta_0]^2\big)}_{=\sigma^2 \#{S}}\cdot \big(4\log p+2+o(1)\big) Observe that in this case \widehat{\beta}_{\lambda,j}^{\text{sub}} = \left\lbrace\begin{array}{l}0 \text{ if } j\notin{S}_\lambda(\beta)\\ \widehat{\beta}_{j}^{\text{ols}} \text{ if } j\in{S}_\lambda(\beta),\end{array}\right. where S_\lambda (\beta) refers to all non-zero coordinates when solving (\ell0).

The problem (\ell2) is strictly convex if \ell is the quadratic norm, in other words, the Ridge estimator is always well defined, with in addition an explicit form for the estimator, \widehat{ {\beta}}_\lambda^{\text{ ridge}}=(\mathbf{X}^T\mathbf{X}+\lambda\mathbb{I})^{-1}\mathbf{X}^T\mathbf{y}=(\mathbf{X}^T\mathbf{X}+\lambda\mathbb{I})^{-1}(\mathbf{X}^T\mathbf{X})\widehat{ {\beta}}^{\text{ ols}} Therefore, it can be deduced that \text{bias}[\widehat{ {\beta}}_\lambda^{\text{ ridge}}]=-\lambda[\mathbf{X}^T\mathbf{X}+\lambda\mathbb{I}]^{-1}~\widehat{ {\beta}}^{\text{ ols}} and\text{Var}[\widehat{\beta}_\lambda^{\text{ ridge}}]=\sigma^2[\mathbf{X}^T\mathbf{X}+\lambda\mathbb{I}]^{-1}\mathbf{X}^T\mathbf{X}[\mathbf{X}^T\mathbf{X}+\lambda\mathbb{I}]^{-1}With a matrix of orthonormal explanatory variables (i.e. \mathbf{X}^T \mathbf{X}=\mathbb{I}), the expressions can be simplified \text{bias}[\widehat{ {\beta}}_\lambda^{\text{ ridge}}]=\frac{\lambda}{1+\lambda}~\widehat{ {\beta}}^{\text{ ols}}\text{ and }\text{Var}[\widehat{ {\beta}}_\lambda^{\text{ ridge}}]=\frac{\sigma^2}{(1+\lambda)^2}\mathbb{I} Observe that \text{Var}[\widehat{ {\beta}}_\lambda^{\text{ ridge}}]<\text{Var}[\widehat{ {\beta}}^{\text{ ols}}]. And because  \text{mse}[\widehat{ {\beta}}_\lambda^{\text{ ridge}}]=\frac{p\sigma^2}{(1+\lambda)^2}+\frac{\lambda^2}{(1+\lambda)^2}\beta^T\beta we obtain an optimal value for \lambda: \lambda^\star=k\sigma^2/\beta^T\beta

On the other hand, if \ell is no longer the quadratic norm but the \ell_1 norm, the problem (\ell1) is not always strictly convex, and in particular, the optimum is not always unique (for example if \mathbf{X}^T \mathbf{X} is singular). But if it is strictly convex, then predictions \mathbf{X}\beta will be unique. It should also be noted that two solutions are necessarily consistent in terms of sign of coefficients: it is not possible to have \beta_j<0 for one solution and \beta_j>0 for another. From a heuristic point of view, the program (\ell1) is interesting because it allows to obtain in many cases a corner solution, which corresponds to a problem resolution of type (\ell0) – as shown visually on Figure 2.

Figure 2 : Penalization based on norms \ell_0, \ell_1 and \ell_2 (from Hastie et al. (2016)).

Let us consider a very simple model: y_i=x_i \beta+\varepsilon, with a penalty \ell_1 and a loss function \ell_2. The problem (\ell1) then becomes  \min\big\{\mathbf{y}^T\mathbf{y}-2\mathbf{y}^T\mathbf{x}\beta+\beta\mathbf{x}^T\mathbf{x}\beta+2\lambda|\beta|\big\} The first order condition is then -2\mathbf{y}^T\mathbf{x} + 2\mathbf{x}^T\mathbf{x}\widehat{\beta}\pm 2\lambda=0And the sign of the last term depends on the sign of \beta. Suppose that the least square estimator (obtained by setting \lambda=0) is (strictly) positive, i. e. \mathbf{y}^T \mathbf{x}>0. If \lambda is not too big, we can imagine that \beta is of the same sign as \widehat{\beta}^{\text{mco}}, and therefore the condition becomes -2\mathbf{y}^T \mathbf{x}+2\mathbf{x}^T \mathbf{x}\beta+2\lambda=0, and the solution is \widehat{\beta}_{\lambda}^{\text{ lasso}}=\frac{\mathbf{y}^T\mathbf{x}-\lambda}{\mathbf{x}^T\mathbf{x}} By increasing \lambda, there will be a time such that \widehat{\beta}_λ=0. If we increase \lambda a bit little more, \widehat{\beta}_λ does not become negative because in this case the last term of the first order condition changes, and in this case we try to solve -2\mathbf{y}^T\mathbf{x} + 2\mathbf{x}^T\mathbf{x}\widehat{\beta}- 2\lambda=0 whose solution is then \widehat{\beta}_{\lambda}^{\text{ lasso}}=\frac{\mathbf{y}^T\mathbf{x}+\lambda}{\mathbf{x}^T\mathbf{x}}But this solution is positive (we assumed \mathbf{y}^T \mathbf{x}>0), and so it is possible to have \widehat{\beta}_\lambda <0at the same time. Also, after a while, \widehat{\beta}_\lambda=0, which is then a corner solution. Things are of course more complicated in larger dimensions (Tibshirani & Wasserman (2016) goes back at length on the geometry of the solutions) but as Candès & Plan (2009) notes, under minimal assumptions guaranteeing that the predictors are not strongly correlated, the Lasso obtains a quadratic error almost as good as if we had an oracle providing perfect information on the set of \beta_j‘s that are not zero. With some additional technical hypotheses, it can be shown that this estimator is “sparsistant” in the sense that the support of \widehat{\beta}_\lambda^{\text{lasso}} is that of \beta, in other words Lasso has made it possible to select variables (more discussions on this point can be obtained in Hastie et al. (2016)).

More generally, it can be shown that \widehat{\beta}_\lambda^{\text{lasso}} is a biased estimator, but may be of sufficiently low variance that the mean square error is lower than using least squares. To compare the three techniques, relative to the least square estimator (obtained when \lambda=0), if we assume that the explanatory variables are orthonormal, then \widehat{\beta}_{\lambda,j}^{\text{ subset}}=\widehat{\beta}_{j}^{\text{ ols}}\boldsymbol{1}_{|\widehat{\beta}_{\lambda,j}^{\text{ subset}}|>b}, ~~\widehat{\beta}_{\lambda,j}^{\text{ ridge}}=\frac{\widehat{\beta}_{j}^{\text{ ols}}}{1+\lambda}and\widehat{\beta}_{\lambda,j}^{\text{ lasso}}=\text{sign}[\widehat{\beta}_{j}^{\text{ ols}}]\cdot(|\widehat{\beta}_{j}^{\text{ ols}}|-\lambda)_+

Figure 3 : Penalization based on norms ,  and  (from Hastie et al. (2016)).

To be continued with probably a final post this week (references are online here)…

Foundations of Machine Learning, part 3

This post is the seventh one of our series on the history and foundations of econometric and machine learning models. The first fours were on econometrics techniques. Part 6 is online here.

Boosting and sequential learning

As we have seen before, modelling here is based on solving an optimization problem, and solving the problem described by equation (6) is all the more complex because the functional space \mathcal{M} is large. The idea of boosting, as introduced by Shapire & Freund (2012), is to learn, slowly, from the errors of the model, in an iterative way. In the first step, we estimate a model m_1 for y, from \mathbf{X}, which will give an error \varepsilon_1. In the second step, we estimate a model m_2 for \varepsilon_1, from X, which will give an error \varepsilon_2, etc. We will then retain as a model, after k iterations m^{(k)}(\cdot)=\underbrace{m_1(\cdot)}_{\sim y}+\underbrace{m_2(\cdot)}_{\sim \epsilon_1}+\underbrace{m_3(\cdot)}_{\sim \epsilon_2}+\cdots+\underbrace{m_k(\cdot)}_{\sim \epsilon_{k-1}}=m^{(k-1)}(\cdot)+m_k(\cdot)~~~(7)Here, the error \varepsilon is seen as the difference between y and the model m(\mathbf{x}), but it can also be seen as the gradient associated with the quadratic loss function. Formally, \varepsilon can be seen as \nabla\ell in a more general context (here we find an interpretation that reminds us of residuals in generalized linear models).

Equation (7) can be seen as a descent of the gradient, but written in a dual way. The problem will then be rewritten as an optimization problem: m^{(k)}=m^{(k-1)}+\underset{h\in\mathcal{H}}{\text{argmin}}\left\lbrace \sum_{i=1}^n \ell(\underbrace{y_i-m^{(k-1)}(\boldsymbol{x}_i)}_{\varepsilon_{k,i}},h(\boldsymbol{x}_i))\right\rbrace~~~(8)where the trick is to consider a relatively simple space \mathcal{H} (we will speak of “weak learner”). Classically, \mathcal{H} functions are step-functions (which will be found in classification and regression trees) called “stumps”. To ensure that learning is indeed slow, it is not uncommon to use a shrinkage parameter, and instead of setting, for example, \varepsilon_1=y-m_1 (\mathbf{x}), we will set \varepsilon_1=y-\alpha\cdot m_1 (\mathbf{x}) with \alpha\in[0.1]. It should be noted that it is because a non-linear space is used for \mathcal{H}, and learning is slow, that this algorithm works well. In the case of the Gaussian linear model, remember that the residuals \varepsilon=y-\mathbf{x}^T\beta are orthogonal to the explanatory variables, \mathbf{X}, and it is then impossible to learn from our errors. The main difficulty is to stop in time, because after too many iterations, it is no longer the m function that is approximated, but the noise. This problem is called overlearning.

This presentation has the advantage of having a heuristic reminiscent of an econometric model, by iteratively modelling the residuals by a (very) simple model. But this is often not the presentation used in the learning literature, which places more emphasis on an optimization algorithm heuristic (and gradient approximation). The function is learned iteratively, starting from a constant value, m^{(0)}=\underset{m\in\mathbb{R}}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,m)\right\rbracethen we consider the following learning procedure{\displaystyle m^{(k)}=m^{(k-1)}+{\underset{h\in {\mathcal {H}}}{\text{argmin}}}\sum _{i=1}^{n}\ell(y_{i},m^{(k-1)}(\mathbf{x}_{i})+h(\mathbf{x}_{i}))}~~~(9)which can be written, if \mathcal{H} is a set of differentiable functions, {\displaystyle m^{(k)}=m^{(k-1)}-\gamma_{k}\sum _{i=1}^{n}\nabla _{m^{(k-1)}}\ell(y_{i},m^{(k-1)}(\mathbf{x}_{i})),} where {\displaystyle \gamma _{k}=\underset{\gamma }{\text{argmin }}\sum _{i=1}^{n}\ell\left(y_{i},m^{(k-1)}( \mathbf{x}_{i})-\gamma \nabla _{m^{(k-1)}}\ell(y_{i},m^{(k-1)}( \mathbf{x}_{i}))\right).} To better understand the relationship with the approach described above, at step k, pseudo-residuals are defined by setting r_{i,k}=-\left.\frac{\partial \ell(y_i,m(\mathbf{x}_i))}{\partial m(\mathbf{x}_i)}\right\vert_{m(\mathbf{x})=m^{(k-1)}( \mathbf{x})}\text{ where }i=1,\cdots,nA simple model is then sought to explain these pseudo-residuals according to the explanatory variables \mathbf{x}_i, i.e. r_{i,k}=h^\star(\mathbf{x}_i) , where h^\star\in\mathcal{H}. In a second step, we look for an optimal multiplier by solving\gamma_k = \underset{\gamma\in\mathbb{R}}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,m^{(k-1)}( \mathbf{x}_i)+\gamma h^\star(\mathbf{x}_i))\right\rbrace then update the model by setting m_k (\cdot)=m_(k-1) (\cdot)+\gamma_k h^\star (\cdot) . More formally, we move from equation (8) – which clearly shows that we are building a model on residuals – to equation (9) – which will then be translated as a gradient calculation problem – noting that \ell(y,m+h)=\ell(y-m,h) . Classically, class \mathcal{H} of functions consists in regression trees. It is also possible to use a form of penalty by setting m_k (\cdot)=m_(k-1) (\cdot)+\nu\gamma_k h^\star (\cdot) , with \nu\in(0,1) . But let’s go back  a little further – in our next post – on the importance of penalization before discussing the numerical aspects of optimization.

To be continued (keep in mind that references are online here)…

Foundations of Machine Learning, part 2

This post is the sixth one of our series on the history and foundations of econometric and machine learning models. The first fours were on econometrics techniques. Part 5 is online here.

The probabilistic formalism in the 80’s

We have a training sample, with observations (\mathbf{x}_i,y_i) where the variables y are in a set \mathcal{Y}. In the case of classification, \mathcal{Y}=\{-1,+1\}, but a relatively general set can be considered (note that if econometricians prefer \mathcal{Y}=\{0,1\} – because of the Bernoulli distribution and because 0 and 1 are lower and upper bounds of probabilities, people in the “machine learning” community prefer \mathcal{Y}=\{-1,+1\}). A predictor m is an function taking values in \mathcal{Y}, used to label (or classify) future new observations, using some features that lie in a set \mathcal{X}. It is assumed that the labels are produced by an (unknown) classifier f called target. For a statistician, this function would be the real model. Naturally, we want to build m as close as possible to f. Let \mathbb{P} be a (unknown) distribution on \mathcal{X}. The error of m with respect to target f is defined by \mathcal{R}_{\mathbb{P},f}(m)=\mathbb{P}[m(\boldsymbol{X})\neq f(\boldsymbol{X})]\text{ where }\boldsymbol{X}\sim\mathbb{P}or equivalently,\mathcal{R}_{\mathbb{P},f}(m)=\mathbb{P}\big[\{\boldsymbol{x}\in\mathcal{X}:m(\boldsymbol{x})\neq f(\boldsymbol{x})\}\big]To obtain our “optimal” classifier, it becomes necessary to assume that there is a link between the data in our sample and the pair (\mathbb{P},f) , i.e. a data generation model. We will then assume that the \mathbf{x}_i are obtained by independent draws according to \mathbb{P}, and that then y_i=f(\mathbf{x}_i) . We can define the empirical risk of a classifier m, as \widehat{{R}}(m)=\frac{1}{n}\sum_{i=1}^n \boldsymbol{1}(m(\boldsymbol{x}_i)\neq y_i)

It is important to recognize that a perfect model cannot be found, in the sense that R_{\mathbb{P},f} (m)=0. Indeed, if we consider the simplest case, with \mathcal{X}=\{x_1,x_2\} and \mathbb{P} is such that \mathbb{P}(\{x_1\})=p and \mathbb{P}(\{x_2\})=1-p. The probability of never observing \{x_2\} among the n observations is (1-p)^n, and if p<1/n, it is quite likely never to observe \{x_2\} so it can never be predicted. We cannot therefore hope to have a zero risk whatever \mathbb{P}. And more generally, it is also possible to observe \{x_1\} and \{x_2\}, and despite everything, to make mistakes on the labels. Also, instead of looking for a perfect model, we can try to have an “approximately correct” model. We will then try to find m such that R_{\mathbb{P},f} (m)\leq\varepsilon, where \varepsilon is an a priori specified threshold. But even this condition is too strong, and cannot be fulfilled. Thus, we will usually as to have R_{\mathbb{P},f} (m)\leq\varepsilon with some probability 1-\delta. Hence, we will try to be “probably approximately correct” (PAC), allowing to make a mistake with a probability \delta, again fixed a priori.

Also, when we build a classifier, we do not know either \mathbb{P} or f, but we give ourselves a precision criterion \varepsilon , and a confidence parameter \delta, and we have n observations. Note that n, \varepsilon and \delta can be linked. We then look for a model m such that R_{\mathbb{P},f} (m)\leq\varepsilon with probability (at least) 1-\delta, so that we are probably approximately correct. Wolpert (1996) has shown (see details in Wolpert & Macready (1997)) that there is no universal learning algorithm. In particular, it can be shown that there is \mathbb{P} such that R_{\mathbb{P},f} (m) is relatively high, with a relatively high probability (also).

The interpretation is that since we cannot learn (in the PAC sense) about all the functions m, we will then force m to belong to a particular class, noted \mathcal{M}. Let us suppose, to start with, that \mathcal{M} contains a finite number of possible models. We can then show that for all \varepsilon and \delta, that for all \mathbb{P} and f, if we have enough observations (more precisely n\geq \varepsilon^{-1} \log[\delta^{-1} |\mathcal{M}|], then with a greater probability than 1-\delta, R_{\mathbb{P},f} (m^\star)\leq\varepsilon where m^\star \in \underset{m\in\mathcal{M}}{\text{argmin}}\Big\lbrace\frac{1}{n}\sum_{i=1}^n \boldsymbol{1}(m(\boldsymbol{x}_i)\neq y_i)\Big\rbracein other words m^\star is a model in \mathcal{M} that minimizes empirical risk.

We can go a little further, staying in the case where \mathcal{Y}=\{-1,+1\}. An \mathcal{M} class of classifiers will be called PAC-learnable if there is n_M:[0,1]^2\rightarrow \mathbb{N} such that, for all \varepsilon, \delta, \mathbb{P} and if it is assumed that the target f belongs to \mathcal{M}, then using n>n_M (\varepsilon,\delta) observations \mathbf{x}_i drawn from \mathbb{P}, labelled y_i by f, then there is m\in\mathcal{M} such that, with probability 1-\delta, R_{\mathbb{P},f} (m)\leq\varepsilon. The n_M function is then called “sample complexity to learn”. In particular, we have seen that if M contains a finite number of classifiers, then \mathcal{M} is PAC-learnable with complexity n_M (\varepsilon,\delta)=\varepsilon^{-1} \log[\delta^{-1} |M|].

Naturally, we would like to have a more general result, especially if \mathcal{M} is not finite. To do this, the VC dimension of Vapnik-Chervonenkis must be used, which is based on the idea of shattering points (for a binary classification). Consider k points \{x_1,\cdot,x_k\}, and consider the set {E}_k=\big\lbrace(m(\boldsymbol{x}_1),\cdots,m(\boldsymbol{x}_k))\text{ for }m\in\mathcal{M})\big\rbrace Note that the elements of E_k belong to \{-1,+1\}^k. In other words, |E_k |\leq 2^k. We will say that M shatter all the points if all the combinations are possible, i. e. |E_k |=2^k. Intuitively, the labels of the set of points do not provide enough information on target f, because anything is possible. The VC dimension of \mathcal{M} is then VC(\mathcal{M})=\sup\big\lbrace k\text{ such that }\mathcal{M}\text{ shatters }\{\boldsymbol{x}_1,\cdots\boldsymbol{x}_k\}\big\rbrace

For example, if \mathcal{X}=\mathbb{R} and all (simple) models of the form [1] m_{a,b}=\mathbf{1}_{\pm}(x\in[a,b]) are considered. No set of \{x_1,x_2,x_2,x_3\} ordered points can be shattered because it is sufficient to assign respectively +1, -1 and +1 to x_1, x_2 and x_3 respectively, therefore VC<3. On the other hand \{0,1\} is shattered, so VC\geq 2. The dimension of this predictor set is 2: If we increase by one dimension, \mathcal{X}=\mathbb{R}^2 and consider all (simple) models of the form m_{a,b}=\mathbf{1}_{\pm} (x\in[a,b]) (where [a,b] refers to the rectangle), then the dimension of \mathcal{M} is here 4.

To introduce SVMs, let’s place ourselves in the case where \mathcal{X}=\mathbb{R}^k, and consider separations by hyperplanes passing through the origin (we will say homogeneous), in the sense that m_{\mathbf{w}} (\mathbf{x})=\mathbf{1}_{\pm}(\mathbf{w}^T \mathbf{x}\geq 0) . It can be shown that no set of k+1 points can be shattered by these two homogeneous spaces in \mathbb{R}^k, and therefore VC(M)=k. If we add a constant, in the sense that m_{\mathbf{w},b} (\mathbf{x})=\mathbf{1}_{\pm}(\mathbf{w}^T \mathbf{x}+b\geq 0), we can show that no set of k+2 points can be sprayed by these two (non-homogeneous) spaces in \mathbb{R}^k, and therefore VC(M)=k+1. This dimension reminds us of the dimension of the model we’ve seen in the econometric context.

From this dimension VC, we deduce the so-called fundamental theorem of learning: if \mathcal{M} is a class of dimension d=VC(M) , then there are positive constants \underline{C} and \overline{C} such as the sample complexity for M to be PAC-learnable satisfies \underline{C}\epsilon^{-1}\big(d+\log[\delta^{-1}]\big)\leq n_{\mathcal{M}}(\epsilon,\delta) \leq \overline{C}\epsilon^{-1}\big(d\log[\epsilon^{-1}]+\log[\delta^{-1}]\big)The link between the notion of learning (as defined in Vailiant (1984)) and the VC dimension was clearly established in Blumer et al (1989).

Nevertheless, while the work of Vapnik and Chervonenkis is considered to be the foundation of statistical learning, Thomas Cover’s work in the 1960s and 1970s should also be mentioned, in particular Cover (1965) on the capacities of linear models, and Cover & Hart (1967) on learning in the context of the algorithm of the k-nearest neighbors. These studies have linked learning, information theory (with the textbook Cover & Thomas (1991)), complexity and statistics. Other authors have subsequently brought the two communities closer together, in terms of learning and statistics. For example, Halbert White proposed to see neural networks in a statistical context in White (1989), going so far as to state that « learning procedures used to train artificial neural networks are inherently statistical techniques. It follows that statistical theory can provide considerable insight into the properties, advantages, and disadvantages of different network learning methods ». This turning point in the late 1980s will anchor learning theory in a probabilistic context.

Objective and loss function

These choices (of objective and loss function) are essential, and very dependent on the problem under consideration. Let us begin by describing a historically important model, Rosenblatt’s (1958) “perceptron”, introduced into classification problems, where y\in\{-1,+1\}, inspired by McCulloch & Pitts (1943). We have data \{(y_i,\mathbf{x}_i)\}, and we will iteratively build a set of m_k[\mathbf{x} models, where at each step, we will learn from the errors of the previous model. In the perceptron, a linear model is considered so that :m(\mathbf{x})=\boldsymbol{1}_{\pm}(\beta_0+\mathbf{x}^T \boldsymbol{\beta}\geq 0)=\left\lbrace\begin{array}{l}+1\text{ si }\beta_0+\mathbf{x}^T \boldsymbol{\beta}\geq 0\\-1\text{ si }\beta_0+\mathbf{x}^T \boldsymbol{\beta}< 0\end{array}\right.where \beta coefficients are often interpreted as “weights” assigned to each of the explanatory variables. We give ourselves initial weights (\beta_0^{(0)},\beta^{(0)} , which we will update taking into account the prediction error made, between y_i and the prediction \widehat{y}_i^{(k)} :\widehat{y}_i^{(k)}=m^{(k)}(\mathbf{x}_i)=\boldsymbol{1}_{\pm}(\beta_0^{(k)}+\mathbf{x}^T \boldsymbol{\beta}^{(k)}\geq 0), with, in the case of the perceptron:\beta_j^{(k+1)}={\beta}_j^{(k)}+\eta\underbrace{(\mathbf{y}-\widehat{\mathbf{y}}^{(k)})^T}_{=\ell({\mathbf{y}},\widehat{\mathbf{y}}^{(k)})}\mathbf{x}_jHere \ell(y,y')=\mathbf{1}(y\neq y') is a loss function, which will allow to give a price to an error made, by predicting \widehat{y}=m(\mathbf{x}) and observing y. For a regression problem, we can consider a quadratic error \ell_2, such that \ell(y,m(\mathbf{x}))=(y-m(\mathbf{x}))^2 or in absolute value \ell_1, with \ell(y,m(\mathbf{x}))=|y-m(\mathbf{x})|. Here, for our classification problem, we used a mis-qualification indicator (we could discuss the symmetry of this loss function, suggesting that a false positive costs as much as a false negative). Once this loss function has been specified, we recognize in the problem previously described a gradient descent, and we see that we are trying to solve:m^\star(\mathbf{x})=\underset{m\in\mathcal{M}}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,m(\mathbf{x}_i))\right\rbrace~~~(6)for a predefined set of predictors \mathcal{M}. Any machine learning problem is mathematically formulated as an optimization problem, whose solution determines a set of model parameters (if the \mathcal{M} family is described by a set of parameters – which can be coordinates in a functional database). We can note \mathcal{M}_0 the space of the hyperplanes of \mathbb{R}^p in the sense thatm\in\mathcal{M}_0 \text{\quad means \quad}m(\mathbf{x})=\beta_0+\beta^T\mathbf{x}\text{ where }\beta\in\mathbb{R}^p generating the class of linear predictors. We will then have the estimator that minimizes the empirical risk. Some of the recent work in statistical learning aims to study the properties of the estimator \widehat{m}^\star, known as “oracle”, in a family of \mathcal{M} estimators, \widehat{m}^{\star} =\underset{\widehat{m}\in\mathcal{M}}{\text{argmin}}\big\lbrace\mathcal{R}(\widehat{m},m)\big\rbraceThis estimator is, of course, impossible to define because it depends on m, the real model, unknown.

But let’s come back a little more to these loss functions. A loss function \ell is a function \mathbb{R}^d\times\mathbb{R}^d\rightarrow\mathbb{R}_+, symmetric, which checks the triangular inequality, and such that \ell(x,y)=0 if and only if x=y. The associated norm is \|\cdot\|, such that \ell(x,y)=\|x-y\|=\ell(x-y,0) (using the fact that \ell(x,y+z)=\ell(x-y,z) – we will review this fundamental property later).

For a quadratic loss function, it should be noted that we can have a particular interpretation of this problem, since:\overline{y}=\underset{m\in\mathbb{R}}{\text{argmin}} \left\lbrace\sum_{i=1}^n\frac{1}{n} [y_i-m]^2\right\rbrace=\underset{m\in\mathbb{R}}{\text{argmin}} \left\lbrace \sum_{i=1}^n \ell_2(y_i,m)\right\rbrace where \ell_2 is the usual quadratic distance If we assume – as we did in econometrics – that there is an underlying probabilistic model, and observe that : \displaystyle{\mathbb{E}(Y)=\underset{m\in\mathbb{R}}{\text{argmin}}\left\lbrace\mathbb{E}\left([Y-m]^2\right)\right\rbrace=\underset{m\in\mathbb{R}}{\text{argmin}}\left\lbrace\mathbb{E}\big[\ell_2(Y,m)\big]\right\rbrace}it should be noted that what we are trying to obtain here, by solving the problem (6) by taking the norm \ell_2, is an approximation (in a given functional space, \mathcal{M}) of the conditional expectation x\mapsto\mathbb{E}[Y|\mathbf{X}=\mathbf{x}]. Another particularly interesting loss function is the loss \ell_1, \ell_1 (y,m)=|y-m|[\latex]. It should be recalled that [latex display="true"]\displaystyle{\text{median}(\boldsymbol{y})=\underset{m\in\mathbb{R}}{\text{argmin}}\left\lbrace\sum_{i=1}^n\ell_1(y_i,m)\right\rbrace}The optimization problem :\widehat{m}^{\star}=\underset{m\in\mathcal{M}_0}{\text{argmin}}\left\lbrace\sum_{i=1}^n\vert y_i-m(\mathbf{x}_i)\vert\right\rbrace is obtained in econometrics by assuming that the conditional law of Y follows a Laplace law centered on m(\mathbf{x}), and by maximizing the likelihood (log) (the sum of the absolute values of the errors corresponds to the log-reasonableness of a Laplace law). It should also be noted that if the conditional law of Y is symmetrical with respect to 0, the median and the mean coincide If this loss function is rewritten   \ell_1(y,m)=\vert (y-m)(1/2-\boldsymbol{1}_{y\leq m})\vert a generalization can be obtained for \tau\in[0.1]:\widehat{m}^\star_\tau=\underset{m\in\mathcal{M}_0}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell_\tau^{ q} (y_i,m(\mathbf{x}_i)) \right\rbracewhere\ell_{\tau}^{q}(x,y)= (x-y)(\tau-\boldsymbol{1}_{x\leq y})  is then the quantile regression of level \tau (Koenker, 2003; d'Haultefœuille & Givord, 2014). Another loss function, introduced by Aigner et al (1977) and analysed in Waltrup et al (2014), is the function associated with the notion of expectations: \displaystyle{\ell}^{\text{ e}}_{\tau}(x,y)= (x-y)^2\cdot\big\vert\tau-\boldsymbol{1}_{x\leq y}\big\vertwith \tau\in[0.1]. We see the parallel with the quantile function: \displaystyle{\ell}^{\text{ q}}_{\tau}(x,y)= \vert x-y\vert \cdot\big\vert\tau-\boldsymbol{1}_{x\leq y}\big\vertKoenker & Machado (1999) and Yu & Moyeed (2001) also noted a link between this condition and the search for maximum likelihood when Y's conditional law follows an asymmetric Laplace law.

In connection with this approach, Gneiting (2011) introduced the notion of "ellicable statistics" - or "ellicable measurement" in its probabilistic (or distributional) version: a statistic T will be said to be "ellicitable" if there is a loss function \ell:\mathbb{R}\times\mathbb{R}\rightarrow\mathbb{R}_+ such that:T(Y)=\underset{x\in\mathbb{R}}{\text{argmin}}\left\lbrace\int_{\mathbb{R}} \ell(x,y)dF(y)\right\rbrace=\underset{x\in\mathbb{R}}{\text{argmin}}\left\lbrace\mathbb{E}\big[ \ell(x,Y)\big]\text{ where }Y\overset{\mathcal{L}}{\sim} F\right\rbrace The mean (mathematical expectation) is thus ellicable by the quadratic distance, \ell_2, while the median is ellicable by the distance \ell_1. According to Gneiting (2011), this property is essential for obtain predictions and forecasts. There may then be a strong link between measures associated with probabilistic models and loss functions. Finally, Bayesian statistics provide a direct link between the form of the a priori law and the loss function, as studied by Berger (1985) and Bernardo & Smith (2000). We will come back to the use of these different norms in the section on penalization.

To be continued (keep in mind that references are online here)…

[1] Where the indicator \mathbf{1}_{\pm} does not take values 0 or 1 (like the classical \mathbf{1} function), but -1 and +1.