All articles →

100 Exercises / Bayesian statistics / Bayesian Statistics 100 Exercises for Data Analysis

Introduction to Bayesian Statistics in Manufacturing | 10 Python Exercises That Change Quality Judgment with Probability

Use Python to update defect rates, compare credible and confidence intervals, predict defects, and connect uncertainty to inspection decisions.

Quality assurance, production engineering, and maintenance teams often decide whether to ship, change a process, or inspect equipment before much data is available. Exercises No.001–010 introduce Bayesian inference and the steps of an analysis project using a fictional precision-parts factory.

This series covers probability, Bayesian updating, Python calculations, estimation, prediction, A/B testing, regression, hierarchical models, and decision-making. The aim is to quantify uncertainty and compare the losses associated with possible actions.

This article adapts a training notebook used by Surikobo or its representative, Hiroshi Wayama, with permission from the client company. All data listed is fictional and has no relation whatsoever to real companies, factories, or figures.

Introduction: Practical Challenges in Manufacturing Covered in This Article

The factory checks whether the defect rate after a process change exceeds its 2% management target. Zero observed defects in a small sample do not establish a zero defect rate. Delaying a decision also incurs inspection, delivery, and downtime costs.

The question in this article is not only the observed number of defects, but also how to communicate past insights with possible future outcomes to decision-makers.

Common situations on site

  • Right after process changes or new equipment startup, with few specimens
  • You have knowledge from past processes, but are unsure whether you can simply apply them to new processes.
  • Only the average value or defect rate is reported, and the estimated range is not shared
  • The cost and allowable risk of false positives differ among quality, production, and sales.

Why is this issue so difficult to judge?

The sample defect rate x/nx/n is a summary of observational results, not the true defect rate pp itself. Especially when the nn is small, random fluctuations are significant, and “zero defects” and “zero risk” do not coincide. Also, losses from misjudgments are asymmetric between shipment continuation and suspension. Therefore, it is necessary to address not only estimates but also pp uncertainties, the number of defective future lots, and judgment rules simultaneously.

Overview of the exercises

No.ThemePractical Questions
001Overview of Bayesian StatisticsWhat to enter and what to judge
002Differences from frequentismHow to explain an interval
003Treating uncertainty through probabilitiesWhat is the probability of exceeding the target?
004Prior, likelihood, and posteriorHow to integrate past insights with new data
005Bayes UpdateHow to update test results each time
006Data Growth and BeliefWhen data becomes dominant?
007Point estimation and distribution estimationWhat do you miss by just the average?
008Forecast Values and Forecast UncertaintyHow many defective units will appear in the next lot
009Points of UseWhich issues to introduce first
010Analysis ProjectWho decides what in the design

Preparing the Python environment

Only NumPy, pandas, SciPy, and matplotlib are used. The random number generator is fixed at seed=42 to allow the same results to be reproduced. SciPy’s beta is used to predict the prior and posterior distributions of the defect rate, while binom and betabinom are used to predict future defect numbers.

Run these cells in Jupyter Notebook in numerical order, starting with [IN: 1]. Each [OUT: n] belongs to the input with the same number. Run the collapsed setup cells too. To reproduce random draws, restart the kernel and run all cells from the top; rerunning only a random-sampling cell advances the generator. Library versions can affect numerical precision and plot rendering.

Libraries and display settings
[IN: 1]
import platform
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy
from scipy.stats import beta, binom, betabinom
from IPython.display import display

rng = np.random.default_rng(42)
plt.rcParams["figure.figsize"] = (8, 4.5)
plt.rcParams["axes.spines.top"] = False
plt.rcParams["axes.spines.right"] = False

print("Python     :", platform.python_version())
print("NumPy      :", np.__version__)
print("pandas     :", pd.__version__)
print("SciPy      :", scipy.__version__)
print("matplotlib :", matplotlib.__version__)
[OUT: 1]
Python     : 3.14.4
NumPy      : 2.5.1
pandas     : 3.0.3
SciPy      : 1.18.0
matplotlib : 3.11.0

Creating synthetic data

The target is precision parts manufactured under new grinding conditions. Based on past similar processes, the prior distribution is set to p∼Beta(2,98)p\sim\mathrm{Beta}(2,98) (average 2%). In the new process, a total of 200 items were inspected over five days, generating hypothetical data showing that 4 defects were observed. Daily values are fixed for explanatory purposes and do not depend on external data.

[IN: 2]
daily = pd.DataFrame(
    {
        "day": pd.date_range("2026-06-01", periods=5, freq="D"),
        "inspected": [40, 40, 40, 40, 40],
        "defects": [0, 1, 0, 2, 1],
    }
)
daily["non_defects"] = daily["inspected"] - daily["defects"]
daily["observed_rate"] = daily["defects"] / daily["inspected"]

alpha0, beta0 = 2, 98
n = int(daily["inspected"].sum())
x = int(daily["defects"].sum())
alpha_post, beta_post = alpha0 + x, beta0 + n - x

display(daily.style.format({"observed_rate": "{:.1%}"}))
print(f"Total: {x} defects / {n} inspected = {x/n:.2%}")
print(f"Posterior distribution: Beta({alpha_post}, {beta_post})")
[OUT: 2]
  day inspected defects non_defects observed_rate
0 2026-06-01 00:00:00 40 0 40 0.0%
1 2026-06-02 00:00:00 40 1 39 2.5%
2 2026-06-03 00:00:00 40 0 40 0.0%
3 2026-06-04 00:00:00 40 2 38 5.0%
4 2026-06-05 00:00:00 40 1 39 2.5%
Total: 4 defects / 200 inspected = 2.00%
Posterior distribution: Beta(6, 294)

No.001: Understanding What You Can Do with Bayesian Statistics

Practical meaning

Bayesian statistics connect past insights, new test results, and future forecasts through a single probabilistic model. The outputs include the “plausible range of the true defect rate,” the “probability of exceeding the target 2%,” and the “distribution of defect quantities in the next lot,” which directly serve as the basis for judgment in the quality meeting.

Model and assumptions

If the unknown defect rate is pp, the number of observed defects is xx, and the number of tests is nn, then Bayesian inference

f(p∣x,n)∝P(x∣n,p)f(p)f(p\mid x,n) \propto P(x\mid n,p)f(p)

The right-hand side is the likelihood multiplied by the prior density. The left-hand side is the posterior density. We use ff for densities to distinguish them from the defect-rate parameter pp; the normalizing constant makes the posterior integrate to 1.

Check with Python

[IN: 3]
summary_001 = pd.DataFrame(
    {
        "indicator": [
            "Observed rate",
            "Posterior mean",
            "P(rate > 2%)",
            "95% credible interval",
        ],
        "value": [
            f"{x/n:.2%}",
            f"{alpha_post/(alpha_post+beta_post):.2%}",
            f"{1-beta.cdf(0.02, alpha_post, beta_post):.1%}",
            f"{beta.ppf(0.025, alpha_post, beta_post):.2%}–{beta.ppf(0.975, alpha_post, beta_post):.2%}",
        ],
    }
)
display(summary_001)
[OUT: 3]
indicator value
0 Observed rate 2.00%
1 Posterior mean 2.00%
2 P(rate > 2%) 44.7%
3 95% credible interval 0.74%–3.86%

Interpreting the results

Even when the observed rate and posterior mean are close, the credible interval and exceedance probability show the remaining uncertainty. Report both the estimated rate and the probability that it exceeds 2% when discussing further inspection or provisional shipment.

No.002: Clarifying the Differences Between Frequentist Statistics and Bayesian Statistics

Practical meaning

Frequentist and Bayesian intervals answer different questions. A procedure with 95% coverage contains the fixed true parameter in 95% of repeated samples. A 95% Bayesian credible interval contains 95% of the posterior probability, conditional on the model, prior, and observed data. Wilson intervals have approximate, not exact, nominal coverage.

Model and assumptions

Frequentist inference treats pp as fixed and studies repeated-sample variation. Bayesian inference describes uncertainty about pp using a posterior distribution. Here we compare a Wilson confidence interval with a beta posterior credible interval and consider how the prior affects the latter.

Check with Python

[IN: 4]
z = 1.959963984540054
phat = x / n
center = (phat + z**2 / (2 * n)) / (1 + z**2 / n)
half = z * np.sqrt(phat * (1 - phat) / n + z**2 / (4 * n**2)) / (1 + z**2 / n)
comparison = pd.DataFrame(
    {
        "method": ["Frequentist: Wilson CI", "Bayesian: credible interval"],
        "lower": [center - half, beta.ppf(0.025, alpha_post, beta_post)],
        "upper": [center + half, beta.ppf(0.975, alpha_post, beta_post)],
        "interpretation": [
            "Coverage of repeated procedure",
            "Probability for parameter under model",
        ],
    }
)
display(comparison.style.format({"lower": "{:.2%}", "upper": "{:.2%}"}))
[OUT: 4]
  method lower upper interpretation
0 Frequentist: Wilson CI 0.78% 5.03% Coverage of repeated procedure
1 Bayesian: credible interval 0.74% 3.86% Probability for parameter under model

Interpreting the results

With few observed defects, interval endpoints depend on the method. Explain the interpretation as well as the numbers, and distinguish mandated reporting procedures from probability-based operational decisions.

No.003: Understanding the Concept of Treating Uncertainty as Probability

Practical meaning

A common operational question is how likely the true defect rate is to exceed a warning threshold. This probability can inform additional inspection or a process stoppage.

Model and assumptions

Integrate the posterior density above a threshold cc to calculate P(p>c∣x)P(p>c\mid x). The probability at which a process should stop also depends on losses from escaped defects, downtime, safety requirements, and customer commitments.

Check with Python

[IN: 5]
thresholds = np.array([0.01, 0.015, 0.02, 0.025, 0.03, 0.04])
exceedance = 1 - beta.cdf(thresholds, alpha_post, beta_post)

plt.plot(thresholds * 100, exceedance * 100, marker="o")
plt.title("Posterior exceedance probability")
plt.xlabel("Defect-rate threshold (%)")
plt.ylabel("P(rate exceeds threshold) (%)")
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
display(
    pd.DataFrame(
        {"threshold": thresholds, "exceedance_probability": exceedance}
    ).style.format({"threshold": "{:.1%}", "exceedance_probability": "{:.1%}"})
)
[OUT: 5]

Plot: No.003: Understanding the Concept of Treating Uncertainty as Probability

  threshold exceedance_probability
0 1.0% 91.8%
1 1.5% 70.6%
2 2.0% 44.7%
3 2.5% 24.1%
4 3.0% 11.4%
5 4.0% 1.9%

Interpreting the results

The stricter the threshold, the higher the probability of exceeding it. In quality meetings, sharing this curve before it falls into a single “pass/fail” allows for visibility into which risks each department takes seriously.

No.004: Understanding the Relationship Between Prior Distribution, Likelihood, and Posterior Distribution

Practical meaning

Ignoring past process performance makes estimation of small amounts of data unstable, and if you trust too much, you may miss anomalies after process changes. Prior distribution serves to turn ‘implicit rules of thumb’ into auditable values.

Model and assumptions

The binomial likelihood x∼Binomial(n,p)x\sim\mathrm{Binomial}(n,p) and beta prior distribution p∼Beta(α0,β0)p\sim\mathrm{Beta}(\alpha_0,\beta_0) are conjugate,

p∣x∼Beta(α0+x,β0+n−x)p\mid x\sim\mathrm{Beta}(\alpha_0+x,\beta_0+n-x)

The posterior mean weights the prior mean by α0+β0\alpha_0+\beta_0 and the observed rate by nn. The parameter sum is therefore a useful measure of prior strength in this calculation; it is not a literal record of past inspections.

Check with Python

[IN: 6]
p_grid = np.linspace(0.0001, 0.08, 600)
prior_pdf = beta.pdf(p_grid, alpha0, beta0)
likelihood_scaled = binom.pmf(x, n, p_grid)
likelihood_scaled *= prior_pdf.max() / likelihood_scaled.max()
posterior_pdf = beta.pdf(p_grid, alpha_post, beta_post)

plt.plot(p_grid * 100, prior_pdf, label="Prior: Beta(2, 98)")
plt.plot(p_grid * 100, likelihood_scaled, "--", label="Likelihood (scaled)")
plt.plot(p_grid * 100, posterior_pdf, label="Posterior: Beta(6, 294)")
plt.title("Prior, likelihood, and posterior")
plt.xlabel("Defect rate (%)")
plt.ylabel("Density / scaled likelihood")
plt.grid(True, alpha=0.3)
plt.legend()
plt.tight_layout()
plt.show()
[OUT: 6]

Plot: No.004: Understanding the Relationship Between Prior Distribution, Likelihood, and Posterior Distribution

Interpreting the results

The posterior combines prior assumptions with current observations. Plotting the prior, likelihood, and posterior makes their contributions visible. Agree on which past processes are comparable before choosing the prior.

No.005: Understanding the Bayesian Updating Concept

Practical meaning

In sites where inspection data is delivered daily, updating the same rules sequentially under the same rules is more effective for early warning than to analyze everything at the end of the month. The posterior distribution from the previous day can be reused as the prior distribution for the next day.

Model and assumptions

The tt updates are αt=αt−1+xt\alpha_t=\alpha_{t-1}+x_t and βt=βt−1+nt−xt\beta_t=\beta_{t-1}+n_t-x_t. The results of a batch update and a sequential update match if the model is the same. In operations, data confirmation times, recalculations, and correction history are managed.

Check with Python

[IN: 7]
a, b = alpha0, beta0
rows = []
for row in daily.itertuples(index=False):
    a += int(row.defects)
    b += int(row.non_defects)
    rows.append(
        {
            "day": row.day,
            "alpha": a,
            "beta": b,
            "posterior_mean": a / (a + b),
            "p_over_2pct": 1 - beta.cdf(0.02, a, b),
        }
    )
updates = pd.DataFrame(rows)
display(updates.style.format({"posterior_mean": "{:.2%}", "p_over_2pct": "{:.1%}"}))

plt.plot(updates["day"], updates["p_over_2pct"] * 100, marker="o")
plt.title("Sequential Bayesian updates")
plt.xlabel("Inspection day")
plt.ylabel("P(defect rate > 2%) (%)")
plt.grid(True, alpha=0.3)
plt.xticks(rotation=30)
plt.tight_layout()
plt.show()
[OUT: 7]
  day alpha beta posterior_mean p_over_2pct
0 2026-06-01 00:00:00 2 138 1.43% 23.1%
1 2026-06-02 00:00:00 3 177 1.67% 30.3%
2 2026-06-03 00:00:00 3 217 1.36% 18.5%
3 2026-06-04 00:00:00 5 255 1.92% 40.7%
4 2026-06-05 00:00:00 6 294 2.00% 44.7%

Plot: No.005: Understanding the Bayesian Updating Concept

Interpreting the results

In this dataset, exceedance probability rises on days with more defects and falls when enough non-defective items are observed. Set action rules in advance, such as a sustained threshold exceedance or expected loss above the cost of stopping.

No.006: Confirm the flow where beliefs are updated as data increases

Practical meaning

In the initial stages, past knowledge stabilizes the estimates, and as the number of inspections increases, the performance of new processes dominates the estimates. You can understand the value of additional testing and the process by which the impact of old findings fades.

Model and assumptions

Simulate observations with a true defect rate of 2.5% and compare posteriors at several sample sizes. With representative independent data, uncertainty generally decreases as evidence accumulates, but posterior variance need not decrease at every individual update.

Check with Python

[IN: 8]
simulated = rng.binomial(1, 0.025, size=2000)
sample_sizes = [20, 100, 500, 2000]
learning = []
for size in sample_sizes:
    defects = int(simulated[:size].sum())
    a, b = alpha0 + defects, beta0 + size - defects
    learning.append(
        {
            "n": size,
            "defects": defects,
            "mean": a / (a + b),
            "lower": beta.ppf(0.025, a, b),
            "upper": beta.ppf(0.975, a, b),
        }
    )
learning = pd.DataFrame(learning)
display(learning.style.format({"mean": "{:.2%}", "lower": "{:.2%}", "upper": "{:.2%}"}))

plt.errorbar(
    learning["n"],
    learning["mean"] * 100,
    yerr=[
        (learning["mean"] - learning["lower"]) * 100,
        (learning["upper"] - learning["mean"]) * 100,
    ],
    fmt="o-",
    capsize=4,
)
plt.axhline(2.5, color="gray", linestyle="--", label="Simulation truth (2.5%)")
plt.title("Learning as inspection data accumulate")
plt.xlabel("Cumulative inspected units")
plt.ylabel("Posterior defect rate (%)")
plt.grid(True, alpha=0.3)
plt.legend()
plt.tight_layout()
plt.show()
[OUT: 8]
  n defects mean lower upper
0 20 1 2.50% 0.52% 5.94%
1 100 1 1.50% 0.31% 3.58%
2 500 8 1.67% 0.80% 2.83%
3 2000 60 2.95% 2.27% 3.72%

Plot: No.006: Confirm the flow where beliefs are updated as data increases

Interpreting the results

As the number of tests increases, the credible interval narrows, reducing sensitivity to random fluctuations. However, 2,000 units with the same equipment and time slot may not represent the entire population. It is necessary to first organize stratified sampling and measurement system analysis.

No.007: Understanding the Difference Between Point Estimation and Distribution Estimation

Practical meaning

Point estimates fit easily into KPI tables, but they omit uncertainty. Two distributions with the same mean can imply different probabilities of a high defect rate and different reasons to collect more data.

Model and assumptions

Posterior means, medians, and MAP are representative values. When making decisions, both the credible interval and the probability of exceeding the target are recorded. The MAP for the Beta(a,b)(a,b) is (a−1)/(a+b−2)(a-1)/(a+b-2) when it was a,b>1a,b>1.

Check with Python

[IN: 9]
point_and_distribution = pd.DataFrame(
    {
        "measure": [
            "Observed rate",
            "Posterior mean",
            "Posterior median",
            "MAP",
            "2.5% quantile",
            "97.5% quantile",
        ],
        "estimate": [
            x / n,
            alpha_post / (alpha_post + beta_post),
            beta.median(alpha_post, beta_post),
            (alpha_post - 1) / (alpha_post + beta_post - 2),
            beta.ppf(0.025, alpha_post, beta_post),
            beta.ppf(0.975, alpha_post, beta_post),
        ],
    }
)
display(point_and_distribution.style.format({"estimate": "{:.2%}"}))

plt.fill_between(p_grid * 100, posterior_pdf, alpha=0.25, label="Posterior uncertainty")
plt.plot(p_grid * 100, posterior_pdf)
plt.axvline(
    alpha_post / (alpha_post + beta_post) * 100,
    color="black",
    linestyle="--",
    label="Posterior mean",
)
plt.title("A point estimate inside a distribution")
plt.xlabel("Defect rate (%)")
plt.ylabel("Posterior density")
plt.grid(True, alpha=0.3)
plt.legend()
plt.tight_layout()
plt.show()
[OUT: 9]
  measure estimate
0 Observed rate 2.00%
1 Posterior mean 2.00%
2 Posterior median 1.89%
3 MAP 1.68%
4 2.5% quantile 0.74%
5 97.5% quantile 3.86%

Plot: No.007: Understanding the Difference Between Point Estimation and Distribution Estimation

Interpreting the results

Even if representative values are close, the defect rate can be plausible. Including not only the posterior mean but also the 95% credible interval and excess probability on the dashboard makes it harder to overestimate the accuracy of the numbers.

No.008: Distinguishing Between Forecast Values and Forecast Uncertainty

Practical meaning

Estimating the defect rate parameter and predicting the actual number of defects in the next lot are two different things. The latter includes both parameter uncertainty and the chance of individual products defecting.

Model and assumptions

The next mm defective numbers YY are binomial if pp are known, but integrating pp in posterior distribution yields a beta binomial distribution.

P(Y=y∣x)=∫01P(Y=y∣p)f(p∣x) dp\begin{aligned} &P(Y=y\mid x) \\ &\quad=\int_0^1 P(Y=y\mid p)f(p\mid x)\,dp \end{aligned}

From this posterior predictive distribution, we examine personnel, rework capacity, and delivery buffers.

Check with Python

[IN: 10]
future_n = 100
y = np.arange(0, 13)
predictive_pmf = betabinom.pmf(y, future_n, alpha_post, beta_post)
plugin_pmf = binom.pmf(y, future_n, alpha_post / (alpha_post + beta_post))
predictive_mean = future_n * alpha_post / (alpha_post + beta_post)
predictive_cdf = betabinom.cdf(np.arange(future_n + 1), future_n, alpha_post, beta_post)
prediction_interval = (
    int(np.searchsorted(predictive_cdf, 0.025)),
    int(np.searchsorted(predictive_cdf, 0.975)),
)

plt.bar(y - 0.18, predictive_pmf, width=0.36, label="Posterior predictive")
plt.bar(y + 0.18, plugin_pmf, width=0.36, label="Plug-in binomial")
plt.title("Defects in the next 100-unit lot")
plt.xlabel("Number of defects")
plt.ylabel("Probability")
plt.grid(True, axis="y", alpha=0.3)
plt.legend()
plt.tight_layout()
plt.show()
print(f"Forecast Average: {predictive_mean:.2f}units")
print(
    f"95% posterior predictive interval: {prediction_interval[0]}〜{prediction_interval[1]}units"
)
print(
    f"Probability of at least 5 defects: {1-betabinom.cdf(4, future_n, alpha_post, beta_post):.1%}"
)
[OUT: 10]

Plot: No.008: Distinguishing Between Forecast Values and Forecast Uncertainty

Forecast Average: 2.00units
95% posterior predictive interval: 0〜6units
Probability of at least 5 defects: 7.6%

Interpreting the results

An expected count of two defects does not mean that every lot contains two defects. The beta-binomial prediction includes uncertainty about the rate as well as binomial variation. Use upper-tail probabilities when deciding how much rework capacity to reserve.

No.009: Organizing the Uses of Bayesian Statistics in Data Analysis

Practical meaning

Bayesian statistics are especially effective for tasks requiring small amounts of data, sequential judgment, information sharing between groups, and risk probability. On the other hand, models alone cannot solve the problem of broken data definitions.

Model and assumptions

Candidate projects are rated from 0 to 2 points on five perspectives: small data availability, continuous updates, past insights, loss asymmetry, and deployment value. This is not a statistical model, but a simple KPI that transparently prioritizes PoCs. Weights are agreed upon according to business policies.

Check with Python

[IN: 11]
candidates = pd.DataFrame(
    {
        "use_case": [
            "New-process quality",
            "Predictive maintenance",
            "Demand planning",
            "Stable mass-production KPI",
        ],
        "small_data": [2, 2, 1, 0],
        "sequential": [2, 2, 1, 1],
        "prior_knowledge": [2, 2, 1, 1],
        "asymmetric_loss": [2, 2, 2, 1],
        "scalability": [2, 1, 2, 1],
    }
)
score_cols = [
    "small_data",
    "sequential",
    "prior_knowledge",
    "asymmetric_loss",
    "scalability",
]
candidates["priority_score"] = candidates[score_cols].sum(axis=1)
candidates = candidates.sort_values("priority_score", ascending=False)
display(candidates)

plt.barh(candidates["use_case"], candidates["priority_score"])
plt.title("Bayesian PoC candidate score")
plt.xlabel("Priority score (0–10)")
plt.ylabel("Use case")
plt.grid(True, axis="x", alpha=0.3)
plt.gca().invert_yaxis()
plt.tight_layout()
plt.show()
[OUT: 11]
use_case small_data sequential prior_knowledge asymmetric_loss scalability priority_score
0 New-process quality 2 2 2 2 2 10
1 Predictive maintenance 2 2 2 2 1 9
2 Demand planning 1 1 1 2 2 7
3 Stable mass-production KPI 0 1 1 1 1 4

Plot: No.009: Organizing the Uses of Bayesian Statistics in Data Analysis

Interpreting the results

In this example, new process quality and predictive maintenance are the initial PoC candidates. However, a high score does not guarantee success. Add data acquisition costs, label quality, interventions that can be performed on site, and the presence or absence of responsible personnel as gate conditions.

No.010: Understanding the Process of Analysis Projects Using Bayesian Statistics

Practical meaning

The deliverable of analysis is not a “highly accurate model,” but a decision-making process that can be reproducible at the time of decision. We design objectives, data, models, validation, behavioral rules, and monitoring in sequence.

Model and assumptions

Projects are organized in the order of decision definition→ data audit→ prior distribution agreement→ estimation and forecasting→ model checks→ decision rules including losses, → operational monitoring. At each stage, deliverables and approvers are assigned, and the conditions for re-approval when the model is changed are clearly defined.

Check with Python

[IN: 12]
project = pd.DataFrame(
    {
        "step": [1, 2, 3, 4, 5, 6, 7],
        "phase": [
            "Decision",
            "Data audit",
            "Prior",
            "Inference",
            "Validation",
            "Decision rule",
            "Monitoring",
        ],
        "deliverable": [
            "Action and loss table",
            "Data definition & MSA",
            "Prior rationale",
            "Posterior & prediction",
            "Predictive checks",
            "Threshold & escalation",
            "Drift/review log",
        ],
        "owner": [
            "Quality manager",
            "Data owner",
            "Domain + analyst",
            "Analyst",
            "Analyst + QA",
            "Plant manager",
            "Process owner",
        ],
        "gate": [
            "Cost agreed",
            "Data accepted",
            "Sensitivity accepted",
            "Reproducible",
            "Fit for purpose",
            "Actionable",
            "Review cadence set",
        ],
    }
)
display(project.set_index("step"))
[OUT: 12]
phase deliverable owner gate
step
1 Decision Action and loss table Quality manager Cost agreed
2 Data audit Data definition & MSA Data owner Data accepted
3 Prior Prior rationale Domain + analyst Sensitivity accepted
4 Inference Posterior & prediction Analyst Reproducible
5 Validation Predictive checks Analyst + QA Fit for purpose
6 Decision rule Threshold & escalation Plant manager Actionable
7 Monitoring Drift/review log Process owner Review cadence set

Interpreting the results

Model building is part of seven stages. In particular, typical failures include moving forward with the measurement system unstable, deciding the prior distribution solely by the analyst, and not setting behavioral rules based on probability. Keeping approval records for each gate makes it easier to balance accountability and continuous improvement.

Practical implications

  1. Report by distribution, not by a single point: Set the posterior mean, 95% credible interval, and the probability of exceeding the target.
  2. Separate estimates from forecasts: Do not confuse the estimate of the true defect rate with the forecast of the number of defects in the next lot.
  3. Controlling prior knowledge: Record the rationale, target period, similarity, and sensitivity analysis.
  4. Translating Probability into Action: Define losses from stopping, additional inspections, and provisional shipments.
  5. Don’t rely solely on data growth as a source of peace of mind: Monitor representativeness, measurement errors, and process changes.

Putting the analysis into practice

  • Inspection units, defect definitions, and traceability of lots, equipment, and materials
  • Validation of measurement systems using Gage R&R and similar methods
  • Evidence for prior distributions and sensitivity analysis using weak, standard, and strong prior distributions
  • Posterior predictive checks, outlier investigations, and model re-evaluation before and after process changes
  • Judgment sheets including costs for shipping defective products, excessive stoppages, and additional inspections
  • Operational design including update frequency, permissions, alerts, model versions, and approval history

Conclusion

From No.001 to No.010, Bayesian statistics were identified not only as a calculation method combining past insights with new data, but also as a framework for designing uncertain decisions in manufacturing sites. Rather than making definitive conclusions with a small amount of data, the key is to show the remaining risks in probabilities and turn them into actions through prediction and loss.

The next article covers conditional probability, Bayes’ theorem, and distributions for binary outcomes, counts, dimensions, and unknown rates.

Consultations for Corporations

At Surikobo, we support issues from problem organization, data audits, PoC, decision-making rule design, to on-site training, covering areas such as quality improvement, equipment maintenance, and demand forecasting. You can consult with us from stages such as “too little data to analyze” or “unable to translate model results to on-site decisions.”

📩 Contact Us: www.surikobo.co.jp/contact
Please feel free to consult us first.