100 Exercises / Bayesian statistics / Bayesian Statistics 100 Exercises for Data Analysis
Hierarchical Bayes for Manufacturing Quality: Learning Shrinkage with a Shared Prior
Explore shrinkage for small production lines in Python. Compare fixed-prior estimates, uncertainty, and simplified hierarchical-model concepts.
Factories and lines making the same product can differ in defect rates, yields, and temperature sensitivity. Exercises No.071–080 use a fictional precision-parts manufacturer to show how a shared prior changes estimates for small samples. These conditional calculations introduce the idea of partial pooling in hierarchical Bayes.
Can a small production line with a high observed defect rate be identified as a problem line immediately? We weight its observed rate against shared prior information according to sample size, then use the estimate to guide further inspection or process improvement.
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
In multi-site, multi-product quality control, ranking the main lines with a large base and prototyping/small-batch lines on the same standard can make a chance shift look like a “difference in ability.” In this article, we estimate each line by borrowing information shared by the group and consider where to allocate the limited improvement resources.
Common situations on site
- Sites are evaluated based solely on monthly defect rate rankings.
- The newly installed lines have fewer inspections, with extreme values such as 0% or 10%.
- Varieties, materials, and equipment conditions are mixed, making simple averages impossible to compare
- There are two choices: “replace with company-wide average” or “treat each site completely differently.”
Why is this issue so difficult to judge?
Observed errors include both true process differences and sampling errors simultaneously. In particular, groups with fewer tests have larger sampling errors, and point estimation alone cannot distinguish them. Furthermore, ignoring field differences dilutes anomalies, and completely separating sites makes estimation unstable.
Overview of the exercises
Exercises No.071–080 introduce hierarchical modeling through shrinkage toward a shared prior and simplified random-effect calculations. The beta hyperparameters are fixed here: other lines do not update the common distribution. The formulas below are conditional calculations with known hyperparameters, rather than a full hierarchical Bayesian fit.
The posterior distribution is , and the posterior mean is
Larger groups put more weight on their observed rates; smaller groups put more weight on the mean of the fixed shared prior.
Preparing the Python environment
No external data is used; random number seeds are fixed. scipy is used for distribution and interval estimation, and matplotlib is used for visualization.
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
import sys
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from scipy import stats
SEED = 20260712
rng = np.random.default_rng(SEED)
pd.set_option("display.precision", 4)
print(f"Python {sys.version.split()[0]}")
print(
f"NumPy {np.__version__} / pandas {pd.__version__} / matplotlib {matplotlib.__version__}"
)
from IPython.display import display
Python 3.14.4
NumPy 2.5.1 / pandas 3.0.3 / matplotlib 3.11.0
Creating synthetic data
Generate inspection counts and defects for eight lines, pass counts for six products, supplier-segment responses, and daily process measurements. Simulation parameters are used only to generate data, not as observed inputs to the rate estimates.
lines = [f"Line-{c}" for c in "ABCDEFGH"]
n_inspected = np.array([1200, 900, 650, 400, 180, 80, 35, 12])
true_defect = np.array([0.018, 0.022, 0.027, 0.020, 0.035, 0.025, 0.045, 0.030])
defects = rng.binomial(n_inspected, true_defect)
line_df = pd.DataFrame({"line": lines, "inspected": n_inspected, "defects": defects})
line_df["observed_rate"] = line_df["defects"] / line_df["inspected"]
products = [f"Product-{i}" for i in range(1, 7)]
prod_n = np.array([1000, 700, 350, 160, 60, 20])
true_yield = np.array([0.965, 0.952, 0.970, 0.940, 0.955, 0.930])
passed = rng.binomial(prod_n, true_yield)
product_df = pd.DataFrame({"product": products, "produced": prod_n, "passed": passed})
product_df["observed_yield"] = product_df["passed"] / product_df["produced"]
line_df
| line | inspected | defects | observed_rate | |
|---|---|---|---|---|
| 0 | Line-A | 1200 | 24 | 0.0200 |
| 1 | Line-B | 900 | 19 | 0.0211 |
| 2 | Line-C | 650 | 22 | 0.0338 |
| 3 | Line-D | 400 | 7 | 0.0175 |
| 4 | Line-E | 180 | 2 | 0.0111 |
| 5 | Line-F | 80 | 1 | 0.0125 |
| 6 | Line-G | 35 | 4 | 0.1143 |
| 7 | Line-H | 12 | 1 | 0.0833 |
No.071: Understanding the Hierarchical Bayesian Concept
Practical meaning
Although the lines operate independently, they share the same equipment standards, material specifications, and quality systems. This “different but not irrelevant” expression is the hierarchical model.
Model and assumptions
Here, the common population is , with an average company-wide defect rate of 2.5% and a pre-information volume equivalent to 40 cases. This is not a value to fix a conclusion, but rather an assumption that should be analyzed for sensitivity later.
Check with Python
alpha0, beta0 = 1.0, 39.0
line_df["post_alpha"] = alpha0 + line_df["defects"]
line_df["post_beta"] = beta0 + line_df["inspected"] - line_df["defects"]
line_df["shrunk_rate"] = line_df["post_alpha"] / (
line_df["post_alpha"] + line_df["post_beta"]
)
line_df[["line", "inspected", "defects", "observed_rate", "shrunk_rate"]]
| line | inspected | defects | observed_rate | shrunk_rate | |
|---|---|---|---|---|---|
| 0 | Line-A | 1200 | 24 | 0.0200 | 0.0202 |
| 1 | Line-B | 900 | 19 | 0.0211 | 0.0213 |
| 2 | Line-C | 650 | 22 | 0.0338 | 0.0333 |
| 3 | Line-D | 400 | 7 | 0.0175 | 0.0182 |
| 4 | Line-E | 180 | 2 | 0.0111 | 0.0136 |
| 5 | Line-F | 80 | 1 | 0.0125 | 0.0167 |
| 6 | Line-G | 35 | 4 | 0.1143 | 0.0667 |
| 7 | Line-H | 12 | 1 | 0.0833 | 0.0385 |
Interpreting the results
In lines with a high number of tests, the shrinkage estimates are close to the actual rate, while in the small groups, they strongly approach 2.5%. This move is not a correction to hide the data, but rather a reflection of the magnitude of the sampling error in the estimate.
No.072: Comparing Complete, Non-Pooling, and Partial Pooling
Practical meaning
Full pooling treats all lines as the same, while non-pooling treats each line as if it were a separate company. Partial pooling shares information according to the amount of data in between.
Model and assumptions
Compare the pooled observed rate, each line’s observed rate, and shrinkage toward a fixed common prior. In full Bayesian partial pooling, the shared distribution’s parameters also have priors and are estimated jointly from all groups.
Check with Python
pooled_rate = line_df["defects"].sum() / line_df["inspected"].sum()
comparison = line_df[["line", "inspected", "observed_rate", "shrunk_rate"]].copy()
comparison["complete_pooling"] = pooled_rate
comparison = comparison.rename(
columns={"observed_rate": "no_pooling", "shrunk_rate": "fixed_prior_shrinkage"}
)
comparison[
["line", "inspected", "complete_pooling", "no_pooling", "fixed_prior_shrinkage"]
]
| line | inspected | complete_pooling | no_pooling | fixed_prior_shrinkage | |
|---|---|---|---|---|---|
| 0 | Line-A | 1200 | 0.0231 | 0.0200 | 0.0202 |
| 1 | Line-B | 900 | 0.0231 | 0.0211 | 0.0213 |
| 2 | Line-C | 650 | 0.0231 | 0.0338 | 0.0333 |
| 3 | Line-D | 400 | 0.0231 | 0.0175 | 0.0182 |
| 4 | Line-E | 180 | 0.0231 | 0.0111 | 0.0136 |
| 5 | Line-F | 80 | 0.0231 | 0.0125 | 0.0167 |
| 6 | Line-G | 35 | 0.0231 | 0.1143 | 0.0667 |
| 7 | Line-H | 12 | 0.0231 | 0.0833 | 0.0385 |
plot_df = comparison.set_index("line")[
["complete_pooling", "no_pooling", "fixed_prior_shrinkage"]
]
ax = plot_df.plot(kind="bar", figsize=(10, 4))
ax.set_title("Pooled, separate, and fixed-prior defect-rate estimates")
ax.set_xlabel("Production line")
ax.set_ylabel("Defect rate")
ax.grid(axis="y", alpha=0.3)
plt.tight_layout()
plt.show()

Interpreting the results
In full pooling, differences in areas for improvement disappear, while in non-pooling, extremes of a small-sample group are emphasized. Shrinkage toward a common prior can help with initial screening because it suppresses extreme ranking fluctuations while leaving a difference.
No.073: Estimating Store-Specific CVR Using Hierarchical Bayes
Practical meaning
The store-specific CVR in the original title is binary data for manufacturing as ‘defect occurrence rate per inspection opportunity.’ It can be converted into a quality rate by site or line.
Model and assumptions
From the posterior distribution of each line, we calculate the 95% credible interval and the “probability that the defect rate exceeds 3%.” Priority is determined not by point estimation, but by the probability of exceeding quality standards.
Check with Python
line_df["ci_low"] = stats.beta.ppf(0.025, line_df["post_alpha"], line_df["post_beta"])
line_df["ci_high"] = stats.beta.ppf(0.975, line_df["post_alpha"], line_df["post_beta"])
line_df["prob_over_3pct"] = 1 - stats.beta.cdf(
0.03, line_df["post_alpha"], line_df["post_beta"]
)
line_df[["line", "shrunk_rate", "ci_low", "ci_high", "prob_over_3pct"]].sort_values(
"prob_over_3pct", ascending=False
)
| line | shrunk_rate | ci_low | ci_high | prob_over_3pct | |
|---|---|---|---|---|---|
| 6 | Line-G | 0.0667 | 0.0223 | 0.1327 | 0.9283 |
| 2 | Line-C | 0.0333 | 0.0213 | 0.0479 | 0.6692 |
| 7 | Line-H | 0.0385 | 0.0048 | 0.1045 | 0.5452 |
| 5 | Line-F | 0.0167 | 0.0020 | 0.0459 | 0.1248 |
| 3 | Line-D | 0.0182 | 0.0079 | 0.0326 | 0.0470 |
| 1 | Line-B | 0.0213 | 0.0131 | 0.0314 | 0.0425 |
| 4 | Line-E | 0.0136 | 0.0028 | 0.0326 | 0.0388 |
| 0 | Line-A | 0.0202 | 0.0131 | 0.0287 | 0.0133 |
Interpreting the results
A high prob_over_3pct line is not just a high observation rate, but a candidate with a high likelihood of exceeding the standard. For lines with a wide credible interval, additional inspections are prioritized over definitive assessments.
No.074: Estimating Sales Rates by Product Using Hierarchical Bayes
Practical meaning
The original title translates the sales rate into product-specific yield. Even when the number of parameters differs by product, you can stabilize the small number of new products with information from existing product lines.
Model and assumptions
The common prior distribution of yield is set at an average of 95%, equivalent to 40 , and the posterior distribution by product is calculated.
Check with Python
yield_a0, yield_b0 = 38.0, 2.0
product_df["post_a"] = yield_a0 + product_df["passed"]
product_df["post_b"] = yield_b0 + product_df["produced"] - product_df["passed"]
product_df["shrunk_yield"] = product_df["post_a"] / (
product_df["post_a"] + product_df["post_b"]
)
product_df["prob_below_94pct"] = stats.beta.cdf(
0.94, product_df["post_a"], product_df["post_b"]
)
product_df
| product | produced | passed | observed_yield | post_a | post_b | shrunk_yield | prob_below_94pct | |
|---|---|---|---|---|---|---|---|---|
| 0 | Product-1 | 1000 | 965 | 0.9650 | 1003.0 | 37.0 | 0.9644 | 1.4545e-04 |
| 1 | Product-2 | 700 | 664 | 0.9486 | 702.0 | 38.0 | 0.9486 | 1.4382e-01 |
| 2 | Product-3 | 350 | 346 | 0.9886 | 384.0 | 6.0 | 0.9846 | 3.3491e-06 |
| 3 | Product-4 | 160 | 145 | 0.9062 | 183.0 | 17.0 | 0.9150 | 9.0861e-01 |
| 4 | Product-5 | 60 | 58 | 0.9667 | 96.0 | 4.0 | 0.9600 | 1.4837e-01 |
| 5 | Product-6 | 20 | 18 | 0.9000 | 56.0 | 4.0 | 0.9333 | 5.2445e-01 |
Interpreting the results
Zero or a few failures for small quantities of products are not considered permanent product differences, but rather as the level of existing product groups. On the other hand, products with a high probability of not meeting standards are subject to review for process conditions and design tolerances.
No.075: Estimating response rates by customer segment
Practical meaning
Customer response rates are replaced by improvement success rates by material supplier segment on the manufacturing floor. Compare the difference in effectiveness by segment by counting the number of trials.
Model and assumptions
A common improvement success rate of 60% is updated from a prior distribution of 20 cases, and the probability that the success rate exceeds 60% is calculated.
Check with Python
segments = ["Domestic-A", "Domestic-B", "Overseas-A", "Overseas-B"]
trials = np.array([90, 45, 18, 7])
true_response = np.array([0.72, 0.64, 0.55, 0.70])
success = rng.binomial(trials, true_response)
segment_df = pd.DataFrame({"segment": segments, "trials": trials, "success": success})
segment_df["observed"] = segment_df["success"] / segment_df["trials"]
a_seg, b_seg = 12.0, 8.0
segment_df["posterior"] = (a_seg + segment_df["success"]) / (
a_seg + b_seg + segment_df["trials"]
)
segment_df["prob_over_60pct"] = 1 - stats.beta.cdf(
0.60,
a_seg + segment_df["success"],
b_seg + segment_df["trials"] - segment_df["success"],
)
segment_df
| segment | trials | success | observed | posterior | prob_over_60pct | |
|---|---|---|---|---|---|---|
| 0 | Domestic-A | 90 | 66 | 0.7333 | 0.7091 | 0.9919 |
| 1 | Domestic-B | 45 | 33 | 0.7333 | 0.6923 | 0.9421 |
| 2 | Overseas-A | 18 | 7 | 0.3889 | 0.5000 | 0.1080 |
| 3 | Overseas-B | 7 | 4 | 0.5714 | 0.5926 | 0.4787 |
Interpreting the results
Even if a category with fewer cases has a high performance rate, the posterior probability is not necessarily sufficiently high. Company-wide deployment is decided not only by expectations but also by combining minimum accuracy and additional testing costs.
No.076: Stabilizing Estimates for Groups with Limited Data
Practical meaning
Because there is little data on prototype lines and new products, rankings change significantly every month. By numerically indicating the strength of reduction, you can explain to the site why the correction was made.
Model and assumptions
The weight of performance in the posterior mean is . The remaining is the weight of common prior information.
Check with Python
line_df["data_weight"] = line_df["inspected"] / (line_df["inspected"] + alpha0 + beta0)
line_df["shrinkage"] = line_df["observed_rate"] - line_df["shrunk_rate"]
line_df[
["line", "inspected", "observed_rate", "shrunk_rate", "data_weight", "shrinkage"]
]
| line | inspected | observed_rate | shrunk_rate | data_weight | shrinkage | |
|---|---|---|---|---|---|---|
| 0 | Line-A | 1200 | 0.0200 | 0.0202 | 0.9677 | -0.0002 |
| 1 | Line-B | 900 | 0.0211 | 0.0213 | 0.9574 | -0.0002 |
| 2 | Line-C | 650 | 0.0338 | 0.0333 | 0.9420 | 0.0005 |
| 3 | Line-D | 400 | 0.0175 | 0.0182 | 0.9091 | -0.0007 |
| 4 | Line-E | 180 | 0.0111 | 0.0136 | 0.8182 | -0.0025 |
| 5 | Line-F | 80 | 0.0125 | 0.0167 | 0.6667 | -0.0042 |
| 6 | Line-G | 35 | 0.1143 | 0.0667 | 0.4667 | 0.0476 |
| 7 | Line-H | 12 | 0.0833 | 0.0385 | 0.2308 | 0.0449 |
fig, ax = plt.subplots(figsize=(8, 4))
ax.scatter(line_df["inspected"], line_df["data_weight"], s=60)
for _, r in line_df.iterrows():
ax.annotate(
r["line"],
(r["inspected"], r["data_weight"]),
xytext=(4, 4),
textcoords="offset points",
)
ax.set_title("Data volume and weight assigned to observed results")
ax.set_xlabel("Number inspected")
ax.set_ylabel("Weight on observed rate")
ax.grid(alpha=0.3)
plt.tight_layout()
plt.show()

Interpreting the results
The group of 12 tests is mainly estimated from overall trends, while the group of 1,200 is determined almost entirely by its own group data. Judgments for small-sample groups are not categorized as “normal,” but are linked to additional measurement plans to narrow the estimated range.
No.077: Understanding the Random Intercept Model
Practical meaning
Even under the same temperature and equipment conditions, there are line-specific standard yields. Random intercepts treat this baseline difference as a deviation from the company-wide distribution.
Model and assumptions
Use , with and . This simplified calculation treats both variances as known and substitutes the observed grand mean for . A normal approximation can also produce yields outside 0–1.
Check with Python
days = 30
intercepts = np.array([0.010, -0.004, 0.006, -0.012, 0.003, 0.015, -0.008, 0.000])
daily = []
for line, u in zip(lines, intercepts):
for day in range(days):
daily.append((line, day + 1, 0.95 + u + rng.normal(0, 0.012)))
daily_df = pd.DataFrame(daily, columns=["line", "day", "yield_rate"])
means = (
daily_df.groupby("line")["yield_rate"].agg(["mean", "count", "std"]).reset_index()
)
grand = daily_df["yield_rate"].mean()
tau2, sigma2 = 0.010**2, 0.012**2
means["reliability"] = tau2 / (tau2 + sigma2 / means["count"])
means["random_intercept_est"] = means["reliability"] * (means["mean"] - grand)
means
| line | mean | count | std | reliability | random_intercept_est | |
|---|---|---|---|---|---|---|
| 0 | Line-A | 0.9613 | 30 | 0.0111 | 0.9542 | 0.0101 |
| 1 | Line-B | 0.9437 | 30 | 0.0121 | 0.9542 | -0.0066 |
| 2 | Line-C | 0.9581 | 30 | 0.0079 | 0.9542 | 0.0071 |
| 3 | Line-D | 0.9350 | 30 | 0.0131 | 0.9542 | -0.0150 |
| 4 | Line-E | 0.9514 | 30 | 0.0126 | 0.9542 | 0.0006 |
| 5 | Line-F | 0.9620 | 30 | 0.0145 | 0.9542 | 0.0108 |
| 6 | Line-G | 0.9404 | 30 | 0.0106 | 0.9542 | -0.0098 |
| 7 | Line-H | 0.9536 | 30 | 0.0149 | 0.9542 | 0.0027 |
Interpreting the results
A positive estimated deviation indicates a line mean above the grand mean under this simplified model. Temperature and equipment conditions have not been adjusted for. Investigate these and other omitted factors before treating the difference as a lasting property of the line.
No.078: Understanding the Random Coefficient Model
Practical meaning
The effects of temperature rise can vary depending on the line. Having only a common coefficient misses local weaknesses, while regression by line picks up noise.
Model and assumptions
A random-coefficient model has . The code illustrates shrinkage by combining each least-squares slope with the mean slope using fixed weights of 70% and 30%. These weights are illustrative; they are not inferred posterior weights or credible intervals.
Check with Python
slope_true = np.array(
[-0.0010, -0.0018, -0.0007, -0.0022, -0.0013, -0.0005, -0.0020, -0.0011]
)
rows = []
for line, b0, b1 in zip(lines, intercepts, slope_true):
temp = rng.normal(0, 2.5, days)
y = 0.95 + b0 + b1 * temp + rng.normal(0, 0.008, days)
rows.extend(zip([line] * days, temp, y))
temp_df = pd.DataFrame(rows, columns=["line", "temp_deviation", "yield_rate"])
est = []
for line, g in temp_df.groupby("line"):
slope, intercept = np.polyfit(g["temp_deviation"], g["yield_rate"], 1)
est.append((line, intercept, slope))
slope_df = pd.DataFrame(est, columns=["line", "intercept", "raw_slope"])
global_slope = slope_df["raw_slope"].mean()
slope_df["partial_slope"] = 0.70 * slope_df["raw_slope"] + 0.30 * global_slope
slope_df.sort_values("partial_slope")
| line | intercept | raw_slope | partial_slope | |
|---|---|---|---|---|
| 4 | Line-E | 0.9519 | -0.0022 | -0.0020 |
| 3 | Line-D | 0.9408 | -0.0021 | -0.0019 |
| 6 | Line-G | 0.9419 | -0.0017 | -0.0016 |
| 1 | Line-B | 0.9458 | -0.0016 | -0.0016 |
| 0 | Line-A | 0.9600 | -0.0013 | -0.0013 |
| 2 | Line-C | 0.9554 | -0.0011 | -0.0012 |
| 7 | Line-H | 0.9479 | -0.0009 | -0.0010 |
| 5 | Line-F | 0.9628 | -0.0007 | -0.0009 |
Interpreting the results
More negative slopes indicate a stronger negative association with temperature in this illustration. Before using them for investment decisions, estimate between-line variation and slope uncertainty rather than relying on the fixed 70% weight.
No.079: Visualizing the Estimation Results of the Hierarchical Bayesian Model
Practical meaning
In management and quality meetings, it is necessary to convey not only averages but also the relationship between uncertainty and baseline values in a single sheet.
Model and assumptions
The posteriorer average by line and the 95% credible interval are used as forest plots, with an administrative attention level of 3%.
Check with Python
viz = line_df.sort_values("shrunk_rate").reset_index(drop=True)
xerr = np.vstack(
[viz["shrunk_rate"] - viz["ci_low"], viz["ci_high"] - viz["shrunk_rate"]]
)
fig, ax = plt.subplots(figsize=(9, 5))
ax.errorbar(viz["shrunk_rate"], viz["line"], xerr=xerr, fmt="o", capsize=4)
ax.axvline(0.03, color="crimson", linestyle="--", label="Attention threshold: 3%")
ax.set_title("Posterior defect rates with 95% credible intervals")
ax.set_xlabel("Defect rate")
ax.set_ylabel("Production line")
ax.grid(axis="x", alpha=0.3)
ax.legend()
plt.tight_layout()
plt.show()

Interpreting the results
If the entire section exceeds the standard, there is strong justification for improvement intervention; if the section is broad and exceeds the standard, additional testing is reasonable. Instead of ‘highest scores,’ both position and width are read simultaneously.
No.080: Organizing the Criteria for Using Hierarchical Bayes in Practical Data Analysis
Practical meaning
Hierarchical Bayes are not always necessary. We decide on adoption by checking the number of groups, data volume per group, commonality, and the cost of misjudgment.
Model and assumptions
Candidate projects are scored based on “hierarchical structure,” “small group,” “inter-group difference,” and “misjudgment cost.” This is not statistical proof, but rather a business check that begins modeling considerations.
Check with Python
use_cases = pd.DataFrame(
{
"case": [
"Multi-line defect rate",
"Single machine stable process",
"New product yield",
"Supplier improvement test",
],
"hierarchy": [2, 0, 2, 2],
"small_groups": [2, 0, 2, 1],
"between_group_diff": [2, 0, 1, 2],
"decision_cost": [2, 1, 2, 2],
}
)
use_cases["score"] = use_cases.iloc[:, 1:].sum(axis=1)
use_cases["recommendation"] = pd.cut(
use_cases["score"],
[-1, 2, 5, 8],
labels=["Simple model first", "Compare both", "Hierarchical model candidate"],
)
use_cases.sort_values("score", ascending=False)
| case | hierarchy | small_groups | between_group_diff | decision_cost | score | recommendation | |
|---|---|---|---|---|---|---|---|
| 0 | Multi-line defect rate | 2 | 2 | 2 | 2 | 8 | Hierarchical model candidate |
| 2 | New product yield | 2 | 2 | 1 | 2 | 7 | Hierarchical model candidate |
| 3 | Supplier improvement test | 2 | 1 | 2 | 2 | 7 | Hierarchical model candidate |
| 1 | Single machine stable process | 0 | 0 | 0 | 1 | 1 | Simple model first |
Interpreting the results
Multi-line quality and new product yield are easy candidates to consider, and simple models come first when a single equipment has a sufficient time sequence. At the time of implementation, we compare prediction performance, interpretability, and operational costs with simple models.
Practical implications
- Judging by probability, not ranking: Use the probability of exceeding standards and credible intervals as common indicators for improvement meetings.
- A small-sample group is more ‘insufficient’ than ‘good/bad’: Clearly state the value of additional testing.
- Balancing commonality and individualization: Share company-wide standards while retaining site-specific differences.
- Look not only at the intercepts but also at sensitivity differences: Connecting lines vulnerable to environmental changes to preventive maintenance.
Putting the analysis into practice
- Record hierarchical keys such as lines, equipment, varieties, and material lots without missing any omissions.
- Document the basis for prior distributions by dividing them into past periods, expert judgment, and weakly informative prior distributions.
- Inspecting for biases such as production volume differences, changes in inspection methods, and post-sorting data.
- Conduct sensitivity analysis of prior distribution data, posterior predictive checks, and out-of-period validation.
- Agree on probability thresholds and losses corresponding to “improvement,” “additional measurement,” and “continued monitoring.”
- Include model update frequency, responsible persons, audit logs, and explanatory materials for the field in the operational design.
Conclusion
The value of hierarchical Bayes lies not in the complex model itself but in Fairly handling differences in data volume, and simultaneously incorporating overall knowledge and field differences into decision-making.. It is practical to start with small, explainable implementations such as conjugate models, verify improvements over simple aggregation, and then extend the model.
Consultations for Corporations
At Surikobo, we support you with tailored business challenges, from hierarchical design of quality data, Bayesian model PoC, decision-making rule design, to on-site presentation reports.
📩 Contact Us: www.surikobo.co.jp/contact Please feel free to consult us first.