{"id":2011,"date":"2025-03-16T17:27:27","date_gmt":"2025-03-16T17:27:27","guid":{"rendered":"https:\/\/kalogeratos.com\/psite\/?page_id=2011"},"modified":"2025-03-16T18:27:51","modified_gmt":"2025-03-16T18:27:51","slug":"gsm-degroot","status":"publish","type":"page","link":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/","title":{"rendered":"GSM-Degroot"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2012\" src=\"https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?resize=600%2C604&#038;ssl=1\" alt=\"\" width=\"600\" height=\"604\" srcset=\"https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?w=716&amp;ssl=1 716w, https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?resize=298%2C300&amp;ssl=1 298w, https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?resize=75%2C75&amp;ssl=1 75w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h2>GSM-Degroot package<\/h2>\n<p><strong>><\/strong> <a href=\"https:\/\/kalogeratos.com\/psite\/files\/MyFiles\/gsm-degroot\/GSM-Degroot.zip\">Download the package<\/a> <strong>&lt;<\/strong><\/p>\n<p><em><strong>Description:<\/strong> Python code with a prototype implementation of the GSM-Degroot model (i.e. a Degroot-based model with a global steering mechanism) and the experiments appearing in the associated paper.<\/em><\/p>\n<h3>I. Model<\/h3>\n<p>1) <strong>DGSM_matrix_form.<\/strong><br \/>\nThis file contains functions that simulate the model:<\/p>\n<ul>\n<li>model_non_SBM() for graphs of the type : Barabasi-Albert (BA), Watts-Strogatz (WS), grid, Erdos-Renyi (ER).<\/li>\n<li>model_SBM() for SBM graphs.<\/li>\n<li>model_non_SBM_robust() and model_SBM_robust() in case the parameters cause numerical errors.<\/li>\n<\/ul>\n<p>The above functions generate M runs of the model and output metrics averaged over those M runs. The metrics generated are:<\/p>\n<ul>\n<li>S_ts: the number of agents in state 1 as a function of time,<\/li>\n<li>max_end\/min_end: the maximal\/minimal opinion in last period,<\/li>\n<li>pol_end: the difference between the two,<\/li>\n<li>max_pol: the maximal difference between maximum and minimum taken across,<\/li>\n<li>max_pol: the time at which it is reached.<\/li>\n<\/ul>\n<p>2) <strong>DGSM_matrix_form_batched.<\/strong><br \/>\nComputes the same as the previous file but uses a thread for each of the M runs.<\/p>\n<p><strong>NB:<\/strong> To perform a run of the model, it is enough to call the function model_non_SBM() \/ model_SBM() with the desired parameters.<\/p>\n<h3>II. Figures<\/h3>\n<p><strong>Get_curves.<\/strong> This file generates the model for various values of gamma, mu, and the network parameter, depending of the network type, for all network types considered. The file generates Fig. 6 and can be used to generate Figs. 2, 3, 5, 7.<\/p>\n<h3>III. Parameter optimization<\/h3>\n<p>1) <strong>Get_TS.<\/strong> This file generates the 85 time series used for optimization. It requires the data in json format to be in the directory.<\/p>\n<p>2) <strong>Optimization.<\/strong> This file runs the whole optimization process over the input time-series. Starting by generating the time-series by using the file Get_TS. The optimization is done by running the SBM version of the model and varying the parameters mu, gamma, and r. The starting point is a grid-search, and then performs simulated annealing initialized with the parameters identified previously by the grid-search. The best parameters are identified and saved for each language and social movement.<br \/>\n3) <strong>Cost_maps.<\/strong> For each time-series, this file performs a grid-search and gets the fitting costs associated to each triplet of parameters on the grid. This generates the cost maps necessary to perform the bootstrap analysis (see Appendix B. V in the paper).<\/p>\n<p>4) <strong>Bootstrap comparison.<\/strong> This file computes the bootstrap metric that compares the variance of the set of top q best performing parameters (q is between 0 and 1) to the variance of a set of q parameters taken at random. For each data set, this metric is obtained for q between 10^(-4) and 2&#42;10^(-2). Fig. 9 shows the outcome of this process for the MeToo and BLM data sets.<\/p>\n<h3>IV. Data acquisition<\/h3>\n<p>The data used in the paper are provided in the \/Data folder. The data have been acquired by the authors using the publicly available tool <a href=\"https:\/\/storywrangling.org\/\">storywrangler<\/a>, as described in the paper.<\/p>\n<h3>V. Contribution, availability, and how to cite<\/h3>\n<p>The contributors to implementation are Ivan Conjeaud and Argyris Kalogeratos. Contacts: name.surname@ens-paris-saclay.fr.<\/p>\n<p>The official distribution of this package is at this <a href=\"https:\/\/kalogeratos.com\/psite\/gsm-degroot\/\">web page<\/a>.<\/p>\n<p>This work can be properly cited by mentioning the original published paper it refers to:<\/p>\n<blockquote><p>\n  Ivan Conjeaud, Philipp Lorenz-Spreen, and Argyris Kalogeratos, &#8220;DeGroot-Based Opinion Formation Under a Global Steering Mechanism,&#8221; in IEEE Transactions on Computational Social Systems, vol. 11, no. 3, pp. 4040-4057, 2024.\n<\/p><\/blockquote>\n<p>To ensure accessibility, the text of the paper is also available in the public domain on <a href=\"https:\/\/arxiv.org\/abs\/2210.12274\">arxiv<\/a>.<\/p>\n<h3>VI. License<\/h3>\n<p>Copyright (C) 2020-2025, Ivan Conjeaud and Argyris Kalogeratos. This package is free software: you can redistribute it and\/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<\/p>\n<p>The package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<\/p>\n<p>You should have received a copy of the GNU General Public License along with this software in the file LICENSE.txt. If not, see <a href=\"http:\/\/www.gnu.org\/licenses\/\">here<\/a>.<\/p>\n<p>Brief overview of the GNU GPL:<\/p>\n<ul>\n<li>Provides copyright protection: True<\/li>\n<li>Can be used in commercial applications: True<\/li>\n<li>Bug fixes \/ extensions must be released to the public domain: True<\/li>\n<li>Provides an explicit patent license: False<\/li>\n<li>Can be used in proprietary (closed source) applications: False<\/li>\n<li>Is a viral license: True<\/li>\n<\/ul>\n<p>Other resources for the license:<\/p>\n<ul>\n<li>\n<p>A quick guide to <a href=\"https:\/\/www.gnu.org\/licenses\/quick-guide-gplv3.html\">GPLv3<\/a>.<\/p>\n<\/li>\n<li>\n<p>Full text of <a href=\"https:\/\/www.gnu.org\/licenses\/gpl-3.0.html\">GPLv3<\/a>.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>GSM-Degroot package > Download the package &lt; Description: Python code with a prototype implementation of the GSM-Degroot model (i.e. a Degroot-based model with a global steering mechanism) and the experiments appearing in the associated paper. I. Model 1) DGSM_matrix_form. This file contains functions that simulate the model: model_non_SBM() for graphs of the type : Barabasi-Albert [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2012,"parent":326,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2011","page","type-page","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Argyris Kalogeratos<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"GSM-Degroot package &gt; Download the package &lt; Description: Python code with a prototype implementation of the GSM-Degroot model (i.e. a Degroot-based model with a global steering mechanism) and the experiments appearing in the associated paper. I. Model 1) DGSM_matrix_form. This file contains functions that simulate the model: model_non_SBM() for graphs of the type : Barabasi-Albert [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/\" \/>\n<meta property=\"og:site_name\" content=\"Argyris Kalogeratos\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-16T18:27:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"716\" \/>\n\t<meta property=\"og:image:height\" content=\"721\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/\",\"url\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/\",\"name\":\"\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/kalogeratos.com\\\/psite\\\/wp-content\\\/uploads\\\/image-4.png?fit=716%2C721&ssl=1\",\"datePublished\":\"2025-03-16T17:27:27+00:00\",\"dateModified\":\"2025-03-16T18:27:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/kalogeratos.com\\\/psite\\\/wp-content\\\/uploads\\\/image-4.png?fit=716%2C721&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/kalogeratos.com\\\/psite\\\/wp-content\\\/uploads\\\/image-4.png?fit=716%2C721&ssl=1\",\"width\":716,\"height\":721},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/gsm-degroot\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Material\",\"item\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/material\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"GSM-Degroot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/#website\",\"url\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/\",\"name\":\"Argyris Kalogeratos\",\"description\":\"Senior Research Scientist \\\/\\\/ PhD Computer Science \\\/\\\/ Machine Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kalogeratos.com\\\/psite\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Argyris Kalogeratos","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/","og_locale":"en_US","og_type":"article","og_description":"GSM-Degroot package > Download the package &lt; Description: Python code with a prototype implementation of the GSM-Degroot model (i.e. a Degroot-based model with a global steering mechanism) and the experiments appearing in the associated paper. I. Model 1) DGSM_matrix_form. This file contains functions that simulate the model: model_non_SBM() for graphs of the type : Barabasi-Albert [&hellip;]","og_url":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/","og_site_name":"Argyris Kalogeratos","article_modified_time":"2025-03-16T18:27:51+00:00","og_image":[{"width":716,"height":721,"url":"https:\/\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/","url":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/","name":"","isPartOf":{"@id":"https:\/\/kalogeratos.com\/psite\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/#primaryimage"},"image":{"@id":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?fit=716%2C721&ssl=1","datePublished":"2025-03-16T17:27:27+00:00","dateModified":"2025-03-16T18:27:51+00:00","breadcrumb":{"@id":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/#primaryimage","url":"https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?fit=716%2C721&ssl=1","contentUrl":"https:\/\/i0.wp.com\/kalogeratos.com\/psite\/wp-content\/uploads\/image-4.png?fit=716%2C721&ssl=1","width":716,"height":721},{"@type":"BreadcrumbList","@id":"https:\/\/kalogeratos.com\/psite\/material\/gsm-degroot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kalogeratos.com\/psite\/"},{"@type":"ListItem","position":2,"name":"Material","item":"https:\/\/kalogeratos.com\/psite\/material\/"},{"@type":"ListItem","position":3,"name":"GSM-Degroot"}]},{"@type":"WebSite","@id":"https:\/\/kalogeratos.com\/psite\/#website","url":"https:\/\/kalogeratos.com\/psite\/","name":"Argyris Kalogeratos","description":"Senior Research Scientist \/\/ PhD Computer Science \/\/ Machine Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kalogeratos.com\/psite\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/pages\/2011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/comments?post=2011"}],"version-history":[{"count":0,"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/pages\/2011\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/pages\/326"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/media\/2012"}],"wp:attachment":[{"href":"https:\/\/kalogeratos.com\/psite\/wp-json\/wp\/v2\/media?parent=2011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}