"# Risk Analysis of the Space Shuttle: Pre-Challenger Prediction of Failure\n",
"(copy with some modifications from https://app-learninglab.inria.fr/moocrr/gitlab/moocrr-session3/moocrr-reproducibility-study/blob/master/src_Python3_challenger__1_.ipynb graphs doesnt give the same output)\n",
"\n",
"---\n",
"\n",
"In this document we reperform some of the analysis provided in *Risk Analysis of the Space Shuttle: Pre-Challenger Prediction of Failure* by *Siddhartha R. Dalal, Edward B. Fowlkes, Bruce Hoadley* published in *Journal of the American Statistical Association*, Vol. 84, No. 408 (Dec., 1989), pp. 945-957 and available at \n",
"http://www.jstor.org/stable/2290069.\n",
"\n",
"On the fourth page of this article, they indicate that the maximum likelihood estimates of the logistic regression using only temperature are: $\\\\hat{\\\\alpha}=5.085$ and $\\\\hat{\\\\beta}=-0.1156$ and their asymptotic standard errors are $s_{\\\\hat{\\\\alpha}}=3.052$ and $s_{\\\\hat{\\\\beta}}=0.047$. The Goodness of fit indicated for this model was $G^2=18.086$ with 21 degrees of freedom. \n",
"\n",
"Our goal is to reproduce the computation behind these values and the Figure 4 of this article,\n",
"possibly in a nicer looking way.\n",
"\n",
"## Technical information on the computer on which the analysis is run\n",
"\n",
"We will be using the python3.9 language using the pandas, statsmodels, numpy, matplotlib and seaborn libraries."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "suffering-night",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.9.0+ (default, Oct 19 2020, 09:51:18) \n",
"[GCC 10.2.0]\n",
"uname_result(system='Linux', node='dell', release='5.8.0-44-generic', version='#50-Ubuntu SMP Tue Feb 9 06:29:41 UTC 2021', machine='x86_64')\n",
"Let's assume O-rings independently fail with the same probability which solely depends on temperature. A logistic regression should allow us to estimate the influence of temperature."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "tribal-sleep",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<ipython-input-4-e54e83124145>:7: DeprecationWarning: Calling Family(..) with a link class as argument is deprecated.\n",
" The maximum likelyhood estimator of the intercept and of Temperature are thus $\\hat{\\alpha}=5.0850$ and $\\hat{\\beta}=-0.1156$. This corresponds to the values from the article of Dalal et al. The standard errors are $s_{\\hat{\\alpha}} = 7.477$ and $s_{\\hat{\\beta}} = 0.115$, which is different from the $3.052$ and $0.04702$ reported by Dallal et al. The deviance is $3.01444$ with 21 degrees of freedom. I cannot find any value similar to the Goodness of fit ($G^2=18.086$) reported by Dalal et al. There seems to be something wrong. Oh I know, I haven't indicated that my observations are actually the result of 6 observations for each rocket launch. Let's indicate these weights (since the weights are always the same throughout all experiments, it does not change the estimates of the fit but it does influence the variance estimates)."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "administrative-topic",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<ipython-input-5-3f28a1f86e81>:2: DeprecationWarning: Calling Family(..) with a link class as argument is deprecated.\n",
"Good, now I have recovered the asymptotic standard errors $s_{\\hat{\\alpha}}=3.052$ and $s_{\\hat{\\beta}}=0.047$. The Goodness of fit (Deviance) indicated for this model is $G^2=18.086$ with 21 degrees of freedom (Df Residuals).\n",
"\n",
"*I have therefore managed to fully replicate the results of the Dalal et al. article.*\n",
"\n",
"## Predicting failure probability\n",
"---\n",
"\n",
"The temperature when launching the shuttle was 31°F. Let's try to estimate the failure probability for such temperature using our model.:"
"This figure is very similar to the Figure 4 of Dalal et al. *I haven't managed to replicate the Figure 4 of the Dalal et al. article. The curve is missing*.\n",
"\n",
"## Computing and plotting uncertainty\n",
"---\n",
"Following the documentation of Seaborn, I use regplot."
"*I think I haven't managed to correctly compute and plot the uncertainty of my prediction.* Although the shaded area seems very similar to the one obtained by with R, I can spot a few differences (e.g., the blue point for temperature 63 is outside)... Could this be a numerical error ? Or a difference in the statistical method ? It is not clear which one is \"right\"."