diff --git a/.gitignore b/.gitignore index 3e36128..9cdb85a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,11 @@ figures/* src/* *.md.tmp +# gets copied over during deployment +docs/index.md + +site/* + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/.travis.yml b/.travis.yml index ee36b9b..b80dc92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ script: # - jupyter nbconvert --config nbconvert_config.py --execute # Build docs using mkdocs - - mkdocs build + - make docs # This is an example to deploy to a branch through Travis. diff --git a/Makefile b/Makefile index 8397300..87d3f6f 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,21 @@ .PHONY: docs -execute_params = --execute --ExecutePreprocessor.timeout=600 +# execute_params = --execute --ExecutePreprocessor.timeout=600 -RAWNBS = $(wildcard notebooks/*.ipynb) -HTMLS = $(patsubst notebooks/%.ipynb, ../docs/%.html, $(rawnbs)) +# RAWNBS = $(wildcard notebooks/*.ipynb) +# HTMLS = $(patsubst notebooks/%.ipynb, ../docs/%.html, $(rawnbs)) -htmldocs: - jupyter nbconvert notebooks/bayesian-estimation-multi-sample.ipynb --output ../docs/bayesian-estimation-multi-sample.html - jupyter nbconvert notebooks/degrees-of-freedom.ipynb --output ../docs/degrees-of-freedom.html - jupyter nbconvert notebooks/dirichlet-multinomial-bayesian-proportions.ipynb --output ../docs/dirichlet-multinomial-bayesian-proportions.html - jupyter nbconvert notebooks/mixture-model.ipynb --output ../docs/mixture-model.html - jupyter nbconvert notebooks/hierarchical-modelling.ipynb --output ../docs/hierarchical-modelling.html - jupyter nbconvert notebooks/poisson-regression.ipynb --output ../docs/poisson-regression.html +# htmldocs: +# jupyter nbconvert notebooks/bayesian-estimation-multi-sample.ipynb --output ../docs/bayesian-estimation-multi-sample.html +# jupyter nbconvert notebooks/degrees-of-freedom.ipynb --output ../docs/degrees-of-freedom.html +# jupyter nbconvert notebooks/dirichlet-multinomial-bayesian-proportions.ipynb --output ../docs/dirichlet-multinomial-bayesian-proportions.html +# jupyter nbconvert notebooks/mixture-model.ipynb --output ../docs/mixture-model.html +# jupyter nbconvert notebooks/hierarchical-modelling.ipynb --output ../docs/hierarchical-modelling.html +# jupyter nbconvert notebooks/poisson-regression.ipynb --output ../docs/poisson-regression.html -html: $(HTMLS) - jupyter nbconvert $< --output $@ +# html: $(HTMLS) +# jupyter nbconvert $< --output $@ docs: - mkdocs serve + cp README.md docs/index.md + mkdocs build diff --git a/README.md b/README.md index acd8562..9c1aa80 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Papers: - [Bayesian Estimation Supersedes the t-Test](https://doi.org/10.1037/a0029146) Videos: + - [Computational Statistics I @ SciPy 2015](https://www.youtube.com/watch?v=fMycLa1bsno) - [Computational Statistics II @ SciPy 2015](https://www.youtube.com/watch?v=heFaYLKVZY4) - [Bayesian Statistical Analysis with Python @ PyCon 2017](https://www.youtube.com/watch?v=p1IB4zWq9C8) diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 2101031..0000000 --- a/docs/index.md +++ /dev/null @@ -1,77 +0,0 @@ -# Bayesian Analysis Recipes - -## Introduction - -I've recently been inspired by how flexible and powerful -Bayesian statistical analysis can be. -Yet, as with many things, flexibility often means a tradeoff with ease-of-use. -I think having a cookbook of code that can be used -in a number of settings can be extremely helpful -for bringing Bayesian methods to a more general setting! - -## Notebooks - -There is one notebook per model. In each notebook, you should end up finding: - -- The kind of problem that is being tackled here. -- A description of how the data should be structured. -- An example data table. -It generally will end up being **[tidy](http://vita.had.co.nz/papers/tidy-data.pdf)** data. -- PyMC3 code for the model; in some notebooks, there may be two versions of the same model. -- Examples on how to report findings from the MCMC-sampled posterior. - -It is my hope that these recipes will be useful for you! - -## (hypo)thesis - -My hypothesis here follows the Pareto principle: -a large fraction of real-world problems -can essentially be modelled with a core collection of models, -each of which have a Bayesian interpretation. - -In particular, -I have this hunch that commonly-used methods like ANOVA -can be replaced by conceptually simpler -and much more interpretable Bayesian alternatives, -like John Kruschke's BEST (**B**ayesian **E**stimation **S**upersedes the **T**-test). -For example, ANOVA only tests whether means of multiple treatment groups are the same or not... -but BEST gives us the estimated posterior distribution over each of the treatment groups, -assuming each treatment group is i.i.d. -Hence, richer information can be gleaned: -we can, given the data at hand, -make statements about how any particular pair of groups are different, -without requiring additional steps such as multiple hypothesis corrections. - -## Further reading/watching/listening - -Books: - -- [Bayesian Methods for Hackers](https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers) -- [Think Bayes](http://greenteapress.com/wp/think-bayes/) - -Papers: - -- [Bayesian Estimation Supersedes the t-Test](http://www.indiana.edu/~kruschke/BEST/BEST.pdf) - -Videos: - -- [Computational Statistics I @ SciPy 2015](https://www.youtube.com/watch?v=fMycLa1bsno) -- [Computational Statistics II @ SciPy 2015](https://www.youtube.com/watch?v=heFaYLKVZY4) -- [Bayesian Statistical Analysis with Python @ PyCon 2017](https://www.youtube.com/watch?v=p1IB4zWq9C8) -- [Bayesian Estimation Supersedes the t-Test](https://www.youtube.com/watch?v=fhw1j1Ru2i0) - -## Got Feedback? - -There's a few ways you can help make this repository an awesome one for Bayesian method learners out there. - -**If you have a question:** -Post a [GitHub issue](https://github.com/ericmjl/bayesian-analysis-recipes/issues) -with your question. -I'll try my best to respond as soon as possible. - -**If you have a suggested change:** -Submit a [pull request](https://github.com/ericmjl/bayesian-analysis-recipes/pulls) -detailing the change and why you think it's important. -Keep it simple, no need to have essay-length justifications; -this also makes things easier for me to review. -As usual, I will get back to you as soon as I can. diff --git a/environment.yml b/environment.yml index aaa5be5..d08561d 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - pymc3=3.8 - mkl-service - theano -- arviz +- arviz>=0.6.0 - missingno - pygpu - scikit-learn diff --git a/mkdocs.yml b/mkdocs.yml index 75afea7..c7067b5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,11 +5,17 @@ theme: palette: primary: 'green' accent: 'green' - logo: - icon: 'library_books' + icon: + logo: material/equalizer + features: + - instant + - tabs plugins: - - search + - search: + separator: '[\s\-\.]+' + lang: + - en - mknotebooks: execute: false write_markdown: true @@ -31,11 +37,11 @@ repo_url: 'https://github.com/ericmjl/bayesian-analysis-recipes' extra: social: - - type: 'envelope' + - icon: 'material/mail' link: 'http://www.shortwhale.com/ericmjl' - - type: 'github' + - icon: 'fontawesome/brands/github' link: 'https://github.com/ericmjl' - - type: 'twitter' + - icon: 'fontawesome/brands/twitter' link: 'https://twitter.com/ericmjl' - - type: 'linkedin' + - icon: 'fontawesome/brands/linkedin' link: 'https://linkedin.com/in/ericmjl'