[ ]:population=Table().with_column("serial number", np.arange(1,150+1))new_observations=population.sample(num_observations, with_replacement=True)new_mean_based_estimate=mean_based_estimator(new_observations.column(0))new_bootstrap_estimates=sample_estimates(new_observations,␣,→mean_based_estimator,10000)Table().with_column("mean-based estimate", new_bootstrap_estimates).,→hist(bins=np.arange(0,252,4))new_left_end=percentile(2.5, new_bootstrap_estimates)new_right_end=percentile(97.5, new_bootstrap_estimates)[33]:population=Table().with_column("serial number", np.arange(1,150+1))new_observations=population.sample(num_observations, with_replacement=True)new_mean_based_estimate=mean_based_estimator(new_observations.column(0))new_bootstrap_estimates=sample_estimates(new_observations,␣,→mean_based_estimator,10000)Table().with_column("mean-based estimate", new_bootstrap_estimates).,→hist(bins=np.arange(0,252,4))
12
new_left_end=percentile(2.5, new_bootstrap_estimates)new_right_end=percentile(97.5,new_bootstrap_estimates)# Don't change code below this line!print("New mean-based estimate:{:f}".format(new_mean_based_estimate))print("Middle 95% of bootstrap estimates: [{:f},{:f}]".format(new_left_end,␣,→new_right_end))plt.plot(make_array(new_left_end, new_right_end), make_array(0,0),␣,→color='yellow', lw=3, zorder=1)plt.scatter(150,0, color='red', s=30, zorder=2);New mean-based estimate: 152.705882Middle 95% of bootstrap estimates: [112.352941, 193.058824][34]:ok.grade("q3_2");~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Running tests---------------------------------------------------------------------Test summaryPassed: 2Failed: 013
[ooooooooook] 100.0% passedQuestion 3.3Does the interval covering the middle 95% of the new bootstrap estimates includeN? If you ran that cell 100 times and generated 100 intervals, how many of those intervals wouldyou expect to includeN?
Get answer to your question and much more
Let’s look at what happens when we use a small number of resamples:
Get answer to your question and much more
Question 3.4In the cell below, explain why this histogram and confidence interval look differentfrom the ones you generated previously in Question 3.2 where the number of resamples was 10,000.
Get answer to your question and much more
1.44. The CLT and Book ReviewsYour friend has recommended you a book, so you look for it on an online marketplace. You decideto look at reviews for the book just to be sure that it’s worth buying. Let’s say that on Amazon,the book only has 80% positive reviews. On GoodReads, it has 95% positive reviews. You decideto investigate a bit further by looking at the percentage of positive reviews for the book on 5different websites that you know of, and you collect these positive review percentages in a tablecalledreviews.csv.
Upload your study docs or become a
Course Hero member to access this document
Upload your study docs or become a
Course Hero member to access this document
End of preview. Want to read all 24 pages?
Upload your study docs or become a
Course Hero member to access this document
Term
Fall
Professor
N/A
Tags