-
Notifications
You must be signed in to change notification settings - Fork 0
/
ageSPVL_m23.R
115 lines (95 loc) · 3.73 KB
/
ageSPVL_m23.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
library(evonet)
options(error=recover) # go into debug mode on error
#--------------------------------------------------------------
initial_pop = 1000
mean_sqrt_age_diff = 0.6
meandeg = 0.7
param_list=list(
model_name = "m23",
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 = 0.4,
max_age_sex = 55,
relation_dur = 200,
tx_type = "random",
mean_trtmnt_delay = 0,
start_treatment_campaign = 1,
proportion_treated = 0.5,
#testing params
testing_model = "interval",
mean_test_interval_male = 365,
# "diagnosis.FUN" = social_testing_diagnosis_module, #change from PrEP sims
# "treatment.FUN" = social_treatment_module_john_v3,
nsims = 1,
initial_pop = initial_pop,
initial_infected = 200,
n_steps = 365*20,
popsumm_frequency=30,
fast_edgelist=T,
plot_nw=F,
save_vl_list=TRUE
)
evoparams <- do.call(evonet_setup,param_list)
nw <- nw_setup(evoparams)
evoparams$start_treatment_campaign = 1
evoparams$prob_eligible_ART = 1.0
evoparams$tx_limit = "percentage"
evoparams$vl_full_supp = 10
evoparams$tx_schedule_props = c("F"=0,"V"=1.0,"N"=0,"P"=0) # Percentage of people who always (F), sometimes (V), or never (N) take therapy
evoparams$prob_tx_droput = 0.10 # Probability of "V"-type agent discontinuing therapy over the course of a year
#evoparams$proportion_treated_begin = 0.5 # Treated before gradual ramp-up
#evoparams$prop_tx_before=0.5
evoparams$yearly_incr_tx = 0.0 # No annual increase in the number of people being treated after the TasP campaign
#### THIS IS IT
evoparams$proportion_treated = 0.15
if(F) {
evoparams$proportion_treated = 0.5
evoparams$prob_tx_droput = 0.10 # Probability of "V"-type agent discontinuing therapy over the course of a year
evoparams$proportion_treated_begin = 0.5 # Treated before gradual ramp-up
evoparams$prop_tx_before=0.5
evoparams$start_treat_before_big_campaign = 0 # Start time of gradual ramp-up prior to the start of the big TasP campaign (this part random)
evoparams$start_treatment_campaign = 365*100 # Start time of big TasP campaign (this part depends on tx_type)
# Other parameters affecting treatment
evoparams$prob_care = 1.0 # Percent population that could get treated given "all out" campaign
evoparams$prob_eligible_ART = 1.0
evoparams$tx_limit = "absolute_num" # Choices: "absolute_num" or percentage"
evoparams$vl_full_supp = 10
evoparams$tx_schedule_props = c("F"=0,"V"=1.0,"N"=0,"P"=0) # Percentage of people who always (F), sometimes (V), or never (N) take therapy
}
#evoparams$yearly_incr_tx = 0.0 # No annual increase in the number of people being treated after the TasP campaign
#evoparams$mean_trtmnt_delay = 15 # Delay betweent diagnosis and start of treatment
modules <- c(
"aging",
"testing",
#"adherence",
"treatment_dropout",
"targeted_treatment2",
"viral_update_delayed_rebound",
"cd4_update2", # viral_update_cd4_daily
"coital_acts",
"transmission",
"deaths",
"births",
"summary_module")
evomodel <- evorun(modules,evoparams,nw)
ageSPVL_m23 <- evomodel
save(ageSPVL_m23, file="ageSPVL_m23.rda")
aa=evomodel
bb=aa$pop[[1]]
bb$tx_stop_time
#edit(treatment_dropout)
bb$treated
bb$tx_init_time
table(bb$tx_schedule)
if(evoparams$save_vl_list==TRUE){
plot_vl_trajectories(model=evomodel,sim=1,
outpath=evoparams$output_path,
name="ageSPVL_vl_m23")
}