This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR extends the previous normal approximations PR (#49) by adding a command-line interface. It aims to follow the logic of existing CLI interfaces.
New Feature
After reinstalling this module
pip install [--user] [-e] .
the command-line tool
bayeschime
will be present.This script reads in inputs, runs a fit, and dumps results to an output folder.
Example usage:
> bayeschime -p data/Downtown_parameters.csv -d data/Downtown_ts.csv \ -y data/data_errors.csv -o output/ -v
Notes about data uncertainties
The posterior estimations need to know about uncertainties in the data. These uncertainties are defined in
data/data_errors.csv
and used in theget_yy
method inbayes_chime/normal/scripts/cli.py
:If no y-error file is provided, the script runs an empirical Bayes check to infer the
abs_err
size forrel_err=0
.For now, I do not have a solid understanding of the size of these errors. In studies of the NYC data, binning dates in the range of 1-4 days and looking at fluctuations of new admissions suggested that relative errors in admissions are at the order of 10%. Setting the
abs_err
to ~10 is important to not emphasize early dates too much (as the routine focuses on points with smaller errors).Further updates
plot_gvar
andplot_band
now have ay_min
argument which cuts off the error band when values are smaller thany_min
. Note that this is only visual and does not change computations.