Instead of randomizing whether an individual adopts the innovation or not, this
toy model randomizes threshold levels, seed adopters and network structure, so
an individual adopts the innovation in time $T$ iff his exposure is above or
equal to his threshold. The simulation is done in the following steps:
- Using
seed.graph
, a baseline graph is created.
- Given the baseline graph, the set of initial adopters is defined
using
seed.nodes
.
- Afterwards, if
rewire=TRUE
$t-1$ slices of the network are created
by iteratively rewiring the baseline graph.
- The
threshold.dist
function is applied to each node in the graph.
- Simulation starts at $t=2$ asigning adopters in each time period
accordingly to each vertex's threshold and exposure.
When seed.nodes
is a character scalar it can be "marginal"
, "central"
or "random"
,
So each of these values sets the initial adopters using the vertices with lowest
degree, with highest degree or completely randomly. The number of early adoptes
is set as seed.p.adopt * n
. Please note that when marginal nodes are
set as seed it may be the case that no diffusion process is attained as the
chosen set of first adopters can be isolated. Any other case will be considered
as an index (via [<-
methods), hence the user can manually set the set of initial adopters, for example
if the user sets seed.nodes=c(1, 4, 7)
then nodes 1, 4 and 7 will be
selected as initial adopters.
The argument seed.graph
can be either a function that generates a graph
(Any class of accepted graph format (see netdiffuseR-graphs
)), a
graph itself or a character scalar in which the user sets the algorithm used to
generate the first network (network in t=1), this can be either "scale-free"
(Barabasi-Albert model using the rgraph_ba
function, the default),
"bernoulli"
(Erdos-Renyi model using the rgraph_er
function),
or "small-world"
(Watts-Strogatz model using the rgraph_ws
function). The list rgraph.args
passes arguments to the chosen algorithm.
When rewire=TRUE
, the networks that follow t=1 will be generated using the
rewire_graph
function as $G(t) = R(G(t-1))$, where $R$
is the rewiring algorithm.
The argument threshold.dist
sets the threshold for each vertex in the graph.
It is applied using sapply
as follows
sapply(1:n, threshold.dist)
By default sets the threshold to be random for each node in the graph.
If sgraph
is provided, no random graph is generated and the simulation
is applied using that graph instead.