Skip to content

Commit d0d7698

Browse files
committed
Update README.md
1 parent ec9d3f7 commit d0d7698

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Network diffusion research focuses on how network structure exerts its impact on
2121

2222

2323
# Use
24-
24+
```R
2525
require(networkdiffusion)
2626
require(igraph)
2727
require(animation)
@@ -36,10 +36,12 @@ Network diffusion research focuses on how network structure exerts its impact on
3636
ani.options("convert")
3737
plot_gif(infected, g)
3838
}, interval = 0.3, movie.name = "ba.gif", ani.width = 600, ani.height = 600)
39+
```
3940

4041
![](./ba.gif)
4142

4243

44+
```R
4345
# generate a small-world network
4446
g = watts.strogatz.game(1,100,3,0.2)
4547
infected = get_infected(g, 0.4, 1, 2004)
@@ -50,9 +52,11 @@ Network diffusion research focuses on how network structure exerts its impact on
5052
ani.options("convert")
5153
plot_gif(infected, g)
5254
}, interval = 0.3, movie.name = "ws.gif", ani.width = 600, ani.height = 600)
53-
55+
```
56+
5457
![](./ws.gif)
5558

59+
```R
5660
# generate a ring network
5761
g = connect.neighborhood(graph.ring(30), 2); plot(g)
5862
infected = get_infected(g, 0.4, 1, 2004)
@@ -63,20 +67,25 @@ Network diffusion research focuses on how network structure exerts its impact on
6367
ani.options("convert")
6468
plot_gif(infected, g)
6569
}, interval = 0.3, movie.name = "ring.gif", ani.width = 600, ani.height = 600)
66-
70+
```
71+
6772
![](./ring.gif)
6873

6974
#SI model
7075
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).
7176

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

79+
```R
7480
dS/dt=−βSI
7581
dI/dt=βSI
82+
```
7683

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

86+
```R
7987
dI/dt=βI(1I)
88+
```
8089

8190
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.
8291

0 commit comments

Comments
 (0)