• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 10 páginas
Otro

Data 8 Resampling and Bootstrap Techniques Assignment

Document preview thumbnail
Vista previa 2 fuera de 10 páginas

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

Vista previa del contenido

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)

Información del documento

Subido en
15 de junio de 2026
Número de páginas
10
Escrito en
2018/2019
Tipo
Otro
Personaje
Desconocido
$18.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
anyiamgeorge19
3.4
(5)
Vendido
63
Seguidores
16
Artículos
2222
Última venta
1 mes hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes