January 2015
Intermediate to advanced
360 pages
8h 50m
English
The expected defect production is a combined probability. We'll compute the shift defect probability multiplied by the probability based on defect type. This will allow us to compute all 12 probabilities from all combinations of shift and defect type. We can weight these with the observed numbers and compute the detailed expectation for defects.
Here's the calculation of expected values:
expected = dict(((s,t), P_shift[s]*P_type[t]*total) for t in P_type:for s in P_shift)
We'll create a dictionary that parallels the initial defects Counter object. This dictionary will have a sequence of two tuples with keys and values. The keys will be two tuples of shift and defect type. Our dictionary ...
Read now
Unlock full access