GSUA-stochastic tools: Jupyter Python Notebooks for ABM and other stochastic model analysis
Often knowledge and data available for building and testing Agent-Based Models (ABM) and their parts are scarce. Due to ABM output complexity and stochasticity, exhaustive analysis methods are required to increase ABM transparency and ensure that the ABM behavior mimics the real system. Global sensitivity and uncertainty analysis (GSUA) is one of the most used model analysis methods, as it identifies the most important model inputs and their interactions and can be used to explore model behaviors that occur in certain regions of the parameter space. However, due to ABM’s stochastic nature, GSA application to ABMs can result in misleading interpretations of the ABM input importance. Here we present a recently proposed framework (Carmona-Cabrero et al., 2024) to analyze stochastic models with an extension of the original GSUA for deterministic models. We will use and ABM (dynamic prey-predator) example provided with the HPC Scripts for GSUA (PreyPredator.jar). We developed 4 jupyter notebooks (Python-3.x kernel ) that follow the 4 main steps in the GSA of stochastic models including the design and analysis of interventions:
Download jupyter python notebooks, auxiliary funtions and sample inputs and outputs here:
- Notebook 1: Create a Sobol GSUA sample with a number of replications for each sample and prepare the sampling matrix (matrix.txt) file ready to run the model (notebook creates HPC jobs with our HPC class scripts make_jobs.sh).
- Notebook 2: Analyze the GSUA results from replicated simulations of the model to decompose the variance of the output into a deterministic and stochastic components and the input factors controlling each, pilot the results (ring diagrams)
- Notebook 3: Design an intervention strategy to improve the probability of achieving the desired outcome of sheep population >70 (behavioral outcome). We will employ Monte Carlo Filtering (MCF) to identify input factors suitable for intervention and prepare the intervention input sample file ready to run in the HPC.
- Notebook 4: Do the post-intervention analysis to quantify the effectiveness of the proposed intervention and discussion.
- Auxiliary funtions, sample input and output files for notebooks: Please please this in the same directory as the jupyter python notebooks before running them.
Description
Please click on the tabs below to see the documentation for each of the notebooks.
Acknowledgements
This work is part of the project “Towards a Multi-Scale Theory on Coupled Human Mobility and Environmental Change.” The project team acknowledges support from the Army Research Office/Army Research Laboratory. The research reported in this grant was supported in whole or in part by the Army Research Office/Army Research Laboratory under award no. W911NF1810267 (MURI Multidisciplinary University Research Initiative). The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies either expressed or implied of the Army Research Office or the US Government.
Program License
These software is distributed as Freeware/Public Domain under the terms of GNU-License. If the program is found useful the authors ask that acknowledgment is given to its use in any resulting publication and the authors notified.
- Dr. Rafael Muñoz-Carpena and Alvaro Carmona-Cabrero
Distinguished Professor, Hydrology & Water Quality, Biocomplexity Engineering
Department of Agricultural & Biological Engineering
University of Florida
P.O. Box 110570
287 Frazier Rogers Hall
Gainesville, FL 32611-0570
(352) 294-6747
(352) 392-4092 (fax)
carpena@ufl.edu
© GNU-License Copyright 2024 - Rafael Muñoz-Carpena
References
- Carmona-Cabrero*, A., R. Muñoz-Carpena, R. Muneepeerakul, W.S. Oh*. 2024. Decomposing variance for stochastic models: application to a proof-of-concept human migration agent-based model. Journal of Artificial Societies and Social Simulation (JASSS) 27(1) 16, doi:10.18564/jasss.5174.
- Oh*, W.S., A. Carmona-Cabrero, R. Muñoz-Carpena, R. Muneepeerakul. 2022. On the interplay among multiple factors: effects of factor configuration in a proof-of-concept migration agent-based model. Journal of Artificial Societies and Social Simulation (JASSS) 25(2):7. doi:10.18564/jasss.4793.
- Muñoz-Carpena, R. Class notes on UF eLearning system.
- Alberts, J. (2017). Sim2D. Java Tutorials. Retrieved from University of Washington - Center for Cell Dynamics.
This page was last updated on August 30, 2024.