NetworkSIR: Function to simulate an epidemic on a network

Description Usage Arguments Value Examples

View source: R/rfuncs.R

Description

Function to simulate a stochastic (discrete time) Reed-Frost SIR model on a social network

Usage

1

Arguments

CM

a contact matrix

tau

the transmission probability

gamma

the recovery probability

Value

An object of class netSIR with infectious status for each node through time

Examples

1
2
3
4
cm1=BarabasiAlbert(N=200,K=2)
sim1=NetworkSIR(cm1,.3,0.1)
summary(sim1)
## Not run: plot(sim1)

Example output

Loading required package: shiny
Loading required package: deSolve
Loading required package: polspline
     S   I   R
1  199   1   0
2  199   1   0
3  198   2   0
4  197   3   0
5  188  12   0
6  169  29   2
7  140  56   4
8  103  86  11
9   68 116  16
10  42 131  27
11  29 133  38
12  15 133  52
13  11 125  64
14   7 121  72
15   2 118  80
16   1 107  92
17   1  99 100
18   1  85 114
19   1  74 125
20   1  69 130
21   0  68 132
22   0  61 139
23   0  59 141
24   0  52 148
25   0  48 152
26   0  44 156
27   0  42 158
28   0  35 165
29   0  35 165
30   0  34 166
31   0  32 168
32   0  28 172
33   0  26 174
34   0  24 176
35   0  22 178
36   0  20 180
37   0  18 182
38   0  17 183
39   0  15 185
40   0  11 189
41   0   9 191
42   0   8 192
43   0   8 192
44   0   8 192
45   0   8 192
46   0   7 193
47   0   7 193
48   0   5 195
49   0   5 195
50   0   5 195
51   0   5 195
52   0   5 195
53   0   4 196
54   0   4 196
55   0   4 196
56   0   3 197
57   0   2 198
58   0   2 198
59   0   2 198
60   0   2 198
61   0   2 198
62   0   2 198
63   0   2 198
64   0   2 198
65   0   1 199
66   0   1 199
67   0   1 199
68   0   1 199
69   0   1 199
70   0   1 199
71   0   1 199
72   0   1 199
73   0   1 199
74   0   1 199
75   0   1 199
76   0   1 199
77   0   1 199
78   0   1 199
79   0   1 199
80   0   1 199
81   0   1 199
82   0   1 199
83   0   1 199
84   0   1 199
85   0   0 200
86   0   0 200

epimdr documentation built on March 26, 2020, 7:41 p.m.

Related to NetworkSIR in epimdr...