A dynamic network model to disentangle the roles of steady and casual partners for HIV transmission among MSM

HIV is a sexually transmitted infection (STI) whose transmission process is highly dependent on the sexual network structure of the population under consideration. Most sexual behaviour data is egocentric in nature. We develop a stochastic dynamic sexual network model that utilises this type of egocentric network data. The model incorporates both steady and casual sex partners, and can be seen as a stochastic form of a generalised pair-formation model. We model the spread of an infection where individuals are susceptible, infectious, or suc- cessfully treated (and unable to transmit) and derive analytical expressions for several epidemiological quantities. We use sexual behaviour and HIV prevalence data that was gathered among 403 MSM at an STI clinic in Stockholm. To accurately capture transmission dynamics for this population, we need to explicitly model both casual sex partners and steady partnerships. Our model yields an estimate for the mean time until diagnosis followed by successful treatment that is in line with literature. This study indicates that small reductions in the time to diagnosis, and thereby, beginning of treatment, may substantially reduce HIV prevalence. Moreover, we find that moderate increases in condom use with casual sex partners have greater impact on reducing prevalence than the same increases in condom use with steady sex partners. This result demonstrates the relative importance of casual contacts on the HIV transmission dynamics among MSM in Sweden. Our results highlight the importance of HIV testing and condom-use interventions, and the role that casual and steady partners play in this, in order to turn the epidemiological trend in Sweden towards decreased HIV incidence.


Introduction
Sexual transmission of HIV and other sexually transmitted infections (STI) remain important public health issues globally (ECDC, 2017). Sexual transmission of HIV is highly dependent on the characteristics of the sexual network in the population under consideration. Therefore, when investigating transmission of STIs in a population it is necessary to consider the underlying dynamic sexual network (Morris and Kretzschmar, 1995;Kretzschmar and Dietz, 1998).
Most data on sexual behaviour are egocentric; the data collected from individuals contain no identifiable information of their partners. Our study considers a stochastic dynamic sexual network model that utilises the egocentric nature of sexual behaviour data. The model is analytically tractable and can easily be adapted to different populations. In this dynamic network model, both individuals that are single and in steady partnerships can have casual contacts. We fit our dynamic network model to the behaviour of men having sex with men (MSM) in Stockholm, Sweden. In the data used the HIV prevalence among the respondents is 6%. Additionally, the respondents have both long-term steady partnerships and a substantial number of casual sex partners. A monogamous steady partnership is a kind of safe-guard for further transmission. When casual contact occurs concurrent or close to a steady partnership this safe-guard breaks down. In accordance with sexual behaviour data, our model allows for individuals in steady partnerships to behave differently from individuals that are single when it comes to engaging in casual contacts. With the focus on the distinction between steady partners and casual contacts we gain insights into the HIV transmission process among MSM in Stockholm by combining sexual behaviour and prevalence data with the model. Additionally, we are able to determine whether a reduced time to diagnosis and beginning of successful treatment, increased condom use with steady partners, or an increased condom use with casual partners has the greatest impact on reducing prevalence. stochastic version of a pair-formation model with additional casual contacts. Pair-formation models for monogamous populations were first introduced in epidemiology by Dietz and Hadeler (1988). Different extensions of the model have since been made (Morris and Kretzschmar, 1995;Kretzschmar and Dietz, 1998;Xiridou et al., 2003;Leung et al., 2015;Leng and Keeling, 2018). The study of Xiridou et al. (2003) considers a related simulation model with casual and steady partnerships to investigate HIV dynamics among homosexual men in Amsterdam, where casual contacts are made dependent of partnership status. Recently, Leng and Keeling (2018) used a deterministic pairformation model that incorporates casual sexual contacts concurrent to steady partnerships. They studied the effect of adding this type of concurrency on the transmission of a generic STI following a SIS model (Susceptible → Infectious → Susceptible), and its effect on the level of vaccination needed to eliminate the infection. Another approach to study STIs on time dynamic networks, is to use temporal exponential random graph models (ERGMs) to simulate complex network structures, such as concurrent steady partnerships (Hanneke et al., 2010;Krivitsky and Handcock, 2014;Goodreau et al., 2017). Such more advanced network models need to make further assumptions on the complete network structure beyond the information that the egocentric network data provides.
The present study takes a stochastic viewpoint and uses an analytically tractable model for the transmission dynamics on a dynamic sexual network. This model is therefore not based on simulations or on a deterministic model defined by differential equations. The stochastic approach enables us to derive the probability that an epidemic becomes endemic without further influx of infectious individuals. The structure of the disease dynamics follows a so-called SIR compartmental model. Individuals that are newly infected with HIV are assumed to be infectious for some time until they are diagnosed and initiate highly active antiretroviral therapy (HAART).
Sweden was the first country to achieve the UNAIDS/WHO 90-90-90 goal (Gisslén et al., 2017) with 90% of people living with HIV being aware of their HIV status, 95% of HIV diagnosed individuals are on HAART treatment, and 95% of those on HAART treatment are under viral suppression (Ministry of Health and Social Affairs, 2017). Individuals under viral suppression achieve continuously undetectable HIV viral load that diminishes onward transmission to close to zero (World Health Organization, 2012;Cohen et al., 2011). We therefore assume that individuals on successful HAART are virally suppressed and thereby no longer transmit infection (and to be in the R compartment where R traditionally stands for removed).
HIV prevalence has been estimated to be 0.06% in the general population and 5-6% among MSM (MSM, 2013). Until now, the use of PrEP (pre-exposure prophylaxis) in Sweden has been very low and approval of PrEP in Sweden occurred almost two years after the sexual behaviour data of this study was gathered (The, 2017). The Swedish government has recently decided to subsidise PrEP. The availability of PrEP could potentially change HIV transmission dynamics by both altering transmission probabilities and potential changes in sexual behaviour (Cassell et al., 2006). This highlights the importance of understanding the setting without PrEP.
The combination of the behavioural data from MSM in Stockholm and our mathematical model yield a good understanding of the HIV transmission dynamics among MSM in Stockholm. We obtain estimates for HIV prevalence and time until successful treatment that are consistent with existing literature. The model also allows us to investigate different aspects that could influence the disease dynamics such as an increased condom use in steady partnerships. Most importantly, we study the effect of casual sexual contacts on the HIV epidemic and find that the reported casual contacts in the data have important effects on the epidemiological outcomes. Furthermore, we find that the HIV epidemic among MSM in Stockholm has a basic reproduction number 0 only slightly above the epidemic threshold value of one. Our study indicates that small reductions in the time to diagnosis, and thereby beginning of treatment, may substantially reduce HIV prevalence.

Model: specifications of the dynamic network and of the epidemic
We consider a sexually active same-sex population, where new individuals enter the sexually active population at a constant rate μn and each individual leaves the sexually active population at rate μ. The size of the sexually active population will therefore fluctuate around the value n -which is assumed to be large. Later we will look at the proportion of a certain type (e.g. susceptible and infectious) in the population and then n disappears. Also note that unless otherwise stated, a rate refers to the rate parameter of an exponentially distributed random variable.
Individuals enter the sexually active population without a partner. The rate at which an individual who is single enters into a partnership is ρP 0 , where P 0 is the fraction of single individuals in the population. This means that the higher the fraction of single individuals, the higher the rate at which new partnerships are formed. Individuals can have at most one steady partner at a time and the separation rate for each partnership is denoted σ. A partnership therefore lasts for an exponential time with mean duration 1/(σ + 2μ).
We assume that the partnership network in absence of infection is stable, i.e. that the proportion of individuals being single remains at P 0 for all t. With the assumption that each individual has a maximum of one steady partner at a time we can use previous derived results (Leung et al., 2015) to express P 0 (and the proportion P 1 = 1 − P 0 of individuals with a partner) in terms of model parameters: The rate of sexual acts within a partnership is denoted λ * . Alongside steady partners, individuals may have casual contacts during steady partnerships as well as during single periods; the rate at which this occurs depends on the partnership status of the individual under consideration. For symmetry reasons, the total rate in the population at which singles have casual contacts with individuals in a partnership needs to equal the rate at which individuals in partnership have casual contacts with singles. Additionally, to remove an unidentifiable parameter we assume that the rate of casual sexual contact with someone in a partnership compared to the rate of casual contact with a single individual is the same regardless of your own partnership status. These two conditions imply that the contact behaviour regarding casual sex can be captured by two additional parameters * 0 and * 1 (see Supplementary Material 2 for details). The rate at which an individual who is single tries to have casual sex is denoted by * 0 and the rate an individual in partnership tries to have casual sex by * 1 (typically > * * 0 1 ). The rate for an individual who is single to have casual sex with other singles is then given by P * * 0 0 0 and with individuals in a partnership by P * * 0 1 1 . An individual in a partnership has casual contacts with other individuals in partnership at a rate P * * 1 1 1 and with singles at a rate P * * 1 0 0 . The overall rate of casual contacts between individuals who are single and individuals in partnership is hence nP P * * 0 0 1 1 .
Next we consider the spread of an infection on the network. Individuals can be either susceptible or infectious. Additionally once an individual becomes aware of their infection, if they start successful treatment they are no longer infectious and can no longer transmit infection. Antiretroviral treatment has been shown to decrease the viral load and risk of transmission to very low levels (Cohen et al., 2011). Therefore, next to susceptible and infectious, the third compartment consists of the successfully treated individuals who no longer transmit to others in the context of our model which leads to an SIR model. We refer to the third compartment as 'removed'. Note here that the delay between diagnosis and start of successful treatment is part of the infectious state. Also, we only consider successfully treated: drop-outs are not part of the compartment removed.
Given an unprotected sexual contact (in our case anal intercourse) between an infectious and a susceptible individual there is a probability p I of transmission. Therefore, the transmission rate in a steady partnership between an infectious and a susceptible individual is λ = p I λ * . The transmission rate in a casual sexual encounter is defined similarly: = p * * i j I i j . Note that the probability p I of transmission is for the unprotected case and in reality some of the intercourse are with condoms. Condom use may also differ in steady sexual partnerships and casual contacts. These factors are taken into account in the parametrisation of the model in Section 2.4.3.
Lastly, we assume that an infectious individual gets diagnosed and put on successful treatment at rate γ. Note that if we were to only study the rate of diagnosis then this would be slightly higher than the rate of diagnosis followed by successful treatment. Individuals not accepting or adhering to treatment are not considered to be removed within our model (in compartment R). In Sweden where 95% of diagnosed are on treatment and 95% of treated individuals are on successful treatment (i.e. virally suppressed) the following relation holds: To summarise, the model is captured by 9 parameters n, μ, ρ, σ, λ * , * 0 , * 1 , p I , and γ, where the last two relate to the infectious disease. We provide an overview of the notation in Table 1.
To get an expression for the threshold when a major outbreak is possible it is enough to consider a deterministic approximation of the above described model. However, to get other epidemic quantities, such as the probability of an endemic situation even without future influx of infected people in the risk group under study, the stochastic setting is needed.
In our model, overlapping steady partnerships are not taken into account; only casual sex partners concurrent to steady sex partners are allowed. To get a better understanding of the effect of concurrent partnerships with our model, that only allows for one partner at a time, we do two different alternations in Supplementary Material 2.3. First, we increase the rate of having sex with that partner by the weighted average of number of concurrent partners. Second, we increase the concurrency our model does allow for: the casual contacts concurrent to a steady partnership.

Deterministic approximation of the model
Many other pair-formation models are described by a deterministic approximation for large populations (Dietz and Hadeler, 1988;Morris and Kretzschmar, 1995;Kretzschmar and Dietz, 1998;Xiridou et al., 2003;Leng and Keeling, 2018). Therefore, here we provide the corresponding approximation of our model.
Assuming that the population is large enough, we can approximate the stochastic model by the expected values of the fraction of individuals that are susceptible, infectious, or removed. These expectations are the limit of the stochastic values for large populations. In Supplementary Material 1 we verify with simulations of the stochastic model that a value of the population size as low as 5000 is enough.
To find the fractions of the population that are susceptible, infectious and removed we will need to divide the population into different types. The different types specify if the individuals are single or in a partnership, the infectious status of the individuals, and the partner's infectious status. Each individual will contribute with one unit to the type to which it belongs. The fraction of all individuals that are susceptible and single is denoted by S 0 , the fraction of all individuals that are infectious and single is denoted by I 0 , and removed singles by R 0 (not to be confused with the basic reproduction number 0 , see Section 2.3.1).
Let X Y denote the fraction of individuals of type X = S, I, R, with a partner of type Y = S, I, R. Note that this counts each individual in the fraction X Y and not each pair, e.g. S S is the fraction of susceptible individuals in a partnership with another susceptible (a partnership is therefore counted twice in S S ). The reason for taking this individualbased perspective is that the data are individual based. Moreover, the individual-based perspective makes it simpler to extend the model by allowing for more than one steady partner at a time in future work. Symmetry reasons give S I = I S , S R = R S , and I R = R I , so we use only S I , S R , and I R from now on. The following consistency conditions hold: The model is described by the following seven differential equations:  I  I  I  I S   S I  I  I  I  I S  µ S   I  I  I  I S   S R  S  I  I  I  I S  µ S   I  S  S  I  I  I  I  µ  I   I R  I  I  I  I  I S  I  R  I  S  I  S  I  R  I  R   I  I  I  S  I  R  I   I  I We illustrate the possible transitions from the different states in Fig. 1.

Epidemiological quantities 2.3.1. The basic reproduction number 0
The important epidemic quantity 0 , the basic reproductive number, can be interpreted as the expected number of secondary infections caused by a typical newly infected in the beginning of an epidemic. In the early stages of an epidemic very few individuals are infectious and almost all new partnerships and casual contacts are with susceptible individuals. An infectious individual remains infectious for an exponentially distributed amount of time with parameter μ + γ, where μ corresponds to the individual leaving the sexually active population and γ to enter treatment.
Since individuals have different rates of casual contacts depending on partnership status, we will need to consider three types of individuals depending on how they got infected. An individual could be infected Let the random variable M ij denote the number of i-types that one jtype infects (early in the epidemic). For example, M ps denotes the number of partners infected by an individual who got infected while being single. In order to determine 0 we use standard techniques (Diekmann et al., 2013) and find the largest eigenvalue of the nextgeneration matrix E[M] consisting of the expected values of the number of infected by the different types. To determine the probability of the epidemic to be in an endemic state without further influx of infectious individuals from outside we will need the complete distributions.
We denote the expected values of the random variables M ij as their lower-case letter counterparts and the next-generation matrix is • in a steady partnership separates before they recover (transition to the removed compartment) or die, denoted π 10 ; • with no steady partner enters a partnership before they recover or die, denoted π 01 .
It is shown in Supplementary Material 4.1 that (3) If singles and individuals in a steady partnership have the same rate of casual contacts (ω 0 = ω = ω 1 ), the constant c ω simplifies to c ω = ω.
(3) is the same as 0 for the SI epidemic on a pair formation model in Kretzschmar and Dietz (1998)

The probability of an endemic state
The probability of an epidemic to be in an endemic state without further influx of infectious individuals from outside is referred to as the probability of 'a major outbreak'. HIV in Sweden is in an endemic situation and therefore this probability is not of main interest for public health organisations. However, for other diseases or for future settings it can be relevant.
In order to derive the probability of a major outbreak, we use a branching process approximation approach. To do this we need to determine the complete distributions for the number of secondary infections (reproductions) of the initially infected individual. In the calculation for 0 given here we use the intuitive way of thinking of a reproduction: one new infection is one new reproduction. However, this creates dependence between parent and offspring in the branching process. This will therefore not yield a proper branching process and only an approximation of the probability of a major outbreak (Lashari and Trapman, 2017). In Supplementary Material 4.2 we redefine reproduction to get a proper branching process approximation. Nevertheless, one can prove that 0 derived in the intuitive way (Eq. (3)) is actually an epidemic threshold parameter for our model.

The endemic level
Finally, the prevalence at the endemic level in the population can be calculated as follows. The disease-free equilibrium is given by S 0 = P 0 , S S = 1 − P 0 , and the remaining states equal to 0, i.e. all individuals are susceptible. In Supplementary Material 4.2, using system (2), we show that if 0 is less than 1, the disease-free equilibrium is asymptotically stable. If 0 is larger than one then there is a nontrivial equilibrium: namely the endemic equilibrium. The endemic level is obtained numerically by setting the left-hand side of (2) equal to 0 and solving for the nontrivial steady state.

Data description
The data used to estimate the network parameters was gathered among 403 MSM between February 2 and December 15, 2015 at an STI clinic in Stockholm, Sweden. The sample consists of sexually active MSM who are seeking STI/HIV testing in an urban area of Sweden and is representative for this part of the Swedish MSM population. A non- . Note that we in this figure are representing the individual perspective. For example, consider an individual that is susceptible and in a partnership with an infectious (in state S I ), this individual move to the susceptible single state S either by death of his partner (μ) or by separation from his partner (σ). If the individual in state S I moves to state S by separation, this also implies that the partner who is in state I S moves to state I. However, this is not shown explicitly in the figure.
response analysis was performed and showed a low rate of non-response and no significant differences. The HIV prevalence in our sample is 6%. This estimate of the prevalence is consistent with earlier findings: a study from 2013 (MSM, 2013) with 2373 respondents found that the self-reported HIV prevalence was 6% among MSM living in the larger cities in Sweden (and 2% in the rest of the country). Additionally, three out of four MSM participating in the MSM (2013) study had taken an HIV test at least once, and four out of 10 had taken a HIV test during the last 12 months. The number was even higher for MSM living in the urban areas (exact number not given). The included 403 MSM reported their total number of sexual partners during the last 12 months. The mean number of sexual partners during a year is 14.9. The first and third quartile are 4 and 18 respectively and the maximum number of sexual partners is 250.
In this total number no distinction is made between casual sex partners and steady sex partners. A particular part of the questionnaire focused on frequency of sex acts and condom use per sex partner for the last ten sex partners. The method used is time follow back inspired set up, showing the participant a timeline over the last 12 months where participants added the time period for a sexual relationship with a sex partner. Subsequently, questions were asked per sex partner regarding sex partner type, frequency of sex type (oral/anal), and frequency of condom use. Hence the participants themselves labelled their sexual partners as being regular (steady) or occasional (casual). When we refer to a steady partner we refer to the sexual relationship; a steady partner does not necessarily mean a boyfriend or an exclusive sex partner, rather this is someone you have sex with regularly.
The detailed information concerns 1563 casual sex partners and 549 steady sex partners (note that these contacts are fewer than the total number of contacts since only the 10 most recent were specified in more detail). The mean number of sexual relationships in the detailed data is 5.2. Additionally, in this detailed data of participants' ten most recent sexual partners during the past 12 month we get the following information: the date a steady partnership started (with a maximum of 12 months ago) and ended, and thus the duration of steady partnerships and the length of time between steady partnerships; the self-reported number of sex acts within a steady partnership per month; and the dates when casual contacts occurred. For a casual sex partner, the participants could give up to 10 sexual encounters. If the number of encounters exceeded 10 then they were given the questionnaires for a regular sex partner. Moreover, in one encounter the participants could either be the insertive or the receptive actor, or both insertive and receptive. The mean number of sexual encounters with a casual sex partner is 1.35 and the mean number of sex acts in such an encounter is 1.13, leading to a mean number of 1.35 · 1.13 = 1.53 sex acts with a casual sex partner.
The participants also reported their condom use for each of their ten most recent sex partners. If a participant only had sex with a partner once, a binary response on condom use was given. If a participant had sex several times with a partner, a response on a five-degree scale was given where the options were: always (100%), often (75%), half of the times (50%), seldom (25%), and never (0%). For each participant we calculate his mean condom use in the two types of partnerships: steady and casual. The overall mean condom use with steady sex partners is 52% and with casual sex partners the mean condom use is 63%. We need to keep in mind that self-reported condom use has inherent uncertainties, e.g. conscious or unconscious misreporting as a consequence of social expectations on sexual risk behaviour. However, the time-following back method used in the questionnaire has previously demonstrated to be able to separate between individuals' expectations of themselves and how they actually act (Fridlund et al., 2014).

Network parameters
The self-reported mean duration of a steady partnership is 203.2 days. Note that this is when the duration is restricted to 12 months at most. The duration of a partnership is assumed to be exponentially distributed and fits well to this assumption (see Supplementary Material 2.2). It is therefore possible to estimate the mean time of a partnership that is not restricted to a maximum of one year, which is (σ + 2μ) −1 = 292.2 days. The time for a single individual to enter a partnership is similarly restricted to a maximum of one year. The mean time for a single to enter a partnership with this restriction is 95 days. Estimating the mean time without this one-year restriction yields a mean time for a single individual to enter a partnership of 163 days and therefore the rate for a single to acquire a steady partner is ρP 0 = 1/163 (days −1 ), yielding a value on P 0 of 0.36. The mean frequency of anal intercourse (AI) in a steady partnership is 30/year which corresponds to a mean time until a couple has AI is 1/λ * = 12 days. This is the same frequency of unprotected AI as Xiridou et al. (2003) found among MSM in Amsterdam.
To calculate the mean time between casual sex partners an individual has to have had at least one casual sex partner within the study period, likely leading to a slight bias towards shorter times. We believe this bias to be small since 89% of all participants had at least one casual sex partner.
The data contains information about whether or not the participants have a steady partner while having the casual sex partners, but not the partnership status of the casual sex partner. Therefore, from the data we get the rate of finding a new casual sex partner while being single = + P P * * * * * The rate at which an individual that is single has casual sex is 101.9/62.6 = 1.6 times larger than the same rate for an individual in a steady partnership. The mean number of sex acts with a casual partner is 1.53, and this is incorporated in the model by multiplying the infection probability with a casual partner with this value. We need to consider that the more detailed data that distinguish between casual sex partners and steady partners only include (up to) the 10 most recent sexual relationships. The mean number of sexual relationships in this detailed data is 5.2, but if we look at the data that does not make a distinction between casual sex partners and steady partners then the mean number of the total of sexual relationships during a year is 14.9. Therefore, we need to scale the time between casual sex partners according to this. We assume that individuals are sexually active for an exponential time with a mean of μ −1 = 60 years. The life expectancy for males in Sweden is 81 years (World Bank, 2015), and the mean age when becoming sexually active fluctuates between 16 and 17 years (UngKAB, 2015). If we assume that an individual is not sexually active during the last 5 years of his life we have a mean sexually active lifetime of 81 − 16 − 5 =60 years.
In Table 2 all the parameter estimates are shown in terms of days. With σ, μ, and ρP 0 given in Table 2 and Eq. (1) we conclude that the estimate of the fraction without a steady partner is P 0 = 0.36.
Finally, in Supplementary Material 3.2 we investigate the model's sensitivity to the above parametrisation where we find that a different way of parametrisation yields similar results.

Probability of transmission and HIV prevalence
We use available literature for the probability p I of transmission per sexual act considering different forms of sexual acts, the primary and asymptomatic stage of infection, and condom use.
The probability of transmission of HIV depends on the stage of infection when no antiretroviral treatment is used (Anderson and May, 1988;Hollingsworth et al., 2008). In the early primary infection stage of HIV the probability of transmission is much higher due to high viral load than in the asymptomatic stage that follows when the viral load is lower due to the immune response. Finally, when the immune response fails, the viral load increases and the person develop acquired immune deficiency syndrome (AIDS). The average duration of the primary infection stage d p is 2.9 months= 0.24 years (Hollingsworth et al., 2008). Since we assume that an infectious individual stays infectious for an exponential distributed time with mean (μ + γ) −1 , the duration of the asymptomatic stage is a p A meta-analysis used to obtain an estimate for the overall per-act probability of infection finds that in unprotected receptive anal intercourse (URAI) it is 1.4% (Baggaley et al., 2010). The per-act infection probability in unprotected insertive anal intercourse (UIAI) is not given in this meta-analysis, but the per-partner transmission rate for URAI and UIAI are given: 40.4% and 21.7% respectively. The URAI infection probability is therefore 1.86 times larger than the UIAI infection probability (Baggaley et al., 2010). A similar relation between URAI and UIAI is found in (Jin et al., 2010), who get a per-act probability of 1.48% for URAI and 0.62% for UIAI among uncircumcised men (1.48/ 0.62 = 2.39).
The URAI infection probability during the primary infection stage p p is estimated to 0.1835 and during the asymptomatic stage p a is estimated to 0.0138 (Leynaert et al., 1998). Assuming 50% URAI and 50% UIAI and the more conservative probability for UIAI (URAI/2.39) we get a combined p p = 0.1301 and p a = 0.0098.
To determine the rate λ of infecting one's partner and the rates α of infecting individuals during casual contacts, we use the contact rates given in Table 2 and calculate a weighted average with d a d p , p p , and p a . The probability of infection per sexual act without any protection is hence given by Finally, the condom use is taken into account. We do this by assuming that individuals in each sexual act use a condom with probability corresponding to the mean condom use: q s = 52% with a steady partner; and q c = 63% with a casual sex partner. As a consequence, the probability of infection differs for sexual acts within steady partnerships and with casual sex partners. Condom efficiency among MSM is estimated to be around 70% (Smith et al., 2015). Decreasing the probability of infection according to these values we obtain the parameter estimates The value 1.53 in α is the mean number of sex acts with a casual sex partner. Note that λ and α depend on the mean recovery time γ −1 through the mean duration of the asymptomatic stage of infection d a .
The epidemic parameters are found in Table 2.

Results
From the data we get estimates for the partnership parameters of the dynamical sexual network. For the resulting sexual network, we estimate 0 and the endemic level of HIV using parameters from the literature mentioned above. This is done by letting the time to diagnosis and successful HAART treatment vary.

Time until diagnosis and the beginning of treatment
The mean time until diagnosis followed by successful treatment γ −1 is varied between 0 and 10 years. In Fig. 2 we plot the basic  (2015) reproductive number and the probability of a major outbreak assuming that the index case was infected by a steady partner as a function of the mean time to treatment. It can be seen that = 1 0 when the mean time until diagnosis followed by successful treatment is γ −1 = 2.5 years. For values γ −1 less than 2.5 years an outbreak is not possible.
The endemic level is also determined and can be seen in Fig. 3. For values of γ −1 less than 2.5 an outbreak is not possible. The fraction diagnosed and under treatment at endemic level is shown by the blue dashed line in Fig. 3. The observed HIV prevalence (diagnosed + undiagnosed infectious) of 6% corresponds to a mean time until diagnosis and successful treatment of 2.85 years.
Note that a change in the mean time until diagnosis highly affects HIV prevalence among the studied MSM population. From Fig. 3 it can be seen that very small changes in the time until diagnosis in the region 2.5-4 years will have a large impact on the HIV prevalence.
The probability of infection during one anal intercourse and the mean time until diagnosis are taken from the literature. Both of these quantities possess uncertainties that are difficult to quantify. However, estimates of HIV prevalence among MSM are usually available. With our model it is possible to use the estimated prevalence and instead calculate the parameter combinations of the probability of infection and time until diagnosis and successful treatment that correspond to this prevalence. For the observed prevalence of 6% the result can be seen in Fig. 4. We observe that a little change in the probability of infection from 0.13 to 0.15 would change the mean time until treatment from 2.85 years to 2.1 years to yield the observed prevalence of 6%.
To determine how large of an effect concurrent steady partnerships could potentially have on the HIV prevalence we did additional analyses in Supplementary Material 2.3. We increased the concurrency that already exist in our model (casual contacts concurrent to steady partnerships), by the concurrency of steady partnerships reported in the data. In doing this, 0 reaches above the threshold value of one when the mean time until treatment is 1.7 years, and the observed prevalence of 6% occurs at a mean time until treatment of 2 years.
Finally, in Supplementary Material 3 we have performed sensitivity analysis with regards to both the uncertainty in the data gathered and the chosen parametrisation. The sensitivity analysis shows that the results obtained here is robust to alternative parametrisation.

Casual contacts
We assess the effect of explicitly modelling casual sex partners by comparing to the network model with only steady partnerships. We do the comparison with the model without casual sex partners by increasing the mean number of sexual acts within steady partnerships to keep the overall number of sexual acts in the population equal to the model with casual sex partners.
In Fig. 5 we consider how the prevalence changes with different mean times until diagnosis γ −1 . The black dashed line in Fig. 5 shows the prevalence (and the fraction infectious in red) when the casual sex partners are excluded, and the solid line show the prevalence when the casual sex partners are included.
We find that in the model that includes casual sex partners the mean time until diagnosis needs to be much shorter to reduce 0 to below the  when the mean time until diagnosis and successful treatment is 2.5 year, this is shown as the vertical line. For mean times until diagnosis larger than this, an outbreak will result in this endemic level. Fig. 4. Parameter combinations that give rise to a prevalence of 6%. We fix the prevalence to 6% and calculate which parameter values of the infection probability and time to diagnosis and successful treatment gives this prevalence. The filled circle represents the combinations of parameter values when we fix the probability of infection in the primary infection stage to p p = 0.1301 as in Table 2.
threshold value of one compared to the model with only steady partnerships (mean time until diagnosis less than 2.5 years vs 7.2 years). The model excluding casual sex partners yields unrealistic values for when an outbreak is possible; an outbreak would not be possible unless the mean time until diagnosis was larger than 7.2 years. Hence, it is important to incorporate casual sex partners if we want a realistic model. Moreover, the prevalence is much higher in the model that includes casual sex partners. For example, with a mean time until diagnosis of 8 years, the prevalence according to the model that includes casual sex partners is 50%. Whereas the prevalence in the model that does not include casual sex partners is 9%.

Condom use
We examine the effect of changing condom use behaviour on the transmission dynamics by fixing the percentage condom use in one of the two types of contacts (with steady or casual partners) and let the other vary between 0% and 100%.
In Fig. 6 we show which combinations of the mean time until diagnosis and condom use result in a disease-free situation. The diseasefree situation is found for values under the curves ( < 1 0 ) in Fig. 6, and for values above the curves the epidemic is endemic ( 1 0 ). If we fix the condom use with a casual sex partner to the estimated 63% and let condom use in steady partnerships increase by 10% (from 52% to 57%), the mean time until diagnosis and successful treatment can be up to 2.62 years to get 0 below the epidemic threshold value of one. When increasing the condom use with a casual sex partner with 10% (from 63% to 69%) the mean time until diagnosis can be up to 2.75 years to get 0 below a value of one. Next, we fix the mean time until diagnosis to 2.85 years: the value that together with the estimated transmission probability and condom use gives a prevalence of 6%. With this mean time until diagnosis and successful treatment and varying condom use we investigate what happens to the prevalence. From Fig. 7 we see that if the condom use increases from 52% to 69% in steady partnerships, the prevalence would go to 0. If condom use remains fixed for steady partnerships at 52% and we manage to increase the condom use for casual sex partners from 63% to 72% the prevalence would drop to 0.
Finally, we compare the effect of the mean time until diagnosis (and treatment) and the condom use percentages on the prevalence. The comparison is done by a 5% change of one of these three quantities while the other two stay fixed. When the condom use with casual sex partners increases by 5% (from 63% to 66.2%) the prevalence decreases from 6% to 3.8%. If instead the condom use with a steady partner increases by 5% (from 52% to 54.6%) the prevalence decreases from 6% to 5.2%. Lastly, if the condom use is fixed at the estimated values but the mean time to diagnosis and successful treatment decreases by 5% (from 2.85 years to 2.7 years) the prevalence decreases to 3.5%.

Conclusion and discussion
In this paper we study HIV transmission dynamics among MSM using a same-sex stochastic dynamic sexual network model. The model considers both steady sex partners and casual sex contacts, and the rate at which individuals engage in casual contacts depend on their partnership status. We model HIV transmission dynamics on this network as a one-stage infection with diagnosed and successfully treated individuals not being able to transmit infection. We derive the basic reproduction number 0 , the probability of a major outbreak (depending  ). The condom use in steady partnerships and with casual sex partners vary one at a time while the other is fixed to its estimated value. The black line shows the maximum time to diagnosis and successful treatment to still have < 1 0 with varied condom use among steady partnerships while keeping the condom use among casual sex partners fixed. The blue line shows the same thing but when we vary the condom use among casual sex partners and fix the condom use among steady partners. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) on how the index case was infected), and the endemic prevalence. Furthermore, we use sexual behavioural data gathered from MSM visiting an STI clinic in Stockholm, Sweden to parametrise the model.
Our study estimates that the mean duration until diagnosis followed by successful treatment is 2.86 years. In comparison, the mean duration until diagnosis among MSM in Stockholm has been estimated to 2.1 years using data from 2002-2009(Romero-Severson et al., 2015. Other studies among MSM give related estimates, e.g. 2.6 years in Amsterdam (van Sighem et al., 2015) and 3 years in France (Ndawinz et al., 2011). Naturally, we would expect our estimates to be larger as we estimate the time from becoming infectious to the time until successful treatment, rather than the time until diagnosis (thus having an additional delay to successful treatment).
The data used in this paper comes from MSM visiting an STI clinic and hence participants most likely engage in sexual risk behaviour for HIV to a larger extent than average MSM. There may be lower sexual risk behaviour in the complete MSM population. It is possible that individuals with just one (or few) partner(s) might not go to clinics and hence are under-represented in the data. However, individuals with at most one partner are not generally categorised in the risk group under consideration. HIV prevalence might be higher in sub-communities with higher sexual risk behaviour. On the other hand, MSM visiting STI clinics could be at lower risk since they are aware of the positive effects of regular STI testing. Our results should therefore only be generalised to MSM in urban areas attending STI clinics.
Our modelling study indicates that the Swedish MSM population is in a setting where relatively small changes in the mean time until diagnosis and the beginning of successful antiviral treatment can have big effects on the HIV prevalence among the studied MSM population. The results demonstrate the importance of frequent HIV-testing among MSM and consequently the importance of treatment as prevention (TasP) among MSM in Sweden and globally. The sexual behaviour data report a large portion of casual sex partners and our study shows that these casual sex partners have a significant effect on the HIV transmission dynamics in Sweden. Note, however, that the relative importance of casual contacts depends on the population under consideration. For example, Xiridou et al. (2003) find that most new infections among homosexual men in Amsterdam occur with a steady partner. In their data the frequency of unprotected AI within a steady partnership is 30/year. In our data the total frequency of AI is 30/year and the condom use is 52%, leading to half the number of unprotected AI as in Xiridou et al. (2003).
For our Swedish population, disregarding casual sex partners and only modelling steady partnerships would yield a (unrealistic) four-year difference in the estimated mean time until diagnosis for the observed prevalence. Our study also indicates that we could greatly reduce the prevalence in the studied population by encouraging higher condom use: especially in casual contacts. In theory changes in condom use behaviour would make it possible to, within the setting of our model, reduce the prevalence close to zero if we are able to increase condom use from 52% to 69% in steady partnerships or from 63% to 72% with casual sex partners. Behavioural interventions targeting MSM have demonstrated a decrease in unprotected anal intercourse and an increase in reported condom use (Johnson et al., 2005;Herbst et al., 2005;Beyrer et al., 2011). These studies demonstrate that it might be feasible to increase condom use to the estimated level. Our study points to the need to reenergise condom use interventions among MSM in order to turn the epidemic trend in Sweden.
Our relatively simple model captures essential parts of the HIV epidemic among MSM in Stockholm. The sensitivity analysis shows that the results obtained here are robust to alternative parametrisation (see Supplementary Material 3.2). When increasing the concurrency allowed in our model, to determine an upper bound on how big of an effect concurrent steady partnerships could potentially have, we find the observed prevalence of 6% occurs at a mean time until treatment of 2 years (Supplementary Material 2.3).
As with any model, limitations exist in ours. The model is intentionally kept simple in order to be able to disentangle the roles that casual sex partners and steady sex partners have on 0 and the endemic prevalence. This advantage comes at the cost that the model conclusions cannot be directly translated into policy making. In order to understand which complexities play an important role in the transmission dynamics one ideally compares the conclusions of more complicated models to simpler models. Our simplified model still allows us to obtain reasonable estimates of the time until successful treatment, which indicates that the model is accounting for some of the most important mechanisms. With our model it is also straightforward to explore a large parameter space, which is especially important for the parameter values with larger uncertainties.
In the model we have assumed that the partnership formation and dissolution are independent of HIV transmission; we do not allow for the possibility to choose partners based on your own or your partner's infectious status. With additional data on serosorting, this is one aspect to consider in future model developments. There are some other important aspects to address in future work: (i) Heterogeneity in the population is only incorporated by assuming that individuals behave differently regarding casual contacts based on whether or not they have a steady sexual partner. In reality there is more heterogeneity in the population than we address in our current model. One aspect worth exploring (ongoing work) within the framework of the current model is to allow for some individuals to be much more sexually active: the possibility of super-spreaders. (ii) Our model includes the possibility to have both a steady partnership and casual sex partners. However, it does not include the possibility of concurrent steady partnerships, which we know to occur among MSM in Stockholm based on the sexual behaviour data. The inclusion of concurrent steady partnerships into the mathematical models comes with both benefits and costs. The benefits gained are maybe the most apparent: a more realistic model. However, concurrency in multiple partnerships with non-zero duration is much harder to model than instantaneous casual contacts. This form of concurrency creates dependencies between the partners of partners, and it is therefore necessary to keep track of the entire network structure instead of individuals. Our modelling approach of taking the individual perspective, i.e. keep track of the partnership status and Fig. 7. Effect of condom use on the HIV prevalence. The condom use in steady partnerships and with casual sex partners vary one at a time while the other is fixed to its estimated value. The black line shows the prevalence with varied condom use among steady partnerships while keeping the condom use among casual sex partners fixed. The blue line shows the prevalence when we vary the condom use among casual sex partners and fix the condom use among steady partners. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) disease status of each individual, would break down. The cost of including concurrent steady partnerships is therefore the loss of the individual perspective which provides the opportunity to investigate a continuum of scenarios (e.g. vary the level of condom use from 0 -100%). (iii) We have used two relationship types, distinguished by whether or not they are of a regular repeated type (steady) or if the number of sexual encounters is very few (casual). Another approach would be to create the relationship types as in Goodreau et al. (2017) or Jenness et al. (2016), where the casual sex partners are further divided into casual partnerships with repeated contacts and one-time contacts. (iv) Condom use is modelled in such a fashion that a condom is used in each sexual act with a given probability; it is assumed that even if you have sex several times with the same partner you always have the same probability to use a condom. For casual sex partners this assumption seems valid since you only have sex once (or very few times) with the same individual, but less so in steady partnerships. When having regular sexual contact with the same partner, it is likely that you either always or never use a condom. (v) Our model does not take into account the effects of co-infections, which could increase the HIV transmission probability. One possibility, rather than to model co-infections explicitly, would be to increase the HIV transmission probability according to some factor depending on the prevalence of other STIs. (vi) Finally, the probability of infection in one sexual act takes a weighted average of infectiousness in the different stages of infection. We have therefore simplified the HIV disease progression by modelling a onestage infection with diagnosed individuals on successful treatment not being able to transmit (Anderson, 1988;Longini et al., 1989): this is the case for 95% of persons diagnosed and under treatment for HIV in Sweden. An alternative would be to explicitly model the different stages of HIV infectiousness. For the endemic steady state, we believe that averaging over the different stages of infectiousness does not play an important role. However, if we were studying the dynamics during short time frames and for the early stages of an epidemic this averaging could have a larger impact.
Despite the limitations of our model, our study allows for better insights into the HIV epidemic among MSM in Sweden. We conclude that not only are casual contacts frequently reported in data, they also play an important role in the transmission dynamics in the population. We obtain an estimate for the mean time until diagnosis and successful treatment that is consistent with other studies. Moreover, our modelling study indicates that reductions in the mean time until diagnosis and successful antiviral treatment could potentially reduce 0 close to the epidemic threshold value of one, as would moderate increased condom use particularly in casual relationships. The results highlight the feasibility of and need to increase implementation of HIV testing and condom use interventions among MSM in Sweden in order to turn the HIV epidemic trend.