Bayesian Problem: The Quality Control Dilemma

Background

A pharmaceutical company produces a critical medication. Historical data suggests that the production process has typically maintained a defect rate of around 2%. However, recent changes in the manufacturing process have raised concerns about whether this rate has increased.

The Data

In a recent batch of 100 units:

  • 5 units were found to be defective
  • 95 units met quality standards

Prior Information

Based on historical process data:

$$\theta \sim \text{Beta}(4, 196)$$

Where θ represents the defect probability.

This prior encodes both the historical mean (≈ 0.02) and our uncertainty about the true rate.

Your Tasks

  1. Compute the Posterior:
    • Derive the posterior distribution for θ
    • Calculate the posterior mean and 95% credible interval
  2. Decision Analysis:
    • What is the probability that the true defect rate exceeds 3%?
    • Should the company investigate the process? (Consider the costs: false alarms vs. missed problems)
  3. Prior Sensitivity:
    • How would your conclusions change with a more diffuse prior?
    • Try Beta(2, 98) as an alternative prior

Key Questions to Consider

  1. How does the conjugate prior property of the Beta distribution help us here?
  2. What role does sample size play in the strength of our conclusions?
  3. How would you explain your findings to:
    • A process engineer?
    • A regulatory body?
    • Senior management?

Helpful Formulas

Beta-Binomial conjugate update:

$$\text{Beta}(\alpha, \beta) + \text{Bin}(n,k) \rightarrow \text{Beta}(\alpha + k, \beta + n – k)$$

Posterior mean:

$$E[\theta|x] = \frac{\alpha + k}{\alpha + \beta + n}$$

Extension Challenges

  1. What if we had sequential data from multiple batches?
  2. How would you model time-dependency in the defect rate?
  3. What if the cost of false positives and false negatives were asymmetric?

Learning Objectives

This problem helps develop:

  • Understanding of conjugate prior relationships
  • Practical interpretation of credible intervals
  • Decision-making under uncertainty
  • Sensitivity analysis skills
Weekly Problem #24

Yildiz Culcu


Hi, I'm Yildiz Culcu, a student of Computer Science and Philosophy based in Germany. My mission is to help people discover the joy of learning about science and explore new ideas. As a 2x Top Writer on Medium and an active voice on LinkedIn, and this blog, I love sharing insights and sparking curiosity. I'm an emerging Decision science researcher associated with the Max Planck Institute for Cognitive and Brain Sciences and the University of Kiel. I am also a Mentor, and a Public Speaker available for booking. Let's connect and inspire one another to be our best!


Post navigation


Leave a Reply