Skip to main content
. 2022 Aug 12;24(8):1112. doi: 10.3390/e24081112
Algorithm 1 Framework of calibrating the prediction for opinion dynamics models
  • 1:

    Initialize population; Population codes parameters of opinion dynamics models

  • 2:

    Evaluate population by Ot0;

  • 3:

    while the genetic algorithm method is searching do

  • 4:

     Select population that best matches the observation;

  • 5:

     Crossover to generate new population, so as to search more efficiently;

  • 6:

     Mutate to realize local random search, and avoid unmature convergence;

  • 7:

    Evaluate Population by Ot0;

  • 8:

    end while

  • 9:

    Sample particles based on Ot0; Particles correspond to parameters of opinion dynamics models

  • 10:

    If obtain new observation then do

  • 11:

     Simulate opinion dynamics models according to the particles;

  • 12:

     Update particle weights;

  • 13:

     Estimate new system state through the average distribution of particles with the largest weights;

  • 14:

     Resample particles;

  • 15:

    end if