Giter Club home page Giter Club logo

Comments (5)

bob-carpenter avatar bob-carpenter commented on June 5, 2024

Thanks for filing such a carefully researched issue. We really appreciate it.

Is the book not building from the shell scripts?

The code you're looking for defining the one-draw function is in src/bayes-stats-stan/before-chapter.R. This is how bookdown suggests code used in every chapter should be organized---as an include. I find the bookown config very confusing in the way it is spread over (at least) three locations, _bookdown.yml, _output.yml, and index.Rmd. The specification to use before-chapter.R is in our _bookdown.yml, which contains the line

before_chapter_script: "before-chapter.R"

The reason the code in before-chapter.R shows up elsewhere stems from the awkward implementation of bookdown, which rather than just running before-chapter.R, actually pastes it into the front of each .Rmd file. This means each such file is touched for each build; it tries to erase it at the end, but if you stop the build in the middle, it lingers rather than getting properly cleaned up. Then you can get multiple before-chapter includes, so we have to keep cleaning them. We've been fighting against this unfortunate behavior. I filed an issue against bookdown, and they're aware of it, but they are not going to fix it as far as I know.

We're happy to entertain suggestions for how to better organize this without having to manually cut-and-paste code into the front of each chapter.

Just as a heads up, we're going to remove all of the displayed R from the bookdown, because this book isn't meant to be about R, it's meant to be about Stan. The current state arose from @andrewgelman adding new material in R to the front of our user's guide (one of the new R-heavy chapters is from @jgabry's teaching material). This needs to be cleaned up. When there's no R at all in the text, will it be less confusing about where code is?

from docs.

cfbeuchel avatar cfbeuchel commented on June 5, 2024

I wasn't trying to build the book but simply found it when looking for documentation and started reading. I have no experience with bookdown so I don't have any suggestions there. My simple point was, that the online HTML version on mc-stan.org doesn't include the code and the extract_one_draw-function in before-chapter.R and therefore makes the example non-reproducible unless the reader cross-references the source .Rmd documents here on GitHub.

R certainly makes it easier for the uninitiated user like me to get started, but the resources for that are available elsewhere (e.g. the fantastic book by Richard McElreath) and hello-world examples like this would certainly also be clear and instructive without it.

But the future goal of removing the R-code altogether renders this issue pointless, which I realize is still in the wrong repository... Thank you for taking the time to answer me. I'm looking forward to delving deeper into Stan and the book looks like a fantastic resource for this.

from docs.

bob-carpenter avatar bob-carpenter commented on June 5, 2024

Thanks for clarifying. I see how having some R but not all of it in the .html output is confusing. Hopefully after I clean this up, it'll be clear that it's just pseudocode explaining what's going on at a high level. In that way, it'll be more like the BUGS Book than like our case studies.

P.S. This is the right repository. We're going to put all the high-level doc for the language here. The interfaces have their own documentation---RStan has a lot of nice vignettes, for example.

from docs.

gdmcdonald avatar gdmcdonald commented on June 5, 2024

The R code seemed really useful to me, It'll be basically useless to me without it. Although I also wondered where the extract_one_draw() function was.

from docs.

bob-carpenter avatar bob-carpenter commented on June 5, 2024

Thanks for the feedback. I think we're going to wind up pulling these first few R tutorial chapters on workflow out into their own book. They have two problems as is: they're not finished/edited up to our manual standards, and they use R, when this is meant to be interface neutral.

from docs.

Related Issues (20)

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.