Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

leighjohnson/MicroCOSM

Domain:

healthcare

Record type:

model
Creator:
lei
Host:
Agent-based model of HIV & STIs in South Africa # Notes on producing results using MicroCOSM This document provides details on how to replicate the results presented in our submission to *PLOS Medicine* (‘Money, jobs or schooling? A model-based evaluation of economic strengthening in South Africa and its impact on HIV, sexually transmitted infections and teenage births’). It is not intended as a user guide, but in Appendix B we have provided some general guidance on the model code. The code was written in C++, and was compiled and run using the gcc compiler. The default code that we have shared is the code used to run the model up to 2025, with a sample of 100 parameter combinations drawn from the main posterior distribution, not allowing for any economic strengthening interventions (i.e. the baseline scenario). The lists that follow provide more detail on the specific code changes need to replicate the published model outputs. For convenience, we have also included two spreadsheet files: Likelihood.xlsx (which shows how the likelihood values were calculated) and Posteriors.xlsx (which shows how the posterior sample was drawn, based on the likelihood values). ## To do the calibration to the data from randomized controlled trials (RCTs): - Set `ProjectionTerm = 27`. - Set `BaselineStart = 2005`. - Set `FixedUncertainty = 0`. - Set `StructuralRCTcalib = 1`. - In the OneSimulation function, make sure the command `if (StructuralRCTcalib == 1){ RunStructRCTs(); }` is active (not commented out). - Set `ParamCombs` and `samplesize` to 5000 (or whatever sample size you want to use in the initial calibration step). - Run the model. The command line to compile in gcc is `g++ -std=c++14 Microsimulation.cpp StatFunctions.cpp mersenne.cpp -o Microsimulation.exe`. After the model has compiled, the command to run the model is just `./Microsimulation`. - After you’ve finished producing results, copy the contents of the CashTransferOut, SchoolSupportOut and VocationTrainingOut files into cell A6 of the corresponding sh …

Visit

github.com

Licenses

MIT

Similar

leighjohnson/Thembisacarivs/MicroCOSMleighjohnson/STI-HIV-ModelContextualizing Complex Social Contact: Mauritius, a Microcosm of Global Diaspora

leighjohnson/Thembisa

HIV and TB model for South Africa # Thembisa This repository contains code and supporting files fo

carivs/MicroCOSM

This repository includes the codebase and documentation for MicroCOSM (Microsimulation for the Contr

leighjohnson/STI-HIV-Model

Demographic model of South African HIV epidemic Instructions for users of the STI-HIV model #######

Contextualizing Complex Social Contact: Mauritius, a Microcosm of Global Diaspora

This article supplements current dialogue on the archaeology of slavery, offering an Indian Ocean co