Probabilistic Model Learning

Probabilistic Model Learning uses observations to estimate the probabilities in a model. For example, a program might learn the probability that a request succeeds, rather than receive that probability from its developer. You first specify a model family and its assumptions, then fit its parameters. Here, the family is fixed; the focus is how data determine parameter estimates.

Fit parameters by likelihood

Suppose D=(x1,…,xn)D=(x_1,\ldots,x_n) contains observations modelled as independent and identically distributed. Let θ\theta denote the unknown parameters. The likelihood treats the observed dataset as fixed and measures how well different parameter values explain it.


Maximum likelihood estimation, abbreviated MLE, selects parameters that maximize this likelihood. For positive likelihoods, taking logarithms preserves the maximizing value and turns products into sums:


L(θ;D)=∏i=1np(xi∣θ),θ^MLE=arg max⁡θ∑i=1nln⁡p(xi∣θ).L(\theta;D)=\prod_{i=1}^{n}p(x_i\mid\theta),\qquad \hat\theta_{\mathrm{MLE}}=\operatorname*{arg\,max}_{\theta}\sum_{i=1}^{n}\ln p(x_i\mid\theta).


During fitting, hold the observations fixed and vary the parameters. A likelihood is not, by definition, a probability distribution over those parameters.


For a Bernoulli model, let kk of n>0n>0 observations equal one. Then


ℓ(θ)=kln⁡θ+(n−k)ln⁡(1−θ),θ^MLE=kn.\ell(\theta)=k\ln\theta+(n-k)\ln(1-\theta),\qquad \hat\theta_{\mathrm{MLE}}=\frac{k}{n}.


For 0<k<n0<k<n, setting the derivative to zero gives this interior maximum. If all outcomes agree, the maximum lies at zero or one.


For a conditional probability table, normalize counts separately within each conditioning group. If a group has no observations, its probability row is not uniquely determined by likelihood alone.

Incorporate prior information

Maximum a posteriori estimation, abbreviated MAP, selects the parameter value with the highest posterior density. A prior density p(θ)p(\theta) supplies information or preferences specified before fitting:


θ^MAP=arg max⁡θ[ℓ(θ)+ln⁡p(θ)].\hat\theta_{\mathrm{MAP}} =\operatorname*{arg\,max}_{\theta} \left[\ell(\theta)+\ln p(\theta)\right].


For Bernoulli data, a beta prior has density proportional to θα−1(1−θ)β−1\theta^{\alpha-1}(1-\theta)^{\beta-1}. With α>1\alpha>1 and β>1\beta>1, the posterior has an interior maximum:


θ^MAP=k+α−1n+α+β−2.\hat\theta_{\mathrm{MAP}} =\frac{k+\alpha-1}{n+\alpha+\beta-2}.


The exponents explain the minus-one terms: MAP adds α−1\alpha-1 to the success count and β−1\beta-1 to the failure count.


Feature

MLE

MAP

Objective

Maximize likelihood

Maximize likelihood times prior density

Information used

Observed data

Observed data and a specified prior

Unobserved binary outcome

Can receive probability zero

Receives positive probability with the beta prior conditions above



Learn with unobserved memberships

A mixture model can include a latent variable identifying which component generated each record. Without observed memberships, you cannot directly count records belonging to each component.


Expectation–maximization, or EM, alternates two operations. The expectation step computes expected memberships using the current parameters. The maximization step fits new parameters using those expected counts by maximizing the expected complete-data log-likelihood.


Three boxes show current parameters producing expected counts and updated parameters, with an arrow returning to repeat the calculation.


For a two-component Bernoulli mixture, write ri=P(Zi=A∣xi,θold)r_i=P(Z_i=A\mid x_i,\theta_{\mathrm{old}}) for record ii's expected membership in component A. Its effective count is NA=∑iriN_A=\sum_i r_i. The updates are


πnew=NAn,θA,new=∑irixiNA,\pi_{\mathrm{new}}=\frac{N_A}{n},\qquad \theta_{A,\mathrm{new}}=\frac{\sum_i r_i x_i}{N_A},


where π\pi is A's mixing probability and NA>0N_A>0. Component B uses weights 1−ri1-r_i. Expected counts can be fractional; rounding them changes the update.


With well-defined exact steps, EM does not decrease the observed-data log-likelihood. However, this does not guarantee a global maximum; initialization can affect the fitted result.

Evaluate the learned fit

Training likelihood measures fit to the records used for estimation. To compare predictive performance, score separate validation records without updating parameters from them. Lower average negative log-likelihood means the model assigns greater probability to those records on a geometric-average basis.



What to remember

  • MLE fits parameters using the likelihood of fixed observations.
  • MAP adds a specified prior and selects a posterior mode.
  • Conditional tables normalize within groups; EM uses expected counts.
  • Validation performance and optimization guarantees answer different questions.

Example: Learning an automatic restart probability

Example: A monitoring program records whether an automatic restart succeeds. Model each outcome as independent with the same unknown success probability θ\theta. The training data, meaning the records used to fit the parameter, contain five successes in eight attempts. Before fitting, the developer specifies a beta prior with α=3\alpha=3 and β=3\beta=3, whose density is proportional to θ2(1−θ)2\theta^2(1-\theta)^2.


A separate validation batch contains three successes and one failure under the same operating conditions. Use natural logarithms and retain unrounded estimates until reporting final results. All probabilities and log scores are dimensionless.


a) Find the maximum-likelihood estimate of the restart success probability. Report three decimal places.


There are five successes, and the number of failures is ________. Because the individual outcomes are independent, their likelihood is


L(θ)=θ5(1−θ)3.L(\theta)=\theta^5(1-\theta)^3.


Taking its logarithm and differentiating gives


ℓ(θ)=5ln⁡θ+3ln⁡(1−θ),ℓ′(θ)=5θ−31−θ.\ell(\theta)=5\ln\theta+3\ln(1-\theta),\qquad \ell'(\theta)=\frac{5}{\theta}-\frac{3}{1-\theta}.


Set the derivative to zero and solve:


5(1−θ)=3θ⟹5=8θ⟹θ^MLE=58.5(1-\theta)=3\theta \quad\Longrightarrow\quad 5=8\theta \quad\Longrightarrow\quad \hat\theta_{\mathrm{MLE}}=\frac{5}{8}.


The second derivative, −5/θ2−3/(1−θ)2-5/\theta^2-3/(1-\theta)^2, is negative throughout the interior. Both outcome types were observed, so the boundary likelihoods are zero and the interior solution is the maximum.


The maximum-likelihood estimate is 0.625.


b) Find the MAP estimate using the specified prior. Report three decimal places.


Multiply the likelihood by the prior density, ignoring factors that do not depend on θ\theta. The resulting success exponent is ________, and the failure exponent is ________:


p(θ∣D)∝θ5(1−θ)3θ2(1−θ)2=θ7(1−θ)5.p(\theta\mid D)\propto \theta^5(1-\theta)^3\theta^2(1-\theta)^2 =\theta^7(1-\theta)^5.


The log-posterior, apart from an additive constant, is 7ln⁡θ+5ln⁡(1−θ)7\ln\theta+5\ln(1-\theta). Its derivative vanishes when


7θ−51−θ=0⟹7(1−θ)=5θ⟹θ^MAP=712=0.583333….\frac{7}{\theta}-\frac{5}{1-\theta}=0 \quad\Longrightarrow\quad 7(1-\theta)=5\theta \quad\Longrightarrow\quad \hat\theta_{\mathrm{MAP}}=\frac{7}{12}=0.583333\ldots.


Its second derivative is negative throughout the interior, confirming the maximum. The symmetric prior pulls the estimate toward its mode of one half. The posterior mean would instead be 8/148/14, so it should not replace the mode requested here.


The MAP estimate is 0.583.


c) Compute each estimate's validation loss and identify which performs better on the validation batch. Report three decimal places.


Here, validation loss means the average negative log-likelihood on the four separate validation records. Score the fixed estimates without fitting them again.


For three validation successes and one validation failure, the average negative log-likelihood is


NLL⁡(θ)=−3ln⁡θ+ln⁡(1−θ)4.\operatorname{NLL}(\theta) =-\frac{3\ln\theta+\ln(1-\theta)}{4}.


First substitute the unrounded maximum-likelihood estimate. Its total negative log-likelihood is approximately ________:


NLL⁡(5/8)=−3ln⁡(5/8)+ln⁡(3/8)4=0.597710….\operatorname{NLL}(5/8) =-\frac{3\ln(5/8)+\ln(3/8)}{4} =0.597710\ldots.


Next substitute the unrounded MAP estimate. Its total negative log-likelihood is approximately ________:


NLL⁡(7/12)=−3ln⁡(7/12)+ln⁡(5/12)4=0.623115….\operatorname{NLL}(7/12) =-\frac{3\ln(7/12)+\ln(5/12)}{4} =0.623115\ldots.


Lower loss indicates greater probability assigned to these validation records. The validation success fraction is 3/43/4, so the higher of the two fitted success probabilities is favored in this particular comparison. A prior can help learning without improving every realized validation score.


The average losses are 0.598 for MLE and 0.623 for MAP. The MLE fit performs better on this validation batch; four records do not establish that it will always predict better.

A developer fits an independent Bernoulli model to recorded server request successes and failures. Which description correctly treats the likelihood during parameter estimation?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A team is investigating why learning a probabilistic model may produce unreliable parameter estimates or a poor fitted distribution. Match each issue to the description that identifies its source.

Match each term
A.

No parameter setting in the selected family reproduces the distribution generating the observations.

B.

Estimates vary across repeated finite datasets generated by the same underlying distribution.

C.

The fitting algorithm returns an objective value worse than another attainable value for the same dataset and model.

D.

Distinct parameter settings give exactly the same distribution of every possible observation.

Non-identifiability

Sampling uncertainty

Model misspecification

Optimization error

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A deployment tool succeeds on 9 of 12 independent runs, each modelled with the same success probability θ\theta. Before observing these runs, its developer specifies a beta prior with α=4\alpha=4 and β=3\beta=3, so the prior density is proportional to θ3(1−θ)2\theta^3(1-\theta)^2. Find the maximum a posteriori estimate of θ\theta. Give a probability between zero and one, to three decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice