Modelling quantities and qualities of faecal sludge for improved management solutions

This is the source code repository for the analyses reported in the article Modelling quantities and qualities (Q&Q) of faecal sludge in Hanoi and Kampala for improved management solutions

The repository is maintained by Juan Pablo Carbajal juanpablo.carbajal@eawag.ch. Please do not hesitate to contact us with bug reports (you can also use the issue tracker), questions, and comments.

Folder structure

The repository has the following structure:

├── data       # Data files
├── doc        # Some documents used during the development of the project
├── mfiles     # Gnu Octave functions and script to reproduce all results
└── README.md  # This file

The data folder includes a filtered version of the whole raw data that can be obtained from the data archive.

The doc folder has working documents that we used during the development of the project, as well as the Latex sources of the supplementary information published along the article.

The mfiles folder contains all the scripts needed to reproduce the results reported in the article. In this folder, files with prefix s_ are scripts that will generate reports and figures of the results. All other files are functions used to make the scripts simpler and easier to read.


For the scripts to work you need GNU Octave 4.4 or later. You will also need the packages statistics (1.4.0 or later) and gpml (4.2.0 or later) installed.


In Windows, the statistics package should be included in your GNU Octave distribution. The GPML package for windows can be installed from this link


In Linux you can install the statistics package running the following command in the octave prompt (the io package is a dependency)

pkg install -forge io statistics

The gpml package can be installed with the following command

pkg install https://bitbucket.org/KaKiLa/gpml/downloads/gpml-4.2.0.tar.gz

which downloads the mirror of the official package

Reproduce results

Figures are generate by scripts (m-files with prefix s_). Here is the list:

  • Figure 1 and 2: s_TS_gp_Hanoi.m
  • Figure 3 and 4: s_TS_gp_Kampala.m
  • Figure 5 and 6: s_inflow_gp_Hanoi.m
  • Figure 7 and 8: s_inflow_gp_Kampala.m
  • Figure 9 and 10: s_inflow_gp_Household.m

The script s_inflow_constrained_correction.m reports results on the effect of the constrained amplitude of the covariance function. The covariance function is used as a correction term, hence its amplitude is constrained to be smaller then the mean function for each input. You can generate the report with more details running

publish s_inflow_constrained_correction.m

This will generate an html folder with the report in html format, which you can read in your web browser. You can do the same for all scripts mentioned here.