British Coal Mining Disaster Data

Source Notebook

British coal mine disaster data by year for the years 1851-1962

Data are in the format (year, number of disasters).

Examples

Basic Examples (1) 

In[1]:=
ts = ResourceData[\!\(\*
TagBox["\"\<British Coal Mining Disaster Data\>\"",
#& ,
BoxID -> "ResourceTag-British Coal Mining Disaster Data-Input",
AutoDelete->True]\)]
Out[1]=

Isolate the number of disasters by year:

In[2]:=
count = ts["Values"]
Out[2]=
In[3]:=
ts = ResourceData[\!\(\*
TagBox["\"\<British Coal Mining Disaster Data\>\"",
#& ,
BoxID -> "ResourceTag-British Coal Mining Disaster Data-Input",
AutoDelete->True]\)];
count = ts["Values"];
DiscretePlot[count[[k]], {k, 1, Length[count]}, Sequence[
 Axes -> False, Frame -> True, FrameLabel -> {"1850+year", "number of disasters"}, BaseStyle -> {FontFamily -> "Arial", FontSize -> 14}, AspectRatio -> 1]]
Out[4]=

The year of the most prominent change can be found by the following procedure. Let k denote this year and assume that the data on either side of k are Poisson distributed with respective means θ and λ. Then the likelihood of k on a log scale is given by the following function:

In[5]:=
logLikelihood[k_, count_] := Module[{count1, count2, \[Theta], \[Lambda]},
  {count1, count2} = N[{Take[count, {1, k}], Take[count, {k + 1, Length[count]}]}];
  \[Theta] = Mean[count1]; \[Lambda] = Mean[count2];
  Total[count1] Log[\[Theta]] - Length[count1] \[Theta] + Total[count2] Log[\[Lambda]] - Length[count2] \[Lambda]]

An estimate for the posterior probability mass of the unknown value of k under the assumption of a flat prior probability mass function for k is:

In[6]:=
ts = ResourceData[\!\(\*
TagBox["\"\<British Coal Mining Disaster Data\>\"",
#& ,
BoxID -> "ResourceTag-British Coal Mining Disaster Data-Input",
AutoDelete->True]\)];
count = ts["Values"];
posterior = Table[logLikelihood[k, count], {k, 1, Length[count]}];
posterior = Exp[posterior - Max[posterior]];
posterior = posterior/Total[posterior];
ListLinePlot[posterior, Sequence[
 PlotRange -> All, Axes -> False, Frame -> True, FrameLabel -> {"1850+year", "probability mass"}, BaseStyle -> {FontFamily -> "Arial", FontSize -> 14}, AspectRatio -> 1, Filling -> Axis]]
Out[11]=

Marshall Bradley, "British Coal Mining Disaster Data" from the Wolfram Data Repository (2022)  

Data Resource History

Source Metadata

Publisher Information