• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 2 van de 10 pagina's
Overig

Data 8 Resampling and Bootstrap Techniques Assignment

Document preview thumbnail
Voorbeeld 2 van de 10 pagina's

This is a detailed and comprehensive assignment on;Resampling and Bootstrap Techniques for Data 8. An Essential study resource just for you!!

Voorbeeld van de inhoud

Resampling and the Bootstrap

Welcome to lab 7!

In textbook section 9.3 (https://www.inferentialthinking.com/chapters/09/3/empirical-distribution-of-a-
statistic.html), we saw an example of estimation. The British Royal Air Force wanted to know how many
warplanes the Germans had (some number N, a population parameter), and they needed to estimate that
quantity knowing only a random sample of the planes' serial numbers (from 1 to N). For example, one estimate
was twice the mean of the sample serial numbers.

We investigated the random variation in these estimates by simulating sampling from the population many times
and computing estimates from each sample. In real life, if the RAF had known what the population looked like,
they would have known N and would not have had any reason to think about random sampling. They didn't
know what the population looked like, so they couldn't have run the simulations we did. So that was useful as
an exercise in understanding random variation in an estimate, but not as a tool for practical data analysis.

Now we'll flip that idea on its head to make it practical. Given just a random sample of serial numbers, we'll
estimate N, and then we'll use simulation to find out how accurate our estimate probably is, without ever looking
at the whole population. This is an example of statistical inference.

As usual, run the cell below to prepare the lab and the automatic tests.


In[]: # Run this cell to set up the notebook, but please don't change it.

# These lines import the Numpy and Datascience modules.
import numpy as np
from datascience import *

# These lines do some fancy plotting magic.
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
import warnings
warnings.simplefilter('ignore', FutureWarning)

# These lines load the tests.
from client.api.notebook import Notebook
ok = Notebook('lab07.ok')
_ = ok.auth(inline=True)

, 1. Preliminaries
Remember the setup: We (the RAF in World War II) want to know the number of warplanes fielded by the
Germans. That number is N. The warplanes have serial numbers from 1 to N, so N is also equal to the largest
serial number on any of the warplanes.

We only see a small number of serial numbers (assumed to be a random sample with replacement from among
all the serial numbers), so we have to use estimation.



Question 1.1

Is N a population parameter or a statistic? If we compute a number using our random sample that's an estimate
of N, is that a population parameter or a statistic?



SOLUTION: N is a population parameter, and an estimate is a statistic.



Check your answer with a neighbor or a TA.

To make the situation realistic, we're going to hide the true number of warplanes from you. You'll have access
only to this random sample:


In[]: observations = Table.read_table("serial_numbers.csv")
num_observations = observations.num_rows
observations



Question 1.2

Define a function named plot_serial_numbers to make a histogram of any table of serial numbers. It should
take one argument, a table like observations with one column called "serial number". It should plot a
histogram of the values in the column using bins of width 1 ranging from 1 to 200 but return nothing. Then, call
that function to make a histogram of observations.


In[]: def plot_serial_numbers(numbers):
numbers.hist(bins=np.arange(1, 200+2)) #SOLUTION

# Assuming the lines above produce a histogram, this next
# line may make your histograms look nicer. Feel free to
# delete it if you want.
plt.ylim(0, .25)

plot_serial_numbers(observations)

Documentinformatie

Geüpload op
15 juni 2026
Aantal pagina's
10
Geschreven in
2018/2019
Type
Overig
Persoon
Onbekend
$18.49

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
anyiamgeorge19
3.4
(5)
Verkocht
63
Volgers
16
Items
2222
Laatst verkocht
1 maand geleden



Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen