|
Algorithm 1 Framework of calibrating the prediction for opinion dynamics models |
-
1:
Initialize population; Population codes parameters of opinion dynamics models
-
2:
-
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:
;
-
8:
end while
-
9:
; 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
|