Code Monkey home page Code Monkey logo

book's Introduction

wercker status

This book is a written companion for the Course Bayesian Statistics from the Statistics with R specialization available on Coursera, but may be used on its own as an open-access introduction to Bayesian inference using R. Materials and examples from the course are discussed more extensively and extra examples and exercises are provided. There are optional sections for those interested in understanding some of the derivations behind Bayesian statistics.

To run any of the examples in the book or access data sets used in the book, please install the current versions of statsr and BAS from CRAN.

install.packages('statsr', dep=T)
install.packages('BAS', dep=T)

Other packages that are used are listed in the preface of the book.

Please note that the book and statsr package on CRAN are for supporting the next release of the course. If you are currently enrolled in the Coursera course, please use caution in updating as some functions have been deprecated or modified.

book's People

Contributors

andreaswachowski avatar cgoo4 avatar eddelbuettel avatar eduos avatar epkanol avatar jonthegeek avatar lizzyhuang avatar luciorq avatar markbneal avatar merliseclyde avatar mine-cetinkaya-rundel avatar psychelzh avatar rundel avatar star1327p avatar wal avatar windson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

book's Issues

2.2.1 Inference on a Binomial Proportion - standard deviation issue

While explaining a Bayesian approach it says:
"Before she saw the data, the Bayesian’s uncertainty expressed by her standard deviation was 0.71. After seeing the data, it was much reduced – her posterior standard deviation is just 0.13."

But, considering beta(1,1) before the data and beta(1,5) after the data, the standard deviation should be 0.289 and 0.141 respectively.

Loss functions discussion

At the end of chapter 3.1, the last sentence is:

And in decision theory, one seeks to minimize one's expected loss

Coming from an economics perspective, we seek to maximise gain. from a maths perspective minimising F(x) is the same as maximising G(x) = -F(x). Is this worth a footnote?

Then in section 3.2, paragraph four states:

Here, of course, instead of minimizing expected losses, we want to maximize the expected gain.

Then it is suggested to use the mode. I think the point is that whether the problem is max gain or min loss makes no difference - in this case the binary loss (or gain) function is why the mode is now relevant. Perhaps this could be made clearer?

Ps - I found this diagram helpful to clarify for me.
https://www.stat.auckland.ac.nz/~brewer/stats331.pdf
loss functions

Redundant paragraph in chapter 1

At the end of section 1.1.2, the same question is asked to the reader twice.

If an individual is at a higher risk for having HIV than a randomly sampled person from the population considered, how, if at all, would you expect P(Person tested has HIV∣ELISA is positive) to change?
...
Example 1.3 If the an individual is at a higher risk for having HIV than a randomly sampled person from the population considered, how, if at all, would you expect P(Person tested has HIV ∣ ELISA is positive) to change?
...

If you agree with this issue, I'm happy to fork and send a PR to fix it.

Enhance pdf formatting

Great book! I read the pdf version. As html is probably your primary version, it could be a low priority to have a “beautiful” pdf version, so feel free to ignore these suggestions.

  1. If page numbers were consistently at the bottom, it would give you more space for the sometimes long titles, such as page 108. To fix, see E.g. https://community.rstudio.com/t/custom-position-of-page-numbers/7873?u=mbn

  2. If you are happy that chapter is redundant, that would also give you more room for text on page headers. To fix, see E.g. https://stackoverflow.com/questions/43757899/how-to-remove-the-word-chapter-from-the-chapter-headings

  3. Figures (and tables) are sometimes printed well before they are mentioned in the text. I think this happens automatically by default. My personal preference would be that figures are always after they are mentioned, even if it ends up creating more white space. To fix, see eg https://community.rstudio.com/t/cant-control-position-of-tables-and-figures-in-knitted-pdf-document/37364/3?u=mbn

  4. Code occasionally goes a bit wide e.g. p.126. However, most people that want to use the code will be looking at an electronic version, so maybe this doesn’t matter?

  5. Some people may print in black and white, in which case some graphs will still be legible (e.g. Figure 5.1 with dots and dashes), and others will not (e.g. Figure 2.4).

BPM coefficients don't align with explanatory variables in BPM model - bas and pred.bas objects

In Section 8.4 the coefficients that are extracted from the coefficients object do not have zeros where expected for the Best predictive model due to an issue that the reference to the best model refers to the location of the best model in the original bas object but the order to the output from coef.bas is sorted based on model probabilities. Updated the chapter with the correct code so that the coefficients correspond to the correct model. See Issue merliseclyde/BAS#49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.