Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjun committed Apr 30, 2015
1 parent ec9d3f7 commit d0d7698
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Network diffusion research focuses on how network structure exerts its impact on


# Use

```R
require(networkdiffusion)
require(igraph)
require(animation)
Expand All @@ -36,10 +36,12 @@ Network diffusion research focuses on how network structure exerts its impact on
ani.options("convert")
plot_gif(infected, g)
}, interval = 0.3, movie.name = "ba.gif", ani.width = 600, ani.height = 600)
```

![](./ba.gif)


```R
# generate a small-world network
g = watts.strogatz.game(1,100,3,0.2)
infected = get_infected(g, 0.4, 1, 2004)
Expand All @@ -50,9 +52,11 @@ Network diffusion research focuses on how network structure exerts its impact on
ani.options("convert")
plot_gif(infected, g)
}, interval = 0.3, movie.name = "ws.gif", ani.width = 600, ani.height = 600)

```

![](./ws.gif)

```R
# generate a ring network
g = connect.neighborhood(graph.ring(30), 2); plot(g)
infected = get_infected(g, 0.4, 1, 2004)
Expand All @@ -63,20 +67,25 @@ Network diffusion research focuses on how network structure exerts its impact on
ani.options("convert")
plot_gif(infected, g)
}, interval = 0.3, movie.name = "ring.gif", ani.width = 600, ani.height = 600)

```

![](./ring.gif)

#SI model
Actually, this is the most basic epidemic model (SI model) which has only two states: Susceptible (S) and Infected (I). However, we will extend it to networks. SI model describes the status of individuals switching from susceptible to infected. In this model, every individual will be infected eventually. Considering a close population without birth, death, and mobility, and assuming that each agent is homogeneous mixing, SI model implies that each individual has the same probability to transfer something (e.g., disease, innovation or information) to its neighbors (T. G. Lewis, 2011).

Given the transmission rate β, SI model can be described as:

```R
dS/dt=−βSI
dI/dt=βSI
```

Note that I + S = 1, the equation dI/dt=βSI can be simplified as:

```R
dI/dt=βI(1I)
```

Solve this equation, we can get a logistic growth function featured by its s-shaped curve. The logistic curve increases fast after it crosses the critical point, and grows much slower in the late stage. It can be used to fit the curve of diffusion of innovations.

Expand Down

0 comments on commit d0d7698

Please sign in to comment.