/
simpact_simulationdetails.rst
2333 lines (1891 loc) · 125 KB
/
simpact_simulationdetails.rst
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.. This is just a definition of |br| to be able to force a line break somewhere
.. |br| raw:: html
<br/>
.. _simdetails:
Simulation details
==================
.. _generalflow:
General flow of a simulation
----------------------------
As one might expect, a population consists of persons which can either be
male or female. Persons can be introduced into the simulation in two ways:
- During the initialization of the simulation, in which case persons with certain ages
(drawn from a distribution) are added to the simulation.
- When the simulation is running, and the birth of a new person occurs.
Once born, a person will become sexually active when a :ref:`debut <debut>` event is triggered.
If the person is introduced into the population at the start of the simulation, and the age
exceeds the debut age, this event is no longer scheduled. Every person always has a 'normal'
:ref:`mortality event <mortality>` scheduled, which corresponds to a cause of death other than AIDS.
To get the HIV epidemic started, an :ref:`HIV seeding event <hivseeding>` can be scheduled.
When this event is triggered, a number of people in the existing population will be
marked as being HIV-infected. An infected person will go through a number of infection
stages. Until a :ref:`chronic stage event <chronicstage>` is triggered the person is in the
acute HIV infection stage; afterwards he will be in the chronic stage. A specific amount
of time before dying of AIDS, an :ref:`AIDS stage event <aidsstage>` is triggered, marking the
transition of the chronic HIV stage to the actual AIDS stage. Even closer to the AIDS
related death, another :ref:`AIDS stage event <aidsstage>` is triggered, after which the person is in the
'final AIDS stage', and will be too ill to e.g. form sexual relationships. When the person
dies of AIDS, the :ref:`AIDS mortality event <aidsmortality>` is fired. Note that it is always
possible that the person dies from other causes; in that case the 'normal'
:ref:`mortality event <mortality>` will get triggered sooner.
If two persons of opposite gender are sexually active, a relationship can be formed. If this
is the case, a :ref:`formation event <formation>` will be triggered. When a relationship between two people
exists, it is possible that conception takes place, in which case a :ref:`conception event <conception>`
will be triggered. If this happens, a while later a :ref:`birth event <birth>` will be fired,
and a new person will be introduced into the population. In case one of the partners in
the relationship is HIV infected, transmission of the virus may occur. If so, a
:ref:`transmission event <transmission>` will fire, and the newly infected person will
go through the different infection stages as described earlier. Of course, it is also
possible that the relationship will cease to exist, in which case a :ref:`dissolution event <dissolution>`
will be fired. Note that in the version at the time of writing, there is no
mother-to-child-transmission (MTCT).
Starting treatment and dropping out of treatment is managed by another sequence of events.
When a person gets infected, either by :ref:`HIV seeding <hivseeding>` or by :ref:`transmission <transmission>`,
first a :ref:`diagnosis event <diagnosis>` is scheduled. If this is triggered, the person is
considered to feel bad enough to go to a doctor and get diagnosed as being infected with
HIV. If this happens, an :ref:`HIV monitoring event <monitoring>` is scheduled to monitor the
progression of the HIV infection. If the person is both eligible and willing to receive
antiretroviral therapy, treatment is started; if not, a new monitoring event will be
scheduled. In case treatment is started, no more monitoring events will be scheduled, but
the person will have a chance to drop out of treatment, in which case a :ref:`dropout event <dropout>`
is triggered. When a person drops out of treatment, a new :ref:`diagnosis event <diagnosis>`
will be scheduled. The rationale is that when a person drops out, he may do so because
he's feeling better thanks to the treatment. After dropping out, the condition will
worsen again, causing him to go to a doctor, get re-diagnosed and start treatment again.
Initialization of the simulation
--------------------------------
During the initialization of the simulated population, the following steps will take place:
- Create the initial population:
- A number of men (``population.nummen``) and women
(``population.numwomen``) are added to the population, of which the age is drawn from
an age distribution file (``population.agedistfile``). Depending on the :ref:`debut age <debut>`,
people may be marked as being 'sexually active'.
- The initial population size will be remembered for use in e.g. the :ref:`formation hazard <formation>`.
During the simulation, this size can be :ref:`synchronized <syncpopstats>` using another event.
- Schedule the initial events:
- For each person, a 'normal' :ref:`mortality event <mortality>` will be scheduled, and if needed,
a :ref:`debut event <debut>` will be scheduled.
- Get the HIV epidemic started at some point, by scheduling an :ref:`HIV seeding event <hivseeding>`.
- If specified, schedule the next :ref:`simulation intervention <simulationintervention>`. This is a
general way of changing simulation settings during the simulation.
- Schedule a :ref:`periodic logging event <periodiclogging>` if requested. This will log some
statistics about the simulation at regular intervals.
- In case the population size is expected to vary much, one can request an event to
:ref:`synchronize <syncpopstats>` the remembered population size for use in other events.
- For pairs of sexually active persons, depending on the :ref:`'eyecap' <eyecap>` settings
(``population.eyecap.fraction``), schedule :ref:`formation events <formation>`
Once the simulation is started, it will run either until the number of years specified in
``population.simtime`` have passed, or until the number of events specified in
``population.maxevents`` have been executed.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``population.nummen`` (100): |br|
The initial number of men when starting the simulation.
- ``population.numwomen`` (100): |br|
The initial number of women when starting the simulation.
- ``population.simtime`` (15): |br|
The maximum time that will be simulated, specified in years.
- ``population.maxevents`` (-1): |br|
If greater than zero, the simulation will stop when this
number of events has been executed. This is not used if negative.
- ``population.agedistfile`` ( "sa_2003.csv" in the Simpact Cyan data directory): |br|
This is
a CSV file with three columns, named 'Age', 'Percent Male' and 'Percent Female'. The
values of the age are specified in years and should be increasing; the specified percentages are deemed valid
until the next age. The default is the age distribution in South Africa from 2003.
Note that **when using the R or Python method** to start simulations, you need to
specify the age distribution as a parameter to the ``run`` function, if you want
to use any other distribution than the default. See the :ref:`R section <startingfromR>`
or :ref:`Python section <startingfromPython>` for more information.
.. _eyecap:
- ``population.eyecap.fraction`` (1): |br|
This parameter allows you to
specify with how many persons of the opposite sex (who are sexually active),
specified as a fraction, someone can possibly have relationships. If set to the
default value of one, every man can possibly engage in a relationship with every
woman (and vice versa) causing :math:`O(N^2)` formation events to be scheduled.
For larger population sizes this large amount of events will really slow things down,
and because in that case it is not even realistic that everyone can form a relationship
with everyone else, a lower number of this 'eyecap fraction' (for which `'blinders' or 'blinkers' <http://en.wikipedia.org/wiki/Blinkers_%28horse_tack%29>`_
is a better name) will cause a person to be interested in fewer people.
When each person is assigned the trivial location (0, 0), the people for such a
limited set of interests are simply chosen at random. If a non-trivial 2D distribution is used
(see the section about :ref:`the geographical location <geodist>` of a person), the
set of these interests will preferably be chosen closer to the location of the
person in question. To do this, instead of a really accurate ordering of everyone
based on their distance (which would become very slow for large populations), an
approximate :ref:`coarse grid <coarsegrid>` is used instead (see below).
In case you want to disable relationship formation altogether, you can set this value to zero.
.. _coarsegrid:
- ``population.coarsemap.subdivx`` (20): |br|
As described above, in case the :ref:`'eyecap' <eyecap>` setting is used, each person
will have a set of interests assigned to them. For issues of speed, a coarse grid
is used to get an approximation of the ordering by distance.
To do so, a 2D grid is made that covers the region of the persons' locations,
and each person is assigned to a corresponding grid cell. To get an approximate
ordering of other people with respect to a certain location, the grid cells themselves
are ordered and people are selected based on this ordering to create the set of
'interests'.
The value of this parameter describes the number of grid cells in the x-direction.
- ``population.coarsemap.subdivy`` (20): |br|
Similar to the previous setting, the value of this parameter describes the number of
grid cells in the y-direction.
.. _populationmsm:
- ``population.msm`` ('no'): |br|
If ``no`` (the default), only heterosexual relationships will be possible. If set to
``yes``, MSM relationships will be possible as well.
.. _person:
Per person options
------------------
As explained before, a population is central to the Simpact Cyan simulation and
such a population consists of persons, each of which can be a man or a woman.
During the simulation, these persons have many properties: gender, age,
the number of relationships, which partners, etc. Several properties of persons
can be defined using configuration options, which are discussed in this section.
.. _viralload:
HIV Viral load related options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Several options are related to the viral load of a person. When a person becomes
HIV-infected, either by an :ref:`HIV seeding event <hivseeding>` or because of
:ref:`transmission <transmission>` of the virus, a set-point viral load value is
chosen and stored for this person. When a person receives treatment, the viral
load is lowered (see the :ref:`monitoring event <monitoring>`) and if the person
drops out of treatment the initially chosen set-point viral load is restored.
.. _viralloadx:
The set-point viral load is the viral load that the person has during the
chronic stage. In the acute stage or in the AIDS stages, the configuration
values ``person.vsp.toacute.x``, ``person.vsp.toaids.x`` and ``person.vsp.tofinalaids.x``
cause the real viral load to differ from the set-point viral load in such a
way that the transmission probability (see the :ref:`transmission event <transmission>`)
is altered: the hazard for transmission will increase by the factor ``x`` that
is defined this way. There is a limit to the new viral load that can arise
like this, which can be controlled using the option ``person.vsp.maxvalue``.
There are currently two models for initializing the set-point viral load and
determining what happens during transmission of the viral load, i.e. to
which degree the set-point viral load of the infector is inherited. The model
type is controlled using the option ``person.vsp.model.type`` which can be
either ``logdist2d`` or ``logweibullwithnoise``. In case it's ``logdist2d``, a two
dimensional probability distribution is used to model the transmission and
initialization of the (base 10 logarithm) set-point viral load values:
.. math::
{\rm prob}(v_{\rm infector}, v_{\rm infectee})
The precise probability distribution that is used can be controlled using the
``person.vsp.model.logdist2d.dist2d.type`` config setting.
By default, when an :ref:`HIV seeding event <hivseeding>` takes place, the base 10
logarithm of a set-point viral load value is chosen from the marginal distribution:
.. math::
{\rm prob}(v_{\rm infectee}) = \int {\rm prob}(v_{\rm infector}, v_{\rm infectee}) d v_{\rm infector}
In case another distribution needs to be used, this behavour can
be overridden by setting ``person.vsp.model.logdist2d.usealternativeseeddist`` to
``yes`` and configuring ``person.vsp.model.logdist2d.alternativeseed.dist.type`` to
the desired one dimensional probability distribution (again for the base 10
logarithm of the set-point viral load).
Upon transmission, the associated conditional probability is used:
.. math::
{\rm prob}(v_{\rm infectee} | v_{\rm infector})
If the other viral load model (``logweibullwithnoise``) is used, the base 10 logarithm of
the set-point viral load in case of a seeding event, is chosen from from a
`Weibull distribution <http://en.wikipedia.org/wiki/Weibull_distribution>`_ with
parameters specified by ``person.vsp.model.logweibullwithnoise.weibullscale``
and ``person.vsp.model.logweibullwithnoise.weibullshape``. Upon transmission,
the infectee inherits the the set-point viral load value from the infector,
but some randomness is added. The added value is drawn from a normal distribution
of which the mean is zero, and the standard deviation is set to a fraction of
the set-point viral load value of the infector (controlled by
``person.vsp.model.logweibullwithnoise.fracsigma``). In this approach, it is
possible that the new set-point viral load becomes negative, which is not
realistic of course. The value of ``person.vsp.model.logweibullwithnoise.onnegative``
determines what needs to be done in this case: if it's ``logweibull``, a new
set-point viral load value will be chosen from the Weibull distribution, in the
same way as what happens during HIV seeding. In case it's ``noiseagain``, a new
noise value is added to the infector's set-point viral load.
.. _cd4count:
When a person becomes HIV-infected, the simulation already fixes the CD4 values
at the time of infection (controlled by ``person.cd4.start.dist.type``) and
at the time of AIDS related death (controlled by ``person.cd4.end.dist.type``).
At any other point in time, the CD4 count of that person will simply be a
linear interpolation between the initial value and the value at time of death.
Note that the time of AIDS-related death can vary due to treatment or
dropping out.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``person.vsp.toacute.x`` (10.0): |br|
The set-point viral load of a person is that person's reference value. When
the viral load during the acute stage is needed, it is determined in such a
way that the :ref:`transmission hazard <transmission>` increases by this factor,
possibly clipped to a maximum value (see ``person.vsp.maxvalue``).
- ``person.vsp.toaids.x`` (7.0): |br|
The set-point viral load of a person is that person's reference value. When
the viral load during the initial AIDS stage is needed, it is determined in such a
way that the :ref:`transmission hazard <transmission>` increases by this factor,
possibly clipped to a maximum value (see ``person.vsp.maxvalue``).
- ``person.vsp.tofinalaids.x`` (12.0): |br|
The set-point viral load of a person is that person's reference value. When
the viral load during the final AIDS stage is needed, it is determined in such a
way that the :ref:`transmission hazard <transmission>` increases by this factor,
possibly clipped to a maximum value (see ``person.vsp.maxvalue``).
- ``person.vsp.maxvalue`` (1e9): |br|
When determining the viral load during acute, AIDS or final AIDS stages (see
previous options), a check is done so that the value does not exceed this maximum.
If necessary, the calculated viral load value is clipped to this maximum value.
- ``person.vsp.model.type`` ('logdist2d'): |br|
When initializing the set-point viral load value during an :ref:`HIV seeding event <hivseeding>`
or due to :ref:`transmission <transmission>` of the virus, one of two methods will
be used. As explained above, valid options here are ``logdist2d`` and ``logweibullwithnoise``.
- ``person.vsp.model.logdist2d.dist2d.type`` ('binormalsymm' between 1 and 8, with mean 4, sigma 1 and correlation 0.33): |br|
This is only used if the model type is set to ``logdist2d``. It specifies the two
dimensional distribution that should be used for HIV transmission, and that can be used
for initialization during an :ref:`HIV seeding event <hivseeding>`. The distribution
is used to pick set-point viral load values on a base 10 logarithmic scale. As
:ref:`explained before <probdists>`, other :ref:`two dimensional distribution <prob2d>`
than the default can be used as well.
- ``person.vsp.model.logdist2d.usealternativeseeddist`` ('no'): |br|
In the ``logdist2d`` model, by default the marginal distribution is used to initialize
set-point viral load values when HIV seeding is triggered. If a different one dimensional
distribution should be used for this, this option needs to be set to ``yes``, and the
appropriate distribution should be configured in ``person.vsp.model.logdist2d.alternativeseed.dist.type``.
- ``person.vsp.model.logdist2d.alternativeseed.dist.type`` ('fixed'): |br|
In case the previous option is set to yes, you need to set this to a valid distribution.
The default ``fixed`` distribution with a value of 0 is *not* a good choice here.
- ``person.vsp.model.logweibullwithnoise.weibullscale`` (5.05): |br|
In case ``person.vsp.model.type`` is set to ``logweibullwithnoise``, this controls
the scale parameter that is used for the Weibull distribution to initialize
set-point viral load values (on a base 10 logarithmic scale).
- ``person.vsp.model.logweibullwithnoise.weibullshape`` (7.2): |br|
In case ``person.vsp.model.type`` is set to ``logweibullwithnoise``, this controls
the shape parameter that is used for the Weibull distribution to initialize
set-point viral load values (on a base 10 logarithmic scale).
- ``person.vsp.model.logweibullwithnoise.fracsigma`` (0.1): |br|
In case ``person.vsp.model.type`` is set to ``logweibullwithnoise``, upon transmission
of the virus, the set-point viral load is inherited but some noise is added.
As explained earlier, this specifies the relative size of the noise.
- ``person.vsp.model.logweibullwithnoise.onnegative`` ('logweibull'): |br|
After adding noise in the ``logweibullwithnoise`` model, it is possible that the
new set-point viral load is a negative value, which is invalid. This parameter
specifies what needs to be done in this case. If it's ``logweibull``, then the
Weibull distribution is used to choose a new set-point viral load again. If
the setting is ``noiseagain``, a new noise value will be used, until the new
set-point viral load is a valid number.
- ``person.cd4.start.dist.type`` ('uniform' between 700 and 1300): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` which is used to draw the
initial CD4 value from. This is the CD4 value the person has at the time of
infection.
- ``person.cd4.end.dist.type`` ('uniform' between 0 and 100): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` which is used to draw the
final CD4 value from. This is the CD4 value the person will have when he dies from
AIDS related causes.
.. _personhsv2opts:
HIV and HSV2 related settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For the :ref:`HIV transmission <transmission>` hazard, person-dependent values for susceptibility for both infections and susceptibility for HIV only can be set. These values will be drawn from the distributions specified by ``person.hiv.b0.dist.type`` and ``person.hiv.b1.dist.type`` respectively, and their corresponding parameters.
For the :ref:`HSV2 transmission <hsv2transmission>` hazard, a person-dependent baseline
value can be set. This value will be drawn from the distribution specified
by ``person.hsv2.a.dist.type`` and its corresponding parameters. Furthermore, a person-dependent value for susceptibility for HSV2 only can be set. This value will be drawn from a distribution specified by ``person.hsv2.b2.dist.type`` and its corresponding parameters. Furthermore, the value for susceptibility for both infections, drawn from the distribution specified by ``person.hiv.b0.dist.type`` will also be included in the :ref:`HSV2 transmission <hsv2transmission>` hazard.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``person.hiv.b0.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` that is used to draw the person dependent value for susceptibility for both infections from the :ref:`HIV transmission <transmission>` and the :ref:`HSV2 transmission <hsv2transmission>` hazards.
- ``person.hiv.b1.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` that is used to draw the person dependent value for susceptibility for HIV only from the :ref:`HIV transmission <transmission>` hazard.
- ``person.hsv2.a.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` that is used to draw
the person dependent baseline value from for the :ref:`HSV2 transmission <hsv2transmission>`
hazard.
- ``person.hsv2.b2.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` that is used to draw the person dependent value for susceptibility for HSV2 only for the :ref:`HSV2 transmission <hsv2transmission>` hazard.
If you want to include the influence of susceptibility in your simulations, appropriate distributions for :math:`b_{\rm 0}`, :math:`b_{\rm 1}` and :math:`b_{\rm 2}` are normal distributions, so that the expected values of :math:`\exp(b_{\rm 0}+b_{\rm 1})` and :math:`\exp(b_{\rm 0}+b_{\rm 2})` are both equal to 1. For :math:`b_{\rm i} \sim\ N\left(\mu_{i},\sigma^{2}_{i}\right)`, normal probability distributions with :math:`\mu_{i}= - \sigma^{2}_{i}/2` (:math:`i=0,1,2`) fulfill these condions. For more information, see `probability_distributions.pdf <_static/probability_distributions.pdf>`_.
Relationship related settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _eagerness:
In some hazards, the eagerness of a person to form a relationship is used, to
allow for per-person variation. Such an eagerness value can be defined for
heterosexual relationships (``person.eagerness.man.dist.type`` and
``person.eagerness.woman.dist.type``) and homosexual relationships
(``person.eagerness.man.msm.dist.type`` and ``person.eagerness.woman.wsw.dist.type``)
independently, or a correlation can be introduced by using a joint distribution
(``person.eagerness.man.joint.dist2d`` and ``person.eagerness.woman.joint.dist2d``).
In the latter case, a pair of numbers is generated from a distribution,
of which the first number is interpreted as the eagerness for a heterosexual
relationship and the second for a homosexual relationship. By default, independent
random numbers are used, but this can be changed using the configuration
value of ``person.eagerness.man.type`` and ``person.eagerness.woman.type``.
.. _personagegap:
Similarly, preferred age gaps can be used in hazards, and these also can be
defined for each person separately. Moreover, they can differ between heterosexual
relationships (``person.agegap.man.dist.type`` and ``person.agegap.woman.dist.type``)
and homosexual ones (``person.agegap.man.msm.dist`` and ``person.agegap.woman.wsw.dist``).
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``person.eagerness.man.type`` ('independent'): |br|
This can be set to ``independent`` or ``joint``, and specifies if the eagerness
values for heterosexual and homosexual relationship formation for men should be chosen
independently or from a joint distribution.
- ``person.eagerness.man.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the eagerness parameter for
a man and for heterosexual relationships is chosen from. Is only used if
``person.eagerness.man.type`` is set to ``independent``.
- ``person.eagerness.man.msm.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the eagerness parameter for
a man and for homosexual relationships is chosen from. Is only used if
``person.eagerness.man.type`` is set to ``independent``.
- ``person.eagerness.man.joint.dist2d`` ('fixed' with value (0,0)): |br|
This is only used if ``person.eagerness.man.type`` is set to ``joint``. In this case
the eagerness values for a man will be based on a pair of numbers chosen from a
:ref:`two dimensional distribution <prob2d>`, of which the first number will be
interpreted as the eagerness for a heterosexual relationship and the second
one as the eagerness for a homosexual relationship.
- ``person.eagerness.woman.type`` ('independent'): |br|
This can be set to ``independent`` or ``joint``, and specifies if the eagerness
values for heterosexual and homosexual relationship formation for women should be chosen
independently or from a joint distribution.
- ``person.eagerness.woman.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the eagerness parameter for
a woman and for heterosexual relationships is chosen from. Is only used if
``person.eagerness.woman.type`` is set to ``independent``.
- ``person.eagerness.woman.wsw.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the eagerness parameter for
a woman and for homosexual relationships is chosen from. Is only used if
``person.eagerness.woman.type`` is set to ``independent``.
- ``person.eagerness.woman.joint.dist2d`` ('fixed' with value (0,0)): |br|
This is only used if ``person.eagerness.woman.type`` is set to ``joint``. In this case
the eagerness values for a woman will be based on a pair of numbers chosen from a
:ref:`two dimensional distribution <prob2d>`, of which the first number will be
interpreted as the eagerness for a heterosexual relationship and the second
one as the eagerness for a homosexual relationship.
- ``person.agegap.man.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the preferred age gap for
a man, for heterosexual relationships, is chosen from.
- ``person.agegap.man.msm.dist`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the preferred age gap for
a man, for homosexual relationships, is chosen from.
- ``person.agegap.woman.dist.type`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the preferred age gap for
a woman, for heterosexual relationships, is chosen from.
- ``person.agegap.woman.wsw.dist`` ('fixed' with value 0): |br|
Specifies the :ref:`one dimensional distribution <prob1d>` the preferred age gap for
a woman, for homosexual relationships, is chosen from.
Various other settings
^^^^^^^^^^^^^^^^^^^^^^
.. _artacceptthreshold:
Here, we'll discuss a few per-person settings which do not fall into the categories
above. The first one is called ``person.art.accept.threshold.dist.type`` and is related
to how willing a person is to start treatment when offered. When a person is introduced
into the population, a number is picked from the specified distribution. This number
is fixed for this person, and will no longer change during the simulation. Then, when
the person is offered treatment, a new random number between 0 and 1 is chosen uniformly.
If this number is below the threshold value that was determined earlier, treatment
will be accepted, otherwise it is rejected. By default, the ``person.art.accept.threshold.dist.type``
setting always sets the threshold at 0.5, causing each person to have a 50% chance of
accepting treatment when offered.
.. _geodist:
When a person is added to the population, a location is chosen for this person from
the :ref:`two dimensional distribution <prob2d>` that is specified in ``person.geo.dist2d.type``.
In the default Simpact Cyan simulation, this location is not yet used in any hazard,
and the default location is put to (0, 0) for everyone. Because the location is written
to :ref:`the person log file <personlog>`, it can be (ab)used to test two dimensional
distributions, like we did in the example for the :ref:`discrete two dimensional distribution <prob2ddiscrete>`.
.. _survdist:
By default, the survival time for a person after becoming HIV infected, is given
by a simple relation based on the set-point viral load. Because an exact mapping
from viral load to survival time is not that realistic, you can add some randomness
to this relation using the distribution in `person.survtime.logoffset.dist.type`.
When a person becomes infected, a random number is drawn from this distribution
and will correspond to an offset in the survival time, as explained in the
:ref:`AIDS mortality event <aidsmortality>`. The following IPython notebook illustrates
the effect: `survivaltimernd.ipynb <_static/survivaltimernd.ipynb>`_.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``person.art.accept.threshold.dist.type`` ('fixed' with value 0.5): |br|
This specifies the :ref:`one dimensional distribution <prob1d>` that is used to
choose the ART acceptance threshold for each person, as explained earlier.
- ``person.geo.dist2d.type`` ('fixed' with value (0, 0)): |br|
This :ref:`two dimensional distribution <prob2d>` is used to assign a geographic
location to each person. In the main Simpact Cyan simulation, this is currently
not used in any hazard.
- ``person.survtime.logoffset.dist.type`` ('fixed' with value 0): |br|
This :ref:`one dimensional distribution <prob1d>` can be used to add some randomness
to the :ref:`survival time <aidsmortality>` until dying of AIDS related causes after
becoming HIV infected.
.. _events:
Events
------
The simulation advances by figuring out which event should take place next, followed by
executing code for that event. At the start, many initial events
are typically scheduled, some set up to fire at a specific simulation time, some based on
a hazard which may change during the simulation. During the simulation, new events
will get scheduled, and some already scheduled
events will be discarded (for example, in case someone dies, no other events involving this
person will need to get executed anymore).
Below you can find an overview of the events that are currently used in the simulation.
The relevant configuration options are mentioned as well.
.. _aidsmortality:
AIDS mortality event
^^^^^^^^^^^^^^^^^^^^
When a person gets infected with HIV, an HIV-based time of death is determined. This time
of death is determined as the time of infection plus the survival time, which is given by
the following formula (based on :ref:`[Arnaout et al.] <ref_arnaout>`):
.. math::
t_{\rm survival} = \frac{C}{V_{\rm sp}^{-k}} \times 10^{\rm x}
In this formula, :math:`C` and :math:`k` are parameters which can be configured using the settings
``mortality.aids.survtime.C`` and ``mortality.aids.survtime.k`` respectively. The :math:`x` parameter
is :ref:`determined per person <survdist>` allowing some randomness in the formula: it
determines an offset on a logarithmic scale. By default, this value is zero however,
causing a very strict relationship between :math:`V_{\rm sp}` and :math:`t_{\rm survival}`. The value of
:math:`V_{\rm sp}` is the set-point viral load, :ref:`first determined at the time of infection <viralload>`
and in general
different per person. The value of the set-point viral load can change when treatment is involved: when a
person is receiving treatment, the viral load will go down, causing him to live longer.
When a person drops out of treatment, the viral load goes up again and the expected
lifespan shrinks.
To illustrate how this is taken into account, consider a person that has an initial
viral load that causes a survival time of 10 years. Suppose that after 1 year, treatment is started and that
using the formula above the survival time would become 50 years. When treatment got
started, 10% of the survival time had already passed and we take this into account.
So after starting treatment, the AIDS related mortality would be scheduled after
45 years. If the person drops out of treatment 10 years later, 20% of the remaining
survival time has passed, which translates to 2 years in terms of the original viral
load. This means that still 7 years will remain until the AIDS based mortality event
is fired. Note that using this approach, one will never encounter the situation where
the time of death has already passed when increasing the viral load.
You can find an IPython notebook that illustrates this example here:
`aidsmortalityexample.ipynb <_static/aidsmortalityexample.ipynb>`_
An AIDS based mortality event will be scheduled to fire at the specified time, which
may still change as explained above. When it fires, the person is considered to
have died from AIDS. Note that this does
not influence the 'normal' :ref:`mortality <mortality>` event, which can still get triggered
sooner to allow for another cause of death.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``mortality.aids.survtime.C`` (1325.0): |br|
The value of :math:`C` in the formula for :math:`t_{\rm survival}`.
- ``mortality.aids.survtime.k`` (-0.49): |br|
The value of :math:`k` in the formula for :math:`t_{\rm survival}`.
.. _aidsstage:
AIDS stage event
^^^^^^^^^^^^^^^^
When a person gets infected with HIV, he will first be in the acute phase of infection,
then in the chronic stage, and after a while in the AIDS stage. The AIDS stage is actually
split in two separate phases: an AIDS stage, and a final AIDS stage. In this last period,
the person is deemed to be too ill to e.g. form sexual relationships.
The first AIDS stage gets scheduled when the :ref:`chronic stage event <chronicstage>` fires,
and is scheduled to get triggered at a specific time (`aidsstage.start`) before the
:ref:`AIDS related death <aidsmortality>` takes place. When this event fires, another one
is scheduled to mark the transition to the final AIDS stage, also set to take place
a specific amount of time (``aidsstage.final``) before the AIDS based death. Because the
time of the AIDS related death can still change when treatment is involved, these fire times
can also still change.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``aidsstage.start`` (1.25): |br|
The time before the AIDS related death a person will advance
to the AIDS stage of infection. Defaults to 15 months.
- ``aidsstage.final`` (0.5): |br|
The time before the AIDS related death a person will advance
to the final AIDS stage of infection. Defaults to 6 months.
.. _birth:
Birth event
^^^^^^^^^^^
After a :ref:`conception event <conception>` is triggered, a new birth event will be scheduled,
so that the woman in the relationship will give birth to a new person a specific time
(based on ``birth.pregnancyduration.dist.type``) later. The gender is determined by the
``birth.boygirlratio`` configuration setting.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``birth.boygirlratio`` (1.0/2.01): |br|
The probability of the newly born person to be a man.
- ``birth.pregnancyduration.dist.type`` (defaults to 'fixed' with a value of 268/365): |br|
With this parameter you can specify the distribution to be used when determining
how long the pregnacy should be, before firing the birth event. By default, the
fixed value of 268/365 is used, but :ref:`other distributions <prob1d>` and related parameters
can be used as well.
Check stopping criterion event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This event allows you to terminate a simulation if a certain population size
(``checkstop.max.popsize``) or real-world elapsed time (``checkstop.max.runtime``)
is exceeded. To enable this, the ``checkstop.interval`` parameter must be
set to a positive value. If so, at regularly spaced times (simulation time)
this check will be performed.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``checkstop.interval`` (-1): |br|
To enable this event, set the value to a positive value. If enabled, this
event will fire at simulation times that are multiples of this interval,
at which time checks on the population size and/or running time are performed.
- ``checkstop.max.runtime`` (inf): |br|
When the event fires, the elapsed real-world time since the start of the
simulation program will be compared to this value. If it exceeds it, the simulation
will be aborted.
- ``checkstop.max.popsize`` (inf): |br|
When the event fires, the population size will be compared to this value. If it
exceeds it, the simulation will be aborted.
.. _chronicstage:
Chronic AIDS stage event
^^^^^^^^^^^^^^^^^^^^^^^^
When a person becomes HIV infected, he starts out in the acute stage of the disease.
This 'chronic stage' event is then scheduled to mark the transition from the acute
stage to the chronic stage, which will
fire a specific amount of time (``chronicstage.acutestagetime``) later.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``chronicstage.acutestagetime`` (0.25): |br|
This is the duration of the acute HIV stage, before transitioning to the chronic
stage. The default is three months.
.. _conception:
Conception event
^^^^^^^^^^^^^^^^
When a :ref:`formation event <formation>` has fired (so a man and a woman are in a sexual
relationship), a conception event will be scheduled unless the woman is already
pregnant. This is a hazard-based event, and its hazard at time :math:`t` is defined as:
.. math::
{\rm hazard} = \exp\left(\alpha_{\rm base}
+ \alpha_{\rm age,man}\left(t - t_{\rm birth,man}\right)
+ \alpha_{\rm age,woman}\left(t - t_{\rm birth,woman}\right)
+ \alpha_{\rm wsf}\times{\rm WSF}
+ \right(t-t_{\rm ref}\left)\beta
\right)
which is a time-dependent hazard of type
.. math::
{\rm hazard} = \exp(A+Bt)
By default, only the :math:`\alpha_{\rm base}` value is used (``conception.alpha_base``), resulting in a constant
hazard, but other factors can be used as well: the age of the man and woman in the
relationship can be taken into account using ``conception.alpha_ageman`` and
``conception.alpha_agewoman``, the weekly sex frequency (WSF) using ``conception.alpha_wsf`` and the
'age' of the relationship using ``conception.beta`` (:math:`t_{\rm ref}` is set to the time
the relationship started).
The value of :math:`{\rm WSF}` itself is currently chosen from the distribution specified
in ``conception.wsf.dist.type``, at the time the event gets scheduled.
When a conception event fires, so when actual conception takes place, a :ref:`birth event <birth>`
will be scheduled.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``conception.alpha_base`` (-3): |br|
The value of :math:`\alpha_{\rm base}` in the formula for the hazard.
- ``conception.alpha_ageman`` (0): |br|
The value of :math:`\alpha_{\rm age,man}` in the formula for the hazard, to be able
to take the age of the man in the relationship into account.
- ``conception.alpha_agewoman`` (0): |br|
The value of :math:`\alpha_{\rm age,woman}` in the formula for the hazard, to be able
to take the age of the woman in the relationship into account.
- ``conception.alpha_wsf`` (0): |br|
The value of :math:`\alpha_{\rm wsf}` in the formula to the hazard. This way you can
take a value for the weekly sex frequency (WSF) into account.
- ``conception.beta`` (0): |br|
The value of :math:`\beta` in the hazard formula, allowing you to influence the hazard
based on the 'age' of the relationship.
- ``conception.t_max`` (200): |br|
As explained in the section about :ref:`'time limited' hazards <timelimited>`, an
exponential function needs some kind of threshold value (after which it stays
constant) to be able to perform the necessary calculations. This configuration
value is a measure of this threshold.
- ``conception.wsf.dist.type`` ('fixed', with value 0): |br|
When the conception event is scheduled, a value for the weekly sex frequency (WSF)
to use in the hazard formula is picked from a :ref:`distribution <prob1d>`. This configuration
option specifies which distribution you would like to use, and depending on the
value other parameters for the distribution can be configured as well.
.. _debut:
Debut event
^^^^^^^^^^^
Persons who are not yet sexually active will have a debut event scheduled, which
will fire when a person has reached a specified age (``debut.debutage``). When
this event fires, the person becomes sexually active and :ref:`relationship formation events <formation>`
will get scheduled. The number of formation events that gets scheduled can
be controlled using the :ref:`'eyecap' <eyecap>` setting.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``debut.debutage`` (15): |br|
The age a person must have to become sexually active. This determines when the
debut event for a particular person will get executed.
.. _diagnosis:
Diagnosis event
^^^^^^^^^^^^^^^
When a person gets infected with HIV, either by :ref:`transmission <transmission>`
of the virus or by :ref:`seeding <hivseeding>` the population to get the epidemic
started, a diagnosis event will get scheduled. When fired, the person is deemed
to feel bad enough to go to a doctor and get diagnosed as being HIV-infected.
Upon diagnosis, a :ref:`monitoring event <monitoring>` will be scheduled very
shortly afterwards, to monitor the progression of the disease and to offer
treatment if eligible.
This event is hazard-based, and the hazard is of the following form:
.. math::
\begin{eqnarray}
{\rm hazard} & = & \exp\left({\rm baseline} + {\rm agefactor}\times(t-t_{\rm birth}) + {\rm genderfactor}\times{\rm G}\right. \\
& & + {\rm diagpartnersfactor}\times {\rm P} +{\rm isdiagnosedfactor}\times D +\beta(t-t_{\rm infected})\\
& & \left.+ {\rm HSV2factor} \times {\rm HSV2} \right)
\end{eqnarray}
Note that this is again a time dependent exponential hazard of the form
.. math::
{\rm hazard} = \exp(A+Bt)
In the formula, :math:`G` is a value related to the gender of the person, 0 for a man and
1 for a woman. The number :math:`P` represents the number of partners of the person that
are both HIV infected and diagnosed. The value of :math:`D` is an indication of whether
the person was diagnosed previously: its value is 0 if this is the initial diagnosis event, or
1 if it's a re-diagnosis (after :ref:`dropping out <dropout>` of treatment). The value of :math:`HSV2` is an indication of whether the person is infected with HSV2: its value is 0 if the person is not infected with HSV2 and 1 if the person is infected with HSV2.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``diagnosis.baseline`` (0): |br|
Controls the corresponding :math:`{\rm baseline}` value in the expression for the hazard.
- ``diagnosis.agefactor`` (0): |br|
Controls the corresponding :math:`{\rm agefactor}` value in the expression for the hazard.
This allows one to let the age of a person influence the hazard.
- ``diagnosis.genderfactor`` (0): |br|
Controls the :math:`{\rm genderfactor}` parameter in the hazard. This allows you
to have a different hazard depending on the gender of the person.
- ``diagnosis.diagpartnersfactor`` (0): |br|
Corresponds to the value of :math:`{\rm diagpartnersfactor}` in the expression for the
hazard. The idea is to allow the number of partners that have already been diagnosed
to have an effect on a person's diagnosis time: if a person is not feeling well and
knows that some of the partners are infected with HIV, this can be an incentive to
go to the doctor sooner.
- ``diagnosis.isdiagnosedfactor`` (0): |br|
Using this :math:`{\rm isdiagnosedfactor}` value in the hazard, it is possible to
have a different hazard if the person was diagnosed before. After :ref:`dropping out <dropout>`
of treatment, for example because a person is feeling better and no longer feels
the need for treatment, a diagnosis event will be scheduled again. It is reasonable
to think that a person may go to the doctor again sooner when he already knows
about the HIV infection.
- ``diagnosis.beta`` (0): |br|
Corresponds to the :math:`{\beta}` factor in the hazard expression, allowing one to
take the time since infection into account.
- ``diagnosis.HSV2factor`` (0): |br|
Using the :math:`{\rm HSV2factor}`, it is possible to have a different hazard when the person is infected with HSV2.
- ``diagnosis.t_max`` (200): |br|
As explained in the section about :ref:`'time limited' hazards <timelimited>`, an
exponential function needs some kind of threshold value (after which it stays
constant) to be able to perform the necessary calculations. This configuration
value is a measure of this threshold.
.. _dissolution:
Dissolution event
^^^^^^^^^^^^^^^^^
As soon as a :ref:`relationship is formed <formation>` a dissolution event gets scheduled
to allow for the possibility that the relationship terminates. The hazard for this
event is the following:
.. math::
\begin{eqnarray}
{\rm hazard} & = & \exp\left(
\alpha_0
+ \alpha_1 P_{\rm man} + \alpha_2 P_{\rm woman} + \alpha_3 | P_{\rm woman} - P_{\rm man}| \right. \\
& &
+ \alpha_4 \left(\frac{(t-t_{\rm birth,man}) + (t-t_{\rm birth,woman})}{2}\right) \\
& & \left.
+ \alpha_5 | (t-t_{\rm birth,man}) - (t-t_{\rm birth,woman}) - D_{\rm pref} |
+ \beta (t - t_{\rm ref})
\right)
\end{eqnarray}
Note that this is again a time dependent exponential hazard of the form
.. math::
{\rm hazard} = \exp(A+Bt)
In this expression, :math:`P_{\rm man}` and :math:`P_{\rm woman}` are the number of partners
the man and woman in the relationship have. The value :math:`D_{\rm pref}` represents
the preferred age difference between a man and a woman. The value of :math:`t_{\rm ref}` is the
time at which the relationship was formed.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``dissolution.alpha_0`` (0.1): |br|
The value of :math:`\alpha_0` in the expression for the hazard, allowing one to establish
a baseline value.
- ``dissolution.alpha_1`` (0): |br|
The value of :math:`\alpha_1` in the hazard formula, corresponding to a weight for the
number of relationships the man in the relationship has.
- ``dissolution.alpha_2`` (0): |br|
The value of :math:`\alpha_2` in the hazard formula, corresponding to a weight for the
number of relationships the woman in the relationship has.
- ``dissolution.alpha_3`` (0): |br|
The value of :math:`\alpha_3` in the hazard expression, by which the influence of the
difference in number of partners can be specified.
- ``dissolution.alpha_4`` (0): |br|
The value of :math:`\alpha_4` in the expression for the hazard, a weight for the average
age of the partners.
- ``dissolution.alpha_5`` (0): |br|
The factor :math:`\alpha_5` controls the relative importance of how much the age gap
between man and woman differs from the preferred age difference :math:`D_{\rm pref}`.
- ``dissolution.Dp`` (0): |br|
This configures the preferred age difference :math:`D_{\rm pref}` in the hazard
expression. Note that to take this into account, :math:`\alpha_5` should also be
set to a non-zero value.
- ``dissolution.beta`` (0): |br|
As can be seen in the expression for the hazard, using this value the 'age'
of the relationship can be taken into account.
- ``dissolution.t_max`` (200): |br|
As explained in the section about :ref:`'time limited' hazards <timelimited>`, an
exponential function needs some kind of threshold value (after which it stays
constant) to be able to perform the necessary calculations. This configuration
value is a measure of this threshold.
.. _dissolutionmsm:
MSM Dissolution event
^^^^^^^^^^^^^^^^^^^^^
As soon as an :ref:`MSM relationship is formed <formationmsm>` an MSM dissolution event
gets scheduled to allow for the possibility that the relationship terminates. The
hazard for this event is the following:
.. math::
\begin{eqnarray}
{\rm hazard} & = & \exp\left(
\alpha_0
+ \alpha_{12} ( P_{\rm man1} + P_{\rm man2} ) + \alpha_3 | P_{\rm man1} - P_{\rm man2}| \right. \\
& &
+ \alpha_4 \left(\frac{(t-t_{\rm birth,man1}) + (t-t_{\rm birth,man2})}{2}\right) \\
& & \left.
+ \alpha_5 | (t-t_{\rm birth,man1}) - (t-t_{\rm birth,man2}) |
+ \beta (t - t_{\rm ref})
\right)
\end{eqnarray}
Note that this is again a time dependent exponential hazard of the form
.. math::
{\rm hazard} = \exp(A+Bt)
In this expression, :math:`P_{\rm man1}` and :math:`P_{\rm man2}` are the number of partners
the men in the relationship have. The value of :math:`t_{\rm ref}` is the
time at which the relationship was formed.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``dissolutionmsm.alpha_0`` (0.1): |br|
The value of :math:`\alpha_0` in the expression for the hazard, allowing one to establish
a baseline value.
- ``dissolutionmsm.alpha_12`` (0): |br|
The value of :math:`\alpha_{12}` in the hazard formula, corresponding to a weight for the
number of relationships the men in the relationship have.
- ``dissolutionmsm.alpha_3`` (0): |br|
The value of :math:`\alpha_3` in the hazard expression, by which the influence of the
difference in number of partners can be specified.
- ``dissolutionmsm.alpha_4`` (0): |br|
The value of :math:`\alpha_4` in the expression for the hazard, a weight for the average
age of the partners.
- ``dissolutionmsm.alpha_5`` (0): |br|
The factor :math:`\alpha_5` controls the relative importance of the age gap
between the men in the relationship.
- ``dissolutionmsm.beta`` (0): |br|
As can be seen in the expression for the hazard, using this value the 'age'
of the relationship can be taken into account.
- ``dissolutionmsm.t_max`` (200): |br|
As explained in the section about :ref:`'time limited' hazards <timelimited>`, an
exponential function needs some kind of threshold value (after which it stays
constant) to be able to perform the necessary calculations. This configuration
value is a measure of this threshold.
.. _dropout:
ART treatment dropout event
^^^^^^^^^^^^^^^^^^^^^^^^^^^
When a :ref:`monitoring event <monitoring>` gets triggered and the person is both eligible
and willing to receive treatment, treatment is started causing the set-point viral
load of the person to be lowered. When treatment starts, a dropout event is scheduled
as well, to allow a person to drop out of treatment.
Currently, the dropout event is not hazard-based, instead a random number is
picked from a one dimensional probability distribution as specified in
``dropout.interval.dist.type`` and related configuration options.
Here is an overview of the relevant configuration options, their defaults (between
parentheses), and their meaning:
- ``dropout.interval.dist.type`` ('uniform' by default, with boundaries of 3 months and 10 years): |br|
Using this configuration option you can specify the probability distribution to
use when obtaining the time after which a person will drop out of treatment. By
default, this is a uniform distribution with equal non-zero probability between 3 months and
10 years, and zero otherwise. :ref:`Other distributions <prob1d>` can be specified as well, as
explained previously.
.. _formation:
Formation event
^^^^^^^^^^^^^^^
Depending on the :ref:`'eyecap' <eyecap>` setting, for a number of man/woman pairs,
formation events will be scheduled. When such an event fires, a relationship
between these two persons will be formed. Apart from scheduling a
:ref:`dissolution event <dissolution>`, a :ref:`conception event <conception>`
will get scheduled if the woman in the relationship is not yet pregnant,
and in case just one of the partners is infected with HIV, a
:ref:`transmission event <transmission>` will be scheduled as well.
The formation event is hazard based, and there are currently three hazard types