Question: Question 3.1. Write a function called simulate_estimates. It should take 4 arguments: - original_df : A DataFrame from which the data should be sampled, with

 Question 3.1. Write a function called simulate_estimates. It should take 4

Question 3.1. Write a function called simulate_estimates. It should take 4 arguments: - original_df : A DataFrame from which the data should be sampled, with 1 column named 'serial_number '. - sample_size: The size of each sample, an integer. (For example, to do resampling, we would pass the number of rows in original_df for this argument.) - statistic : A function that computes a statistic on a sample. This argument is the name of a function that takes a Series of serial numbers as its argument and returns a number (e.g. calculate_mean_based_estimate ). - repetitions: The number of repetitions to perform (i.e. the number of resamples to create). It should simulate repetitions samples with replacement from the given DataFrame. For each of those samples, it should compute the statistic on that sample. Then it should return an array containing the value of that statistic for each sample (this means that the length of the returned array should be equal to repetitions ). The code below provides an example use of your function and describes how you can verify that you've written it correctly. Check your answer: The histogram you see should be a bell-shaped curve centered at 1000 with most of its mass in [800, 1200]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!