Updated belief: After combining the historical information and new evidence, the probability that the machine is faulty increases. If additional sensor data arrives, the estimate can be updated again.
This makes Bayesian methods particularly useful for continuous monitoring and decision systems.
🔹 21. Advantages of Bayesian Statistics
✅ 1. Incorporates Prior Knowledge - Previous research or historical information can be included.
✅ 2. Naturally Represents Uncertainty - Posterior distributions provide a full representation of uncertainty.
✅ 3. Supports Continuous Updating - New data can update previous beliefs.
✅ 4. Useful with Limited Data - A carefully chosen prior can provide useful information when data is limited.
✅ 5. Powerful for Complex Models - Bayesian methods can be extended to sophisticated hierarchical and probabilistic models.
🔹 22. Limitations
❌ 1. Choosing a Prior Can Be Difficult - Different priors can sometimes lead to different results, especially when data is limited.
❌ 2. Computationally Expensive - Complex Bayesian models may require substantial computation.
❌ 3. Requires Careful Modeling - An inappropriate likelihood or prior can produce misleading results.
❌ 4. Can Be More Complex - Bayesian modeling may require more mathematical and computational knowledge.
🔹 23. Python Example
A simple Bayesian calculation can be illustrated using a Beta prior for a Bernoulli probability.
Suppose: Prior = Beta(2, 2). We observe: 7 successes and 3 failures. The posterior becomes: Posterior = Beta(2 + 7, 2 + 3) = Beta(9, 5)
Python:
from scipy.stats import beta
alpha_prior = 2
beta_prior = 2
successes = 7
failures = 3
alpha_posterior = alpha_prior + successes
beta_posterior = beta_prior + failures
posterior_mean = alpha_posterior / (alpha_posterior + beta_posterior)
print("Posterior Mean:", posterior_mean)