Opinion
: An opinion dynamics process
- class epydemic.Opinion
Model for opinion spreading dynamics.
This model is based on the work of Moreno et alia [MNP04], in which a single rumour is spread using an epidemic-like process, with compartments consisting of those ignorant of the rumour (
IGNORANT
), those who have heard the rumour and can spread it (SPREADER
), and those who have heard the rumour and now do not believe it (or at least do not spread it (STIFLER
). The difference between this process andSIR
is that “spreaders” become “stiflers” at a rate proportional to their contact with stiflers and spreaders.
Dynamical states
Opinion dynamics uses three compartments:
-
Opinion.IGNORANT:
Final
[str
] = 'epydemic.opinion.G' Compartment for nodes ignorant of the rumour.
-
Opinion.SPREADER:
Final
[str
] = 'epydemic.opinion.P' Compartment for nodes spreading the rumour.
-
Opinion.STIFLER:
Final
[str
] = 'epydemic.opinion.T' Compartment for nodes now stifling the rumour.
Parameters
The process is parameterised by three parameters:
-
Opinion.P_AFFECTED:
Final
[float
] = 'epydemic.opinion.pAffected' Parameter for probability of initially being affected at start.
-
Opinion.P_AFFECT:
Final
[float
] = 'epydemic.opinion.pAffect' Parameter for probability of affect on contact.
-
Opinion.P_STIFLE:
Final
[float
] = 'epydemic.opinion.pStifle' Parameter for probability of becoming stifler on contact.
Loci
Opinion spreading uses two loci:
Between ignorant and spreader nodes (GP edges), where the opinion is spread (the
Opinion.GP
locus); andBetween spreaders and spreaders or stiflers (PPT edges) where the opinion is quashed (the
Opinion.PPT
locus).
-
Opinion.GP:
Final
[str
] = 'epydemic.opinion.GP' Compartment for edges able to transmit the rumour.
-
Opinion.PPT:
Final
[str
] = 'epydemic.opinion.PPT' Compartment for edges able to stifle the rumour.
Building the model
- Opinion.build(params)
Build the opinion model.
- Parameters:
params (
Dict
[str
,Any
]) – the experimental parameters
Event methods
- Opinion.affect(t, e)
Performs affect event. Changes the compartment of the ignorant-end node to
SPREADER
. This is recorded in the state as occupying the edge over which the opinion passed, as as a “hit” for the hitting time.- Parameters:
t (
float
) – the simulation timee (
Union
[Any
,Tuple
[Any
,Any
]]) – the edge transmitting the infection, ignorant -> spreader
Running the model
- Opinion.atEquilibrium(t)
The process is at equilibrium if there are no more GP or PPT edges remaining.
- Parameters:
t (
float
) – the simulation time- Return type:
bool
- Returns:
True if the process is at equilibrium