Repository navigation
13.3: add an example on the number of bootstrap repetitions - #268
Open
prawalpokharel wants to merge 1 commit into
Open
prawalpokharel wants to merge 1 commit into
prawalpokharel wants to merge 1 commit into
Conversation
Add a short subsection after "Care in Using the Bootstrap Percentile Method". It builds the 95% interval for the proportion of smokers ten times each with 100, 1,000 and 10,000 repetitions, then compares how far apart the ends are and how wide the intervals are. The text ties the width to the 1,174 mothers in the sample. Existing cells and outputs are unchanged. The new code cells have outputs from a fresh run of the notebook.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Section 13.3 recommends thousands of bootstrap repetitions, and the 80% interval discussion says a narrower interval needs a larger sample. This adds a short subsection after "Care in Using the Bootstrap Percentile Method" that puts the two numbers side by side.
It builds the 95% interval for the proportion of smokers in
birthsten times each with 100, 1,000 and 10,000 repetitions. Two smallgrouptables then show how far apart the ends are and the average width. With more repetitions the ends agree more closely, and the average width stays between 0.05 and 0.06.The code uses the chapter's tools (
make_array,np.appendin a loop,percentile,group). It resamples only theMaternal Smokercolumn withnp.random.choice, since 111,000 calls tobirths.sample()would take about 5 minutes. The new cell takes about 5 seconds.The book is not seeded, so the text quotes no single run. I checked each sentence that depends on the random draws against 1,000 seeded reruns of the new cells, and each held in at least 99% of them. The notebook runs from a fresh kernel without errors, existing cells and outputs are unchanged, and the new cells have outputs from that run. A build with jupyter-book 2.1.7 on Node 22 changes only the 13.3 page.
The accessibility check has been failing on recent runs because of the footer links (#264), so it may fail here too.
Separately, since book-theme 2.0.0 (Nov 10),
jupyter-book build --htmlfails on Node 18 withnode: bad option: --env-file=./.env.prod. The deploy workflow uses Node 18, so the next deploy will probably fail. #267 moves it to Node 22, and it would be worth merging that first.Happy to shorten this, move it, or drop the second table.