This item includes a set of scripts containing functions to perform quality control (QC) on daily rainfall data, meaningfully disaggregate cumulative totals over arbitrary periods and subsequently do infilling of missing values. The procedure is focussed on known shortcomings of South African rainfall data.
The novel component of the procedure is its use of Generalised Additive Models for Location, Scale and Shape (GAMLSS) both for infilling of daily values and for assessing the probability of observing values as extreme as suspect recorded values or sequences of values. Models are fit for the probability of rainfall occurrence and the mean and variance of daily totals, as parameters of a Zero-Inflated Gamma distribution. Other GAMLSS-compatible distributions could relatively easily be used instead. The infilling is quasi-stochastic: rainfall occurrence is modelled as a binomial random variable, mean estimates of rainfall amount are used directly if a day is selected as a rain day.
Details of the functions used and the inputs of each major
component of the procedure are set out in the files provided.
Comments preceded by 3 hashes (`###`) at the top of a function contains such descriptions.
A forthcoming paper will describe the procedure in full detail and demonstrate its effectiveness on a test dataset. The procedure is briefly described in a paper that has been accepted for publication and will be available shortly.
The freely available components of the WRZ2019 dataset (https://doi.org/10.25375/uct.16453452.v1) can be used to test (parts of) the procedure. A script `run_DWS2019.R` is included to demonstrate how this may be done.
To run this test, the following directory structure is required: