shuttle_sim | R Documentation |
Simulates fake O-ring thermal distress data for Challenger Space Shuttle launches at different launch temperatures. The simulated data are based on a linear logistic regression model fitted to the real data from the 23 (pre-disaster) launches.
shuttle_sim(n_sim = 1, temperature = NULL)
n_sim |
A integer scalar. The number of fake datasets to simulate. |
temperature |
A numeric vector of launch temperatures. If If |
The data are simulated from a linear logistic regression model
fitted to the real (pre-disaster) O-ring distress and launch
temperature data. For a given launch temperature t
this model
provides an estimate, \hat{p}(t)
say, of the probability that an
O-ring suffers thermal distress. Then the number of the 6 O-rings
that suffers from thermal distress is simulated from a
binomial(6, \hat{p}(t)
) distribution, under an assumption that
the fates of the O-rings are independent. This is repeated for each of
the launch temperatures in temperatures
.
For further details see the
Challenger Space Shuttle Disaster
vignette.
The output depends on whether or not temperature
is supplied by
the user.
If temperature
is supplied then shuttle_sim
returns a dataframe with 2 + n_sim
columns.
Column 1 contains the launch temperatures, column 2 contains the numbers
of distressed O-rings in the real data and columns 3 to
2 + n_sim
the n_sim
simulated datasets.
If temperature
is not supplied then shuttle_sim
returns a vector of length n_sim
.
The Challenger Space Shuttle Disaster vignette.
shuttle_sim_plot
for assessing uncertainty concerning
the modelling of the space shuttle data using simulation.
# Simulate 10 fake datasets of size 23, using the real temperatures.
res <- shuttle_sim(n_sim = 10)
res
# Simulate the number of distressed O-rings for 1000 launches at 31 deg F.
res <- shuttle_sim(n_sim = 1000, temperature = 31)
res[1:100]
table(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.