Tag Archives: graph

La parité, comme condition d’équilibre stable non dégénéré (simulations)

J’avais mis en ligne hier soit un court billet, expliquant pourquoi la parité ne devait pas uniquement être vu sous un angle éthique, ou moral, mais qu’il convenait de regarder la dynamique d’un système. Et moyennant quelques hypothèses simples (simplistes ?) basées sur des faits stylisées de stigmatisation, on pouvait avoir l’intuition que si le taux de personnes issues de la minorité est trop faible, on converge vers un équilibre dégénéré.

C’est ce qu’on peut visualiser sur la figure suivante

sur une simulation de trajectoire sur 150 pas de temps (150 semaines si on veut, ou 150 jours). On pourrait objecter que c’est juste une simulation, mais en fait, ce comportement quand r_0 est trop faible, on le retrouve assez souvent

avec quelque chose qu’on pourrait interpréter comme un décrochage soudain, où quand r_t passe sous un certain seuil, r_{t+h} plonge vers 0, et (si on reste sur l’interprétation garçon-fille), on converge vers un “Boys’ Club” (ce qu’on appelle en maths, un équilibre dégénéré). Mon modèle est assez simple, et on pourrait le perfectionner (mais l’idée des billets de blog est de faire des choses assez simples). Si on regarde quand on commence proche de 35% pour r_0, on a un ensemble hétérogène de trajectoires, soit vertueuses (qui sont que r_t augmente, pour tendre vers un équilibre paritaire),  soit vicieuses, avec r_t baisse, avec le risque de baisser trop, et de retrouver la spirale infernale précédente.

C’est d’ailleurs très exactement ce qu’on observe si on va plus loin dans les simulations

Une fois ce seuil franchit, r_t plonge vers 0.

Je ne parlerais pas de la partie supérieure, parce que le défaut (ou un des défauts) de mon modèle, c’est que je tiens pas compte du fait que si on passe au dessus de 50%, la “minorité” devient la “majorité”, et donc on pourrait imaginer de manière symétrique le même genre de soucis dans la partie supérieure de la Figure. Au lieu de ces deux tendances, on pourrait imaginer une force de rappel autour de 50% pour maintenir cet état vertueux correspondant à la situation paritaire…

Je peux expliquer un peu comment j’ai obtenu ces figure, en décriant mon modèle dynamique de composition genrée dans un réseau social. On considère un ensemble de n individus connectés au sein d’un graphe aléatoire mixte, évoluant au cours du temps discret t = 0,1,2,\dots. Comme j’avais du mal à gérer les entrées et les sorties, on va constamment suivre n individus, avec à chaque pas de temps, un proportion de femmes est notée r_t \in (0,1) qui évoluera dynamiquement. Le nombre de filles et le nombre de garçons seront ici n_F(t) = \lfloor r_t \, n \rfloor, \quad n_M(t) = n - n_F(t).Les ensembles de nœuds féminins et masculins sont notés F_t et M_t.

Structure du réseau : modèle à blocs stochastiques

Le réseau G_t = (V_t, E_t) est tiré selon un modèle à blocs stochastiques (SBM) à deux blocs (femmes et hommes) avec une matrice de probabilités de connexion P(r_t) qui s’écritP(r) =\begin{pmatrix}p_{FF}(r) & p_{FM}(r) \\p_{FM}(r) & p_{MM}(r) \end{pmatrix}. Je vais définir la fonction logistique (sigmoïde) \sigma(x) = (1 + e^{-x})^{-1},et des fonctions de “rareté” :
\phi_F(r) = \frac{1 - r}{r}, \text{ et } \phi_M(r) = \frac{r}{1 - r}.Les probabilités de lien entre individus dans les groupes s’écrivent alors \begin{aligned}p_{FF}(r) &= \sigma(\theta_0 + \eta + 2\gamma\,\phi_F(r)),\\p_{MM}(r) &= \sigma(\theta_0 + \eta + 2\gamma\,\phi_M(r)),\\p_{FM}(r) &= \sigma(\theta_0 + \delta_{\text{mix}} + \gamma(\phi_F(r) + \phi_M(r))).\end{aligned}Les paramètres \eta et \gamma contrôlent respectivement l’homophilie et la sensibilité à la rareté d’un genre.

Je vais poursuivre la remarque introductive que je faisais auparavant: à chaque étape temporelle, le graphe G_t est resimulé intégralement à partir de la distribution P(r_t). Autrement dit, la structure des liens n’a aucune mémoire, le modèle supposant un mélange social complet à chaque période. Bien sûr, ce choix n’est pas réaliste (dans la réalité, les liens persistent), et donc empêche une vision ABM où on pourrait suivre des trajectoires individuelles… mais ça simplifie grandement la dynamique, en évitant d’avoir à suivre explicitement les entrées, sorties et réajustements de connexions individuels, etc. Mais pour mon billet de blog (qui n’a pas d’autre prétention), ce n’est pas gênant, le modèle représente ainsi une sorte d’état moyen du graph, plutôt qu’un réseau concret avec des individus identifiés.

Exposition locale et propension masculine

Pour chaque nœud masculin i \in M_t, on définit N_t(i) l’ensemble des voisins directs de i, et \deg_t(i)=\#\{N_t(i)\} le degré local (le nombre de voisins directs). On introduit alors s_i(t) = \frac{\#\{|N_t(i) \cap F_t\}}{\deg_t(i)},et z_i(t) = \frac{\#\{N_t(i) \cap M_t\}}{\deg_t(i)} = 1 - s_i(t),
et une mesure de proximité “triangulaire” féminine t_i(t) = \left(\frac{\#\{N_t(i) \cap F_t\}}{\deg_t(i)}\right)^2.Alors, j’ai mis un exposant 2 ici, dans cette formule de “mesure triangulaire féminine” pour avoir une “pondération non linéaire”. Autrement dit, ça permet de renforcer l’effet de la présence multiple de femmes dans le voisinage. L’idée est de représenter l’effet de cohésion féminine locale autour d’un individu masculin. Le but n’est pas de quantifier le fait d’avoir une femme dans le voisinage (déjà capturé par s_i), mais bien d’avoir plusieurs femmes connectées entre elles dans le voisinage, ce va rendre la “présence féminine” visible et normative. Autrement dit : si un homme est connecté à une seule femme, l’effet social reste faible (il peut ignorer la norme) alors que s’il est entouré de plusieurs femmes, qui elles-mêmes sont connectées entre elles, la norme collective est beaucoup plus forte. Il permet de capturer l’idée suivante : plus de femmes proches → plus de triangles F–M–F → plus de pression normative.

Dans ce modèle, la propension individuelle d’un homme à avoir un comportement déplacé (une petite phrase sexiste par exemple) est donnée par \pi_i(t)= \pi_0 \, N(r_t)\, e^{-\alpha\,s_i(t) - \alpha_2\,t_i(t)}\, e^{\zeta\,z_i(t)},N est une fonction normative.

Boucle vertueuse et norme sociale

La norme protectrice (ou “boucle vertueuse”) ne s’active que si la proportion de femmes dépasse un seuil r_{\text{protect}} (il faut qu’il y ait assez de femme). On définit ainsi :
{N}(r) =\begin{cases}\exp\!\big(-\beta_{\text{norm}} \, L(r)\big), & \text{si } r > r_{\text{protect}},\\1, &\text{sinon,}\end{cases}L(r) = \sigma\!\big(\kappa (r - r_\star)\big) est une fonction logistique “raide” (qui tend vers la fonction indicatrice), avec \kappa assez grand et r_\star \approx 0.45 le pivot normatif. Ainsi, lorsque r_t > r_{\text{protect}}, la norme sociale réduit la propension masculine moyenne (à avoir un comportement déplacé).

Incidents et sanctions

Chaque arête (i,j) reliant un homme i et une femme j peut donner lieu à un incident i \to j avec probabilité\mathbb{P}(\text{incident } i \to j) = \lambda \, \pi_i(t),\lambda est un paramètre global de fréquence des comportements déplacés.

On note \mathcal{O}_t l’ensemble des auteurs masculins et\mathcal{V}_t celui des victimes féminines. Quand r_t > r_{\text{protect}}, les auteurs sont sanctionnés avec une probabilité s(r_t) = s_{\max}\, L(r_t), ce qui augmente leur probabilité de sortie.

Sorties et recrutement

Les probabilités de sortie (ou d’abandon) sont données, pour les femmes, parq_j^F(t)= \big(\beta_F+ \tau_{\text{inc}}\,\mathbf{1}\{j\in \mathcal{V}_t\}+ \tau_{\text{iso}}\,\mathbf{1}\{s_j(t) < \theta_{\text{iso}}\}\big)\times B(r_t),et pour les hommes q_i^M(t) = \beta_M + \tau_{\text{sanction}} \, \mathbf{1}\{i \in \mathcal{O}_t \text{ sanctionné}\}.On tire ensuite le nombre de départs féminins X_t^F et masculins X_t^M,X_t^F \sim \mathrm{Binomial}(n_F(t), \bar{q}^F_t),\text{ et }X_t^M \sim \mathrm{Binomial}(n_M(t), \bar{q}^M_t).

Les départs sont compensés par un recrutement de nouveaux membres, avec probabilité p_t^{\text{newF}} d’être une femme :p_t^{\text{newF}}=\begin{cases}r_t, & \text{si } r_t \le r_{\text{protect}},\\[6pt]\mathrm{clamp}\big(r_t + k(0.5 - r_t), 0, 1\big),& \text{si } r_t > r_{\text{protect}}.\end{cases}

Loi d’évolution de la proportion féminine

Après sorties et recrutements, la proportion féminine à l’instantt+1 est r_{t+1} = \frac{n_F(t) - X_t^F + Y_t}{n}= r_t + \frac{Y_t - X_t^F}{n},
Y_t est le nombre de femmes recrutées au temps t. Et en prenant l’espérance conditionnelle, on obtient la dynamique moyenne,\mathbb{E}[r_{t+1}\mid r_t]= r_t + \frac{(X_t^F + X_t^M)\,p_t^{\text{newF}}- \sum_{j\in F_t} q_j^F(t)}{n}.

Interprétation qualitative

Le système présente deux régimes distincts :

  • Sous le seuil r_{\text{protect}} : la boucle vertueuse est inactive, les incidents augmentent, les femmes sortent et on observe l’effondrement dont je parlais en introduction
  • Au-dessus du seuil : la norme protectrice et les sanctions s’activent, les sorties féminines diminuent et on a (en moyenne, et en moyenne seulement comme on le voyait sur les figures introductives) une stabilisation autour de la parité.

Ce modèle reproduit une transition de phase sociale : avec un régime “entre-soi masculin” (boys’ club) et un régime mixte stabilisé par la norme collective. Et dans un monde idéal, on peut imaginer une structure hiérarchique, avec une dizaine de “groupes” (qui représentent une formation par exemple, à l’université), des blocs de blocs, avec la contrainte que si une personne quitte un groupe, forcément elle va dans un autre… et donc un déséquilibre fort dans une formation va avoir des conséquences sur tous les autres (d’autant plus si on met là aussi des matrices de transition entre formations). Donc une formation qui a une parité qui s’effondre, c’est malheureux localement, mais potentiellement dévastateur globalement…

Assurance collaborative, théorie des graphes et actuariat

Mardi prochain, j’interviendrais (en visio) au colloque SCOR sur le thème “Actuariat, effets réseaux et théorie des graphes

Mes slides (on m’a demandé de parler sur le thème assurance collaborative, théorie des graphes et actuariat) sont en ligne, je présenterai notre papier Collaborative Insurance Sustainability and Network Structure, mais je peux en profiter pour mentionner d’autres articles, dont modéliser la contagion, ou les réseaux pour réinventer l’assurance?

Webinaire sur l’assurance collaborative et la théorie des grahs

Le mardi 28 janvier, avec Christian Yann Robert, on donnera un exposé à Paris sur le thème “Assurance collaborative: Théorie des Graphes, Machine Learning et Actuariat“, à l’Institut Louis Bachelier et l’Institut des Actuaires, à Paris

L’assurance collaborative est une nouvelle forme d’assurance et de relation entre assureur et assurés qui met à profit les nouvelles technologies pour une plus grande implication des assurés dans le processus et le modèle économique. Par la transparence elle vise à instaurer une relation de confiance forte entre les acteurs. Elle peut prendre des formes différentes, allant de la simple redistribution des profits jusqu’à la gestion en peer to peer par les assurés, rassemblés en communautés d’intérêt. Plusieurs tentatives ont été faites depuis 5 ou 6 ans dans différents pays: certaines en Europe ont échoué, d’autres se rôdent.
Aux Etats-unis, Lemonade est une vraie réussite. La répartition de la prime est de 20% pour la gestion et la rémunération de l’entreprise, 40% pour les sinistres (avec une redistribution en cas de bénéfice technique) et 40% pour la réassurance des gros sinistres. Cette nouvelle forme de mutualisation fait émerger de nouvelles problématiques tarifaires et de provisionnement, selon le mode de constitution des communautés d’assurés. La théorie des graphes aide à comprendre la capacité de mutualisation selon la structure des communautés.

Networks to reinvent insurance?

The theory of networks, or graphs, was born in 1735, following the work of Leonard Euler, who tried to find a walk – starting from a given point – that would bring us back to that point by passing once and only once through each of the seven bridges in the city of Königsberg. These networks can be compared to metro networks, consisting of stations (nodes), linked between two by rails, or not, or more generally a road network, which can give rise to congestion studies, for example. But today, networks are mainly social, connecting people through friendships, professional, family, or monetary ties. Network analysis makes it possible to create relatively homogeneous communities, accepting to share a risk, recreating a mutualisation.

Network and credit

In genealogy, we will have hierarchical networks, a child being linked to his parents, who are themselves linked to their parents. In sociology, social networks make it possible to analyze the links between individuals (or organizations) within a group. Friendships can be studied in a schoolyard (a link that could be an invitation to a birthday party) or e-mail exchanges in a company (the Enron e-mail database has been widely used, with over 180,000 messages exchanged between 36,000 employees). Figure 1 shows two networks of 20 individuals (A, B, …, T).

 

Figure 1: Random networks, 20 nodes (Watts-Strogatz and Barbasi)

In a Facebook or Linkedin type vision, we will say that E and F are linked, in the sense of “friends”, if there is a segment linking points E and F. A network can be directed, for example if we study the exchange of messages (E wrote to F), or money loans (E lent money to F). If historically only adjacency was studied (existence or not of links), we can now add weights, for example the amount of a financial loan. Babutsidze (2012) thus studies the positions of French and German banks in interbank lending within the European zone (the nodes are then the banks). The study of networks within village communities in developing countries has led to a better understanding of informal finance mechanisms. Banerjee et al (2013) study the dissemination of information in a network, and more particularly microfinance loans.

While networks are useful for better organizing microcredit, CNN noted in 2015 that Facebook allowed credit organizations to use a borrower’s social network to determine whether or not it represents a good credit risk. In particular, if friends’ credit scores were too low, a person could be denied credit. This situation is dangerous because of the particular properties of networks, and more particularly the paradox of friends.

From the very small world to the paradox of friends

In 1929, Frigyes Karinthy hypothesized that any person on earth could be connected to any other person by a succession of individual relationships involving at most 6 links. “We should select anyone from the world’s 1.5 billion people, anyone, anywhere. It seems that, using no more than five individuals, one of whom is a personal acquaintance, he could contact the chosen individuals using nothing other than the network of personal acquaintances. This theory of six handshakes originated in a new literary novel. It will be necessary to wait for the work of Michael Gurevich in the 1960s, then Stanley Milgram ten years later, to see the first attempts to quantify these relationships appear, under the name “Small World Problem”.

While Leskovec & Horvitz (2008) confirmed this order of magnitude, by analyzing several billion messages exchanged using the Windows Live Messenger platform, more recently, Baghat et al (2016) estimated that any two people on Facebook were connected by an average of three and a half people. On the random network on the left, a person has, on average, 2 friends, while a random friend has, on average, 2.25 friends. On the right-hand network, the gap is even greater, because if there too a person has, on average, 2 friends, a random friend will have on average more than 4 friends.

 

Figure 2: Random networks, 500 nodes (Watts-Strogatz and Barbasi)

This paradox, observed in 1991 by sociologist Scott Feld, is very easily demonstrated. Heuristically, we can see a link with the probabilistic property \frac{\mathbb{E}[X^2]}{\mathbb{E}[X]}=\mathbb{E}[X]+\frac{\text{Var}[X]}{\mathbb{E}[X]}>\mathbb{E}[X] where the term on the left is the number of friends of my friends, divided by my number of friends. The difference is all the greater the greater the dispersion of the number of friends. If the left-hand network is very dense, the right-hand network on the other hand has a power law property: the distribution of the number of friends follows a power law (or Zipf law, or Pareto’s law). Figure 3 shows the distribution of the number of friends on a network, in a double logarithmic scale: linearity indicates a distribution according to power. This type of distribution can be found in a very large number of networks, particularly Facebook, as shown by Wohlgemuth & Matache (2014).

 

Figure 3: Distribution of the number of friends on simulated random networks (Watts-Strogatz and Barbasi in red)

The classic interpretation is that some people are central in the network, with a very large number of connections. This property is well known in marketing (we will then speak of a “peer effect“) but it also has impacts in risk management or public health. Chrisakis & Fowler (2010) have shown that influenza epidemics can be detected almost two weeks in advance, by monitoring the infection in a social network. In particular, the analysis of the health of central people in a network is “an ideal way to predict outbreaks, but detailed information doesn’t exist for most groups, and to produce it would be time-consuming and costly”. To return to the example of the credit score, if it is found to be correlated to the number of friends, the friends paradox makes it dangerous to use the friends’ score as an indicator of an individual’s risk!

The importance of homophilia

Another important feature of networks is the notion of homophilia, introduced in 2001 in sociology by two important articles, corresponding to the tendency to be connected to one’s peers. McPherson et al (2001) assumed that similarity generates connection, and therefore people’s personal networks are homogeneous across many socio-demographic, behavioural and intrapersonal characteristics. Moody (2001) studied friendships in elementary school playgrounds in the United States, with a focus on interracial friendships. Easley & Kleinberg (2010) thus presents a number of consequences of homophilia, ranging from the creation of tables at business meals to the granting of credit in the United States. The measurement of homophilia is the same as asking, taking into account pre-existing groups (according to gender, age, socio-professional category, etc.) how the links are distributed, between groups, or within groups.

 

Figure 4: Low homophilia (left) and high homophilia (right)

In an insurance context, an actuary seeks to create tariff classes, groups that are homogeneous in terms of risks, according to explanatory variables (the so-called tariff variables). People who live in the same place, drive the same types of vehicles, and have the same characteristics, are likely to be in the same class. But if homophilia exists in a population, a tariff group could perhaps be observed on a network of friends. Why not then consider creating groups within a network?

Using insurance networks

In this spirit, in 2010, Friendsurance was launched in Germany and has more than 100,000 insured in 2018. In France, a short collaborative insurance experiment was launched in 2015, with Inspeer, offering to share damage insurance deductibles (in car or home insurance) with friends. These types of collaborative insurance, sometimes called peer-to-peer insurance, are based on the formation of small groups by a broker. A portion of the insurance premiums paid is paid to a group fund, the other portion to a third party insurance company. Minor damage suffered by the policyholder is first covered by this group fund. For claims exceeding the deductible, the usual insurer is used. A group can be formed by the insured, forming a social network a bit like Facebook. In this model, the only requirement is that all group members must have the same type of insurance (e. g. liability insurance with legal expenses insurance).

As Schiller (2013) noted, this type of mechanism has many virtues, the first being to reduce costs and the risk of fraud. There is no tendency to cheat on the cost of a claim when the risk is borne by family members or friends. The anonymity of mutuality that exists in the law of large numbers is disappearing. But aren’t we reinventing version 2.0. of the tontine associations, with the strong return of risk sharing within close-knit communities?

References

Joshua Angrist. The perils of peer effects. Labor Economics, 30, 98-108, 2014

Zakaria Babutsidze. Positions of French and German Banks in European interbank lending network. OFCE, Mars 2012.

Abhijit Banerjee, Arun Chandrasekhar, Esther Duflo & Matthew Jackson. Diffusion of Microfinance. Science, 341,

Smriti Bhagat, Moira Burke, Carlos Diuk, Ismail Onur Filiz & Sergey Edunov. Three and a half degrees of separation. Facebook Research, 2016.

Ananya Bhattacharya. Facebook patent: Your friends could help you get a loan – or not. 4 août 2015, CNN,

Nicholas Christakis & James Fowler Social Network Sensors for Early Detection of Contagious Outbreaks. PLoS ONE. 5 (9): e12948. arXiv:1004.4792 2015

David Easley & Jon Kleinberg. Networks, Crowds, and Markets. Cambridge University Press. 2010.

Scott Feld. Why your friends have more friends than you do, American Journal of Sociology, 96 (6): 1464–1477, 1991.

Matthew Jackson. Social and Economic Networks. Princeton University Press, 2010.

Jure Leskovec & Eric Horvitz. Planetary-Scale Views on a Large Instant-Messaging Network. Microsoft Research, 2008.

Miller McPherson, Lynn Smith-Lovin & James Cook. Birds of a Feather: Homophily in Social Networks. Annual Review of Sociology. 27: 415–444, 2001.

James Moody. Race, School Integration, and Friendship Segregation in America. American Journal of Sociology, 107 (3): 679-716, 2001.

Wesley Perkins, Michael Haines & Richard Rice. Misperceiving the college drinking norm and related problems: a nationwide study of exposure to prevention information, perceived norms and student alcohol misuse. Journal of Studies on Alcohol 66 (4) : 470-478, 2005.

Ben Schiller. A Social Network For Insurance That Cuts Costs And Reduces Fraud. Fast Company, October 2013,

Brad Walker. How Peer-to-Peer Companies Are Transforming the Insurance Sector. The Street, Avril 2016,

Jason Wohlgemuth & Mihaela Matache. Small-World Properties of Facebook Group

Networks. Complex Systems, 23 (2014).

[i] Complete data can be downloaded from https://snap.stanford.edu/data/email-Enron.html

[ii] https://www.friendsurance.com/ and https://www.inspeer.me/ respectively

Who interacts on Twitter during a conference (#JDSLille)

Disclamer: This is a joint post with Avner Bar-Hen, a.k.a. @a_bh, Benjamin Guedj, a.k.a. @bguedj and Nathalie Villa, a.k.a. @Natty_V2

Organised annually since 1970 by the French Society of Statistics (SFdS), the Journées de Statistique (JdS) are the most important scientific event of the French statistical community. More than 400 researchers, teachers and practitioners meet at each edition. In 2015, JDS took place in Lille, in France.

SFdS regularly tweets (with the account @Statfr) and for the first year a live-tweet was organized durind JdS. The Hashtag was #JDSLille. The aim of this post is a (brief) statistical analysis of the live-tweet.

Continue reading Who interacts on Twitter during a conference (#JDSLille)