A module for creating descriptive graphs and extracting relavent data from a Simpact object.
Generates a scatter plot of male and female ages for each relationship formed. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Generates a scatter plot of male and female ages for each relationship formed. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Generates a heat map of male and female ages for each relationship formed. Finer or coarser grain grid can be made by changing grid. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Calculates the point prevalence of concurrency in the sexual network. This is defined as the proportion of relationships in which at least one of the partners is in an additional relationship. If time is provided, the concurrency will be calculated for the sexual network for that time. The default time is the end of the simulation.
Returns a list of lists, with the first dimension being time, the second dimension being age groups. User is able to specify time_granularity, i.e. how often to sample, box_size, the size of age boxes, num_boxes, the number of age boxes to use.
Generates a graph of the demographic make-up of the population over time. User is able to specify time_granularity, i.e. how often to sample, box_size, the size of age boxes, num_boxes, the number of age boxes to use. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Generates an age mixing scatter for many relationships with random ages for partners colored by the hazard of formation.
Returns a list of the number of relationships at every timestep.
Generates a plot of the number of relationships over time. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Generates a histogram of gap lengths (i.e. the time between relationships for individuals).
NOTE: THIS FIRST PASS SOLUTION IS INCORRECT. The gap length is the time between the most recently ended relationship and the start of the next. Currently it is just between the previous relationship and the start of the next (the previous relationship isn’t always the most recently ended)
Returns a list with total number of infections at every timestep.
Generates percentages of men and women 15-19 who have had intergenerational relationships. Inspired by 2008 SA Health Survey, used for validation graphs. Note: current implementation is slow and ugly, but intuitive.
Generates percentages of men and women who have had multiple partners in the past 12 months. Inspired by 2008 SA Health Survey, used for validation graphs. Note: current implementation is slow and ugly, but intuitive.
Calculates and returns the partner turnover rate of a simulation.
Returns a list with total number of individuals at every timestep.
Returns a list with prevalence at every time step.
Generates a graph of prevalence over time. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Makes a graph with a line for each relationship. This is an extremely slot graph.
Generates a histogram of relationship durations in the simulation.
Generates the cumulative sexual network graph. layout specifies the way that the agents should be arranged (‘spring’,’circular’,’bipartite’) If time is provided, the sexual network at that time will be drawn. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.
Generates a heat map of male and female ages for each relationship formed. Finer or coarser grain grid can be made by changing grid. If filename is provided (string), the graph is saved to the file instead of displayed on the screen.