The Central Idea
Let \(\theta\) denote an unknown model parameter and let \(D\) denote observed data. Bayesian inference combines three pieces:
- a prior distribution for \(\theta\);
- a likelihood describing the observed data under possible parameter values;
- a posterior distribution describing parameter uncertainty after the data are observed.
Bayes' rule gives
\[ \boxed{p(\theta\mid D)=\frac{p(D\mid\theta)p(\theta)}{p(D)}}. \]The posterior is therefore the result of updating prior uncertainty with evidence supplied by the data.
The Parts of Bayes' Rule
In
\[ p(\theta\mid D)=\frac{p(D\mid\theta)p(\theta)}{p(D)}, \]each term has a distinct modeling role.
- \(p(\theta)\) is the prior distribution.
- \(p(D\mid\theta)\) is the likelihood.
- \(p(\theta\mid D)\) is the posterior distribution.
- \(p(D)\) is the marginal likelihood or evidence.
For parameter estimation, the denominator often acts mainly as the constant that makes the posterior integrate or sum to \(1\).
The Proportional Form
Because \(p(D)\) does not depend on \(\theta\), Bayesian calculations are often written in the proportional form
\[ \boxed{p(\theta\mid D)\propto p(D\mid\theta)p(\theta)}. \]In words,
\[ \boxed{\text{posterior}\propto\text{likelihood}\times\text{prior}}. \]This compact relationship captures the main logic of Bayesian updating.
Parameters Are Treated as Uncertain Quantities
In a Bayesian model, an unknown parameter is represented by a probability distribution. The parameter itself need not physically fluctuate from trial to trial. The distribution represents uncertainty about its value.
For example, if \(p\) is an unknown defect probability, we may write
\[ p\sim\operatorname{Beta}(\alpha,\beta). \]This distribution describes which values of \(p\) are regarded as more or less plausible before observing the current data.
Prior Distributions
A prior distribution represents parameter uncertainty before incorporating the data used in the current analysis. Priors can come from previous studies, engineering knowledge, historical measurements, expert judgment, physical constraints, or deliberately broad assumptions.
A prior is part of the model. It should therefore be documented and tested for its effect on the result.
Informative Priors
An informative prior concentrates probability in a region supported by meaningful previous information.
Suppose historical measurements suggest that a parameter \(\mu\) is usually near \(50\) with moderate uncertainty. A prior such as
\[ \mu\sim N(50,5^2) \]encodes that information explicitly.
Weakly Informative and Broad Priors
When prior knowledge is limited, a broad or weakly informative prior can keep the model from assigning substantial probability to implausible values without tightly determining the answer.
A useful weak prior usually respects the scale and constraints of the parameter. For example, a probability parameter must remain between \(0\) and \(1\), and a physical scale parameter may be required to remain positive.
The Support of the Prior Matters
A prior should assign probability only where the parameter can meaningfully exist. If \(\sigma\) is a standard deviation, then
\[ \sigma>0. \]A prior that assigns probability to negative standard deviations would violate the model's structure. Distribution choice should therefore reflect not only uncertainty but also mathematical and physical constraints.
The Likelihood
The likelihood describes how probable the observed data are for different values of the unknown parameter. If observations \(x_1,\ldots,x_n\) are conditionally independent given \(\theta\), then
\[ L(\theta)=p(D\mid\theta) =\prod_{i=1}^{n}p(x_i\mid\theta). \]The likelihood links the parameter to the data-generating process.
Likelihood Is Not the Same as a Posterior
The likelihood is a function of the parameter for fixed observed data. It does not by itself represent a probability distribution over the parameter unless it is combined with a prior and normalized.
Bayesian inference uses
\[ p(\theta\mid D)\propto L(\theta)p(\theta), \]not the likelihood alone.
The Posterior Distribution
The posterior distribution represents parameter uncertainty after the observed data have been incorporated.
From the posterior we can compute quantities such as
- posterior means;
- posterior medians;
- maximum a posteriori estimates;
- credible intervals;
- posterior probabilities of thresholds or events;
- posterior predictive distributions.
Posterior Mean
For a continuous parameter, the posterior mean is
\[ \boxed{E[\theta\mid D]=\int \theta\,p(\theta\mid D)\,d\theta}. \]This provides one point summary of the posterior distribution. It should not replace the distribution itself when uncertainty is important.
Maximum a Posteriori Estimation
The maximum a posteriori, or MAP, estimate is the parameter value that maximizes the posterior density:
\[ \boxed{\hat\theta_{\mathrm{MAP}}=\arg\max_{\theta}p(\theta\mid D)}. \]The MAP estimate resembles maximum-likelihood estimation, but the prior also influences the location of the optimum.
How Prior Information and Data Share Influence
A concentrated prior can strongly influence a posterior when the data are sparse. As more informative data accumulate, the likelihood often becomes more concentrated and may dominate the prior.
Bayesian updating is therefore not a fixed weighting rule. The relative influence of prior and data depends on their information content and the structure of the model.
Conjugate Example: Beta Prior and Binomial Data
Suppose \(X\) is the number of successes in \(n\) Bernoulli trials with unknown success probability \(p\):
\[ X\mid p\sim\operatorname{Binomial}(n,p). \]Choose a beta prior
\[ p\sim\operatorname{Beta}(\alpha,\beta). \]After observing \(x\) successes, the posterior is
\[ \boxed{p\mid x\sim\operatorname{Beta}(\alpha+x,\beta+n-x)}. \]Example: Updating a Defect Probability
Let \(p\) be the probability that a manufactured item is defective. Suppose the prior is
\[ p\sim\operatorname{Beta}(2,18). \]A new sample contains \(3\) defective items among \(20\) inspected. Then
\[ p\mid D\sim\operatorname{Beta}(2+3,18+17) \]so
\[ \boxed{p\mid D\sim\operatorname{Beta}(5,35)}. \]The posterior mean is
\[ E[p\mid D]=\frac{5}{40}=0.125. \]Beta Priors and Pseudo-Counts
In the beta-binomial model, the parameters \(\alpha\) and \(\beta\) can often be interpreted as prior success and failure information. The posterior update simply adds the new observations:
\[ \alpha_{\text{post}}=\alpha+x, \qquad \beta_{\text{post}}=\beta+n-x. \]This interpretation is useful for intuition, though the exact meaning depends on how the prior was constructed.
Conjugate Example: Normal Mean with Known Variance
Suppose
\[ X_i\mid\mu\sim N(\mu,\sigma^2) \]with known \(\sigma^2\), and suppose the prior is
\[ \mu\sim N(\mu_0,\tau_0^2). \]Then the posterior is also normal. Its precision is
\[ \boxed{\frac{1}{\tau_n^2}=\frac{1}{\tau_0^2}+\frac{n}{\sigma^2}} \]and its mean is
\[ \boxed{ \mu_n= \tau_n^2 \left( \frac{\mu_0}{\tau_0^2} + \frac{n\bar x}{\sigma^2} \right)}. \]Precision Makes the Weighting Visible
The reciprocal of variance is called precision:
\[ \text{precision}=\frac{1}{\text{variance}}. \]In the normal-normal update, the posterior mean is a precision-weighted compromise between the prior mean and the sample mean. More precise information receives more weight.
Bayesian Credible Intervals
A \(95\%\) Bayesian credible interval \([a,b]\) is an interval satisfying
\[ \boxed{P(a\leq\theta\leq b\mid D)=0.95}. \]Conditional on the model, prior, and observed data, the posterior assigns \(95\%\) probability to the parameter lying within the interval.
Credible Intervals and Confidence Intervals Are Different
A Bayesian credible interval is a probability statement about the parameter under the posterior distribution. A frequentist confidence interval is a statement about the long-run performance of an interval-generating procedure.
The numerical intervals may sometimes be similar, but their interpretations are not interchangeable.
Equal-Tail Credible Intervals
One common credible interval is the equal-tail interval. A \(95\%\) equal-tail interval uses the posterior \(2.5\%\) and \(97.5\%\) quantiles:
\[ a=Q_{0.025}, \qquad b=Q_{0.975}. \]This leaves equal posterior probability in the two tails.
Highest Posterior Density Regions
A highest posterior density region contains parameter values with relatively high posterior density and excludes lower-density values until the desired posterior probability has been accumulated.
For symmetric unimodal posteriors, an HPD interval may resemble an equal-tail interval. For skewed or multimodal posteriors, the two can differ materially.
Posterior Probabilities of Decision-Relevant Events
A posterior distribution allows direct evaluation of statements such as
\[ P(\theta>\theta_0\mid D). \]For example, if \(\theta\) is a treatment effect, a decision maker may ask for the posterior probability that the effect exceeds a practically meaningful threshold rather than merely asking whether a point estimate is positive.
Posterior Predictive Distributions
Parameter uncertainty should usually be carried forward into prediction. If \(Y_{\text{new}}\) is a future observation, then
\[ \boxed{ p(Y_{\text{new}}\mid D) = \int p(Y_{\text{new}}\mid\theta) p(\theta\mid D)\,d\theta }. \]The posterior predictive distribution averages predictions across plausible parameter values instead of pretending that one estimated parameter value is known exactly.
Prediction Includes More Than Parameter Uncertainty
Future outcomes may vary even if the parameter were known perfectly. Posterior prediction can therefore include both
- uncertainty about the parameter;
- irreducible variability in future observations.
This is the Bayesian analogue of distinguishing uncertainty about a fitted mean from uncertainty about a future observation.
Sequential Updating
Bayesian inference naturally supports sequential learning. After observing data \(D_1\), we obtain
\[ p(\theta\mid D_1). \]This posterior can become the prior for a later batch of data \(D_2\):
\[ p(\theta\mid D_1,D_2) \propto p(D_2\mid\theta)p(\theta\mid D_1). \]Information can therefore accumulate over time without discarding the earlier evidence.
Sequential Updating Requires a Stable Model
Sequential updating is appropriate only when the new data are compatible with the model being updated. If the process, measurement system, population, or operating conditions change, blindly treating the old posterior as the new prior can create misleading certainty.
Bayesian updating does not remove the need to test whether the modeling assumptions remain relevant.
Prior Sensitivity Analysis
Because the prior affects the posterior, analysts should examine whether reasonable alternative priors materially change important conclusions.
A practical prior sensitivity analysis may compare
- a baseline prior;
- a broader prior;
- a more skeptical prior;
- a more optimistic but still defensible prior.
If the decision changes substantially across reasonable priors, that dependence is itself an important uncertainty result.
Prior-Data Conflict
Sometimes the observed data fall in a region that the prior regarded as highly implausible. This can indicate
- an overly concentrated prior;
- a changed process;
- measurement problems;
- model misspecification;
- or genuinely surprising new information.
A strong conflict should be investigated rather than hidden by the posterior calculation.
Conjugate Priors
A prior family is called conjugate for a likelihood when the posterior belongs to the same distribution family as the prior.
Examples include the beta prior with binomial data and the normal prior for a normal mean with known variance.
Conjugate models are valuable because they make Bayesian updating transparent and often produce closed-form formulas.
Nonconjugate Models
Real models often do not produce posteriors with simple closed forms. In that case, Bayesian analysis relies on numerical approximation.
Common approaches include
- numerical integration;
- Laplace approximations;
- Markov chain Monte Carlo;
- importance sampling;
- sequential Monte Carlo;
- variational approximations.
Markov Chain Monte Carlo
Markov chain Monte Carlo, or MCMC, constructs a stochastic process whose long-run distribution is the desired posterior. After suitable convergence, simulated draws
\[ \theta^{(1)},\theta^{(2)},\ldots,\theta^{(M)} \]can be used to approximate posterior means, probabilities, intervals, and predictive distributions.
Posterior Calculations from Samples
If \(\theta^{(1)},\ldots,\theta^{(M)}\) are approximately distributed according to the posterior, then the posterior mean can be estimated by
\[ \boxed{ E[\theta\mid D] \approx \frac{1}{M}\sum_{m=1}^{M}\theta^{(m)} }. \]Similarly,
\[ P(\theta>c\mid D) \approx \frac{1}{M} \sum_{m=1}^{M} I\!\left(\theta^{(m)}>c\right). \]Simulation Introduces Computational Uncertainty
An MCMC estimate is itself subject to Monte Carlo error. A posterior probability reported as \(0.734\) should not automatically be interpreted as known to three decimal places if the simulation is too short or highly autocorrelated.
Simulation diagnostics and effective sample size are therefore part of the uncertainty analysis.
Effective Sample Size
MCMC draws are usually correlated. A chain of \(10{,}000\) draws may contain less information than \(10{,}000\) independent samples.
Effective sample size estimates the approximate number of independent draws that would provide similar Monte Carlo precision.
Convergence Must Be Assessed
A posterior simulation should not be interpreted until there is evidence that the computational procedure is exploring the intended distribution adequately. Useful diagnostics can include
- trace plots;
- multiple chains from dispersed starting values;
- autocorrelation behavior;
- effective sample size;
- between-chain and within-chain comparisons.
Posterior Predictive Checking
A fitted Bayesian model should be checked against the data patterns it is supposed to explain. One approach is to generate replicated data
\[ D^{\mathrm{rep}}\sim p(D^{\mathrm{rep}}\mid D) \]and compare those simulated datasets with the observations.
If the model repeatedly fails to reproduce important features of the observed data, parameter updating alone is not enough. The model structure may need to change.
Parameter Uncertainty Is Not Model Uncertainty
A narrow posterior for a parameter does not prove that the model is correct. The model form, data assumptions, prior family, measurement process, and omitted variables can all remain uncertain.
Bayesian parameter treatment quantifies uncertainty within the assumed model. Structural uncertainty must be addressed separately or through broader model-comparison frameworks.
Hierarchical Modeling Ideas
When several related groups are modeled, their parameters can be connected through a higher-level distribution. For example,
\[ \theta_j\sim N(\mu,\tau^2), \qquad j=1,\ldots,J. \]The group parameters \(\theta_j\) are different, but they share information through common hyperparameters \(\mu\) and \(\tau\).
Partial Pooling
Hierarchical models often produce partial pooling. Estimates for data-poor groups are pulled toward the broader group pattern, while groups with strong data retain more of their individual information.
This can reduce unstable estimates without forcing all groups to have the same parameter value.
Bayesian Regression Parameters
In a regression model such as
\[ y_i=\beta_0+\beta_1x_{i1}+\cdots+\beta_px_{ip}+\varepsilon_i, \]Bayesian analysis places prior distributions on coefficients and other unknown parameters. The posterior then describes uncertainty jointly across the full parameter vector
\[ \boldsymbol\beta=(\beta_0,\beta_1,\ldots,\beta_p). \]Parameters Can Be Dependent in the Posterior
Posterior uncertainty is often multivariate. Two parameters may each have moderate marginal uncertainty but be strongly correlated with one another.
Predictions and derived quantities should therefore be calculated from the joint posterior, not by varying parameters independently when the posterior dependence is important.
Derived Quantities Inherit Posterior Uncertainty
Suppose the quantity of interest is
\[ q=g(\theta). \]Posterior draws of \(\theta\) can be transformed directly:
\[ q^{(m)}=g\!\left(\theta^{(m)}\right). \]The resulting \(q^{(m)}\) values approximate the posterior distribution of the derived quantity. This is one of the major practical advantages of simulation- based Bayesian analysis.
Bayesian Parameters and Decisions
A posterior distribution becomes especially useful when it feeds a decision. Let \(a\) denote an action and \(L(a,\theta)\) a loss. The posterior expected loss is
\[ \boxed{ E[L(a,\theta)\mid D] = \int L(a,\theta)p(\theta\mid D)\,d\theta }. \]A Bayesian decision rule can select the action with the smallest posterior expected loss.
Example: A Posterior Decision Threshold
Suppose a project is acceptable only if a reliability parameter \(R\) exceeds \(0.98\). A Bayesian analysis can report
\[ P(R>0.98\mid D). \]Management can then specify an operational rule such as requiring this probability to exceed a chosen assurance threshold before proceeding.
The probability threshold is a decision policy, not a mathematical law. It should reflect consequences, risk tolerance, and the cost of errors.
Bayesian Updating and the Value of Information
When uncertainty affects a decision, additional data may have economic or operational value. Bayesian analysis provides a natural way to compare the current decision with the decision that might be made after new information is obtained.
If the expected benefit from reducing uncertainty exceeds the cost of gathering the data, more measurement or experimentation may be justified.
Communicating Bayesian Results
A useful Bayesian report should state more than a posterior mean. Depending on the application, it may include
- the prior and its rationale;
- the likelihood model;
- posterior point summaries;
- credible intervals;
- posterior probabilities of decision-relevant events;
- posterior predictive intervals or distributions;
- prior sensitivity results;
- model-checking and computational diagnostics.
Common Error: Treating the Prior as a Fact
A prior is an assumption about uncertainty, not an unquestionable truth. If the prior is materially influential, the analyst should explain its basis and test reasonable alternatives.
Strong prior information can be valuable, but hidden prior influence can make an analysis appear more data-driven than it really is.
Common Error: Confusing Posterior Concentration with Certainty
A narrow posterior means that the parameter is tightly estimated under the assumed model. It does not account automatically for unmodeled bias, structural error, incorrect likelihood assumptions, data-quality problems, or future regime changes.
Posterior precision should therefore be interpreted within the broader model- uncertainty framework developed throughout this section.
Common Error: Using Marginal Intervals Independently
If two parameters are strongly dependent in the posterior, independently combining values from their separate marginal intervals can create parameter combinations that have almost no posterior support.
Simulation from the joint posterior preserves the dependence structure and is generally preferable for downstream uncertainty propagation.
A Practical Bayesian Parameter Workflow
- Define the uncertain parameters and their admissible ranges.
- Specify prior distributions and document their rationale.
- Specify the data model and likelihood.
- Compute or approximate the posterior distribution.
- Check computational convergence when simulation is used.
- Examine posterior summaries and joint dependence.
- Perform posterior predictive checks.
- Evaluate sensitivity to reasonable prior alternatives.
- Propagate the posterior through predictions and derived quantities.
- Connect posterior uncertainty to the actual decision or risk question.
Practice 1: Identify the Bayesian Components
A parameter \(\theta\) has prior density \(p(\theta)\), and observed data have likelihood \(p(D\mid\theta)\). Write the expression that determines the posterior distribution up to a proportionality constant.
Practice 2: Beta-Binomial Update
Suppose
\[ p\sim\operatorname{Beta}(3,7). \]Then \(12\) successes and \(8\) failures are observed. Find the posterior distribution of \(p\).
Practice 3: Posterior Mean
Using the posterior from Practice 2, compute the posterior mean of \(p\).
Practice 4: Interpret a Credible Interval
A Bayesian analysis reports a \(95\%\) credible interval
\[ [0.42,0.67] \]for an unknown probability \(p\). State the correct Bayesian interpretation.
Practice 5: Sequential Updating
After one dataset, a posterior for \(p\) is
\[ p\mid D_1\sim\operatorname{Beta}(10,15). \]A second batch contains \(6\) successes and \(4\) failures. Find the updated posterior.
Practice 6: Posterior Probability from Samples
An MCMC run produces \(5{,}000\) retained posterior draws of \(\theta\). Among them, \(4{,}150\) exceed \(2\). Estimate
\[ P(\theta>2\mid D). \]Practice 7: Posterior Prediction
Explain why plugging only the posterior mean \(E[\theta\mid D]\) into a model can understate predictive uncertainty compared with integrating predictions over the full posterior distribution.
Practice 8: Prior Sensitivity
A decision changes from "proceed" to "do not proceed" when the analyst replaces one reasonable prior with another reasonable prior. What does this reveal about the analysis?
Practice 9: Joint Posterior Dependence
Two parameters have strong negative posterior correlation. Explain why drawing each parameter independently from its marginal posterior can distort downstream simulation results.
Practice 10: Model Checking
A Bayesian model produces a narrow posterior for its main parameter, but posterior predictive simulations consistently fail to reproduce the observed tail behavior. What should the analyst conclude?
Practice Answers
Practice 1
\[ \boxed{p(\theta\mid D)\propto p(D\mid\theta)p(\theta)}. \]Practice 2
The beta prior parameters are updated by adding the observed successes and failures:
\[ \alpha_{\text{post}}=3+12=15 \]and
\[ \beta_{\text{post}}=7+8=15. \]Therefore,
\[ \boxed{p\mid D\sim\operatorname{Beta}(15,15)}. \]Practice 3
For a beta distribution, the mean is
\[ \frac{\alpha}{\alpha+\beta}. \]Hence
\[ E[p\mid D]=\frac{15}{15+15}=\boxed{0.5}. \]Practice 4
Conditional on the specified Bayesian model, prior, and observed data, the posterior probability that \(p\) lies between \(0.42\) and \(0.67\) is \(0.95\):
\[ \boxed{P(0.42\leq p\leq0.67\mid D)=0.95}. \]Practice 5
Use the first posterior as the next prior and add the new successes and failures:
\[ \alpha=10+6=16, \qquad \beta=15+4=19. \]Therefore,
\[ \boxed{p\mid D_1,D_2\sim\operatorname{Beta}(16,19)}. \]Practice 6
\[ P(\theta>2\mid D) \approx \frac{4150}{5000} = \boxed{0.83}. \]Practice 7
Plugging in only the posterior mean treats the parameter as if it were known exactly at that one value. Integrating over the posterior includes predictions from all parameter values supported by the data and prior, so parameter uncertainty is retained in the predictive distribution.
Practice 8
The decision is prior-sensitive. The available data do not dominate the range of reasonable prior assumptions strongly enough to make the decision robust. The analyst should report this dependence, investigate the prior rationale, and consider whether additional data would reduce the uncertainty.
Practice 9
Independent sampling destroys the negative dependence between the parameters and creates combinations that the joint posterior may regard as highly implausible. Downstream predictions can therefore have distorted means, tails, or variances. Samples should preserve the joint posterior structure.
Practice 10
The narrow parameter posterior does not rescue a model that fails its predictive checks. The mismatch indicates that the likelihood or broader model structure is not capturing important behavior. The analyst should investigate model misspecification rather than interpreting the narrow posterior as strong evidence of overall model adequacy.
What to Remember
- Bayesian parameter treatment represents uncertainty about unknown parameters with probability distributions.
- The prior describes uncertainty before the current data are incorporated.
- The likelihood describes how the observed data depend on possible parameter values.
- The posterior combines prior information with the likelihood.
- Bayes' rule can be written as posterior proportional to likelihood times prior.
- Posterior means, medians, MAP estimates, intervals, and event probabilities are summaries of the posterior.
- Bayesian credible intervals make probability statements about parameters conditional on the model and data.
- Credible intervals and frequentist confidence intervals have different interpretations.
- Conjugate priors produce analytically convenient posterior distributions.
- The beta-binomial model updates prior success and failure information by adding observed counts.
- Posterior prediction integrates over parameter uncertainty instead of relying on one fitted value.
- Sequential Bayesian updating allows information to accumulate over time when the underlying model remains appropriate.
- Prior sensitivity should be tested when the prior has meaningful influence on conclusions.
- Prior-data conflict can reveal outdated prior information, changed processes, bad data, or model misspecification.
- Nonconjugate models often require numerical methods such as MCMC.
- MCMC estimates have computational uncertainty and require convergence diagnostics.
- Posterior predictive checking tests whether the fitted model can reproduce important features of the observed data.
- A narrow posterior within a model does not eliminate structural or model uncertainty.
- Hierarchical models share information across related groups through partial pooling.
- Joint posterior dependence should be preserved in downstream uncertainty propagation.
- Bayesian posterior distributions can feed directly into expected-loss and threshold-based decision rules.
The essential principle is: treat uncertain model parameters as distributions, update those distributions with evidence, propagate the full posterior into prediction and decisions, and remain explicit about the model assumptions that make the posterior possible.
Where We Go Next
Bayesian parameter treatment provides a disciplined way to update uncertain parameters and carry posterior uncertainty into forecasts and decisions. Yet a decision can still perform poorly if it is optimized too tightly around one estimated model, one probability specification, or one set of assumptions.
The next lesson, Robust Modeling, develops strategies for constructing models and decisions that remain useful when assumptions, parameters, distributions, or operating conditions differ from the baseline specification.