Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Feature normal approximation #54

Merged

Conversation

ckoerber
Copy link
Contributor

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 the get_yy method in bayes_chime/normal/scripts/cli.py:

yy_sdev = yy_mean * rel_err + abs_err

If no y-error file is provided, the script runs an empirical Bayes check to infer the abs_err size for rel_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

  • Normal data plotting functions plot_gvar and plot_band now have a y_min argument which cuts off the error band when values are smaller than y_min. Note that this is only visual and does not change computations.

@cranedroesch cranedroesch self-assigned this Apr 28, 2020
@cranedroesch cranedroesch self-requested a review April 28, 2020 15:45
@cjbayesian
Copy link
Contributor

This LGTM. Is this ready to be merged ahead of #62 ?

@cranedroesch cranedroesch merged commit 14eb40a into pennsignals:master May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants