/mbml-eczema

Mechanistic Bayesian Machine Learning model of eczema dynamic

Primary LanguageRGNU General Public License v3.0GPL-3.0

Personalised prediction of daily eczema severity scores using a mechanistic machine learning model

This repository contains the code written for the article by Hurault et al. (2020), "Personalised prediction of daily eczema severity scores using a mechanistic machine learning model", published in Clinical & Experimental Allergy. The code is written in the R language for statistical computing and the models using the probabilistic programming language Stan.

File structure

The Models folder contains:

  • Our two models
    • BaseModel.stan: the auto-regressive model based on an Exponentially Modified Gaussian distribution.
    • ExtendedModel.stan: an extension of this model to include measurements present in SWET but not in the Flares dataset. This model notably takes into account the quantity and potency of the treatment use in the determination of the different treatment responsiveness, as well as demographic factors.
  • Two benchmarks (the other benchmarks, the uniform and historical forecasts, are computed in the validation.R script)

These models, except the ExtendedModel, can be fitted to the Flares and SWET datasets in fitting.R. The ExtendedModel can be fitted in fitting_ext.R.

Forward chaining is implemented in validation.R and these results analysed in results_validation.R.

Utility functions used within the scripts are available in functions.R. In addition, we used functions from Guillem Hurault's personal package, HuraultMisc.

The Flares and SWET datasets are not available according to our data sharing agreement. During the analysis, these datasets are loaded from a proprietary package TanakaData which includes the raw files as well as data processing functions. Further processing is performed by functions written in functions_data.R.

Nonetheless, it is possible to generate fake data from the prior predictive distribution of the different proposed models. We implement this, as well as prior predictive check and fake data check in prior_fake_check.R.

Finally, plots.R is used to produce several plots present in the paper.

License

This open source version of mbml-eczema is licensed under the GPLv3 license, which can be seen in the LICENSE file.

A closed source version of mbml-eczema is also available without the restrictions of the GPLv3 license with a software usage agreement from Imperial College London. For more information, please contact Vaibhav Sharma.