-
Notifications
You must be signed in to change notification settings - Fork 0
/
ageSPVL_m18.R
52 lines (44 loc) · 1.13 KB
/
ageSPVL_m18.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
library(evonet)
options(error=browser) # go into debug mode on error
#--------------------------------------------------------------
initial_pop = 1000
mean_sqrt_age_diff = 0.6
meandeg = 0.7
param_list=list(
model_name = "m18",
nw_form_terms = "~edges+absdiff('sqrt_age') + offset(nodematch('role',diff=TRUE, keep=1:2))",
target_stats = c(initial_pop*meandeg/2, mean_sqrt_age_diff*initial_pop*meandeg/2),
#mean_sex_acts_day = 0.2,
min_age = 18,
max_age = 55,
#age_dist = seq(50, 10, -10/9)/1110,
initial_agedata_male = "linear_decrease",
nw_coef_form = c(-Inf, -Inf),
prob_sex_by_age = TRUE,
prob_sex_age_19 = 1,
max_age_sex = 29,
relation_dur = 100,
nsims = 1,
initial_pop = initial_pop,
initial_infected = 100,
n_steps = 365*20,
popsumm_frequency=30,
fast_edgelist=T,
plot_nw=F
)
evoparams <- do.call(evonet_setup,param_list)
nw <- nw_setup(evoparams)
modules <- c(
"aging",
"testing",
"treatment",
"viral_update",
"coital_acts",
"transmission",
"deaths",
"births",
"summary_module"
)
evomodel <- evorun(modules,evoparams,nw)
ageSPVL_m18 <- evomodel
save(ageSPVL_m18, file="ageSPVL_m18.rda")