1 / 46

Maximum Likelihood (ML), Expectation Maximization (EM) Pieter Abbeel UC Berkeley EECS

Maximum Likelihood (ML), Expectation Maximization (EM) Pieter Abbeel UC Berkeley EECS Many slides adapted from Thrun , Burgard and Fox, Probabilistic Robotics. TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A A A A. Outline.

ikia
Download Presentation

Maximum Likelihood (ML), Expectation Maximization (EM) Pieter Abbeel UC Berkeley EECS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Maximum Likelihood (ML), Expectation Maximization (EM) Pieter Abbeel UC Berkeley EECS Many slides adapted from Thrun, Burgard and Fox, Probabilistic Robotics TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAAAAA

  2. Outline • Maximum likelihood (ML) • Priors, and maximum a posteriori (MAP) • Cross-validation • Expectation Maximization (EM)

  3. Thumbtack • Let µ = P(up), 1-µ = P(down) • How to determine µ ? • Empirical estimate: 8 up, 2 down 

  4. http://web.me.com/todd6ton/Site/Classroom_Blog/Entries/2009/10/7_A_Thumbtack_Experiment.htmlhttp://web.me.com/todd6ton/Site/Classroom_Blog/Entries/2009/10/7_A_Thumbtack_Experiment.html

  5. Maximum Likelihood • µ = P(up), 1-µ = P(down) • Observe: • Likelihood of the observation sequence depends on µ: • Maximum likelihood finds • extrema at µ = 0, µ = 1, µ = 0.8 • Inspection of each extremum yields µML = 0.8

  6. Maximum Likelihood • More generally, consider binary-valued random variable with µ = P(1), 1-µ = P(0), assume we observe n1 ones, and n0 zeros • Likelihood: • Derivative: • Hence we have for the extrema: • n1/(n0+n1) is the maximum • = empirical counts.

  7. Log-likelihood • The function is a monotonically increasing function of x • Hence for any (positive-valued) function f: • In practice often more convenient to optimize the log-likelihood rather than the likelihood itself • Example:

  8. Log-likelihood  Likelihood • Reconsider thumbtacks: 8 up, 2 down • Likelihood • Definition: A function f is concave if and only • Concave functions are generally easier to maximize then non-concave functions • log-likelihood Concave Not Concave

  9. Concavity and Convexity f is convex if and only “Easy” to minimize f is concave if and only “Easy” to maximize x1 x1 x2 x2 ¸ x2+(1-¸)x2 ¸ x2+(1-¸)x2

  10. ML for Multinomial • Consider having received samples

  11. ML for Fully Observed HMM • Given samples • Dynamics model: • Observation model:  Independent ML problems for each and each

  12. ML for Exponential Distribution Source: wikipedia • Consider having received samples • 3.1, 8.2, 1.7 ll

  13. ML for Exponential Distribution Source: wikipedia • Consider having received samples

  14. Uniform • Consider having received samples

  15. ML for Gaussian • Consider having received samples

  16. ML for Conditional Gaussian Equivalently: More generally:

  17. ML for Conditional Gaussian

  18. ML for Conditional Multivariate Gaussian

  19. Aside: Key Identities for Derivation on Previous Slide

  20. ML Estimation in Fully Observed Linear Gaussian Bayes Filter Setting • Consider the Linear Gaussian setting: • Fully observed, i.e., given •  Two separate ML estimation problems for conditional multivariate Gaussian: • 1: • 2:

  21. Priors --- Thumbtack • Let µ = P(up), 1-µ = P(down) • How to determine µ ? • ML estimate: 5 up, 0 down  • Laplace estimate: add a fake count of 1 for each outcome

  22. Priors --- Thumbtack • Alternatively, consider $µ$ to be random variable • Prior P(µ) /µ(1-µ) • Measurements: P( x | µ ) • Posterior: • Maximum A Posterior (MAP) estimation • = find µ that maximizes the posterior 

  23. Priors --- Beta Distribution Figure source: Wikipedia

  24. Priors --- Dirichlet Distribution • Generalizes Beta distribution • MAP estimate corresponds to adding fake counts n1, …, nK

  25. MAP for Mean of Univariate Gaussian • Assume variance known. (Can be extended to also find MAP for variance.) • Prior:

  26. MAP for Univariate Conditional Linear Gaussian • Assume variance known. (Can be extended to also find MAP for variance.) • Prior: [Interpret!]

  27. MAP for Univariate Conditional Linear Gaussian: Example TRUE --- Samples . ML --- MAP ---

  28. Cross Validation • Choice of prior will heavily influence quality of result • Fine-tune choice of prior through cross-validation: • 1. Split data into “training” set and “validation” set • 2. For a range of priors, • Train: compute µMAP on training set • Cross-validate: evaluate performance on validation set by evaluating the likelihood of the validation data under µMAP just found • 3. Choose prior with highest validation score • For this prior, compute µMAP on (training+validation) set • Typical training / validation splits: • 1-fold: 70/30, random split • 10-fold: partition into 10 sets, average performance for each of the sets being the validation set and the other 9 being the training set

  29. Outline • Maximum likelihood (ML) • Priors, and maximum a posteriori (MAP) • Cross-validation • Expectation Maximization (EM)

  30. Mixture of Gaussians • Generally: • Example: • ML Objective: given data z(1), …, z(m) • Setting derivatives w.r.t. µ, ¹, § equal to zero does not enable to solve for their ML estimates in closed form We can evaluate function  we can in principle perform local optimization, see future lectures. In this lecture: “EM” algorithm, which is typically used to efficiently optimize the objective (locally)

  31. Expectation Maximization (EM) • Example: • Model: • Goal: • Given data z(1), …, z(m) (but no x(i) observed) • Find maximum likelihood estimates of ¹1, ¹2 • EM basic idea: if x(i) were known  two easy-to-solve separate ML problems • EM iterates over • E-step: For i=1,…,m fill in missing data x(i) according to what is most likely given the current model ¹ • M-step: run ML for completed data, which gives new model ¹

  32. EM Derivation • EM solves a Maximum Likelihood problem of the form: µ: parameters of the probabilistic model we try to find x: unobserved variables z: observed variables Jensen’s Inequality

  33. Jensen’s inequality Illustration: P(X=x1) = 1-¸, P(X=x2) = ¸ x1 x2 E[X] = ¸ x2+(1-¸)x2

  34. EM Derivation (ctd) EM Algorithm: Iterate 1. E-step: Compute 2. M-step: Compute Jensen’s Inequality: equality holds when is an affine function. This is achieved for M-step optimization can be done efficiently in most cases E-step is usually the more expensive step It does not fill in the missing data x with hard values, but finds a distribution q(x)

  35. EM Derivation (ctd) • M-step objective is upper-bounded by true objective • M-step objective is equal to true objective at current parameter estimate •  Improvement in true objective is at least as large as improvement in M-step objective

  36. EM 1-D Example --- 2 iterations • Estimate 1-d mixture of two Gaussians with unit variance: • one parameter ¹ ; ¹1 = ¹- 7.5, ¹2 = ¹+7.5

  37. EM for Mixture of Gaussians • X ~ Multinomial Distribution, P(X=k ; µ) = µk • Z ~ N(¹k, §k) • Observed: z(1), z(2), …, z(m)

  38. EM for Mixture of Gaussians • E-step: • M-step:

  39. ML Objective HMM • Given samples • Dynamics model: • Observation model: • ML objective: • No simple decomposition into independent ML problems for each and each • No closed form solution found by setting derivatives equal to zero

  40. EM for HMM --- M-step • µ and ° computed from “soft” counts

  41. EM for HMM --- E-step • No need to find conditional full joint • Run smoother to find:

  42. ML Objective for Linear Gaussians • Linear Gaussian setting: • Given • ML objective: • EM-derivation: same as HMM

  43. EM for Linear Gaussians --- E-Step • Forward: • Backward:

  44. EM for Linear Gaussians --- M-step [Updates for A, B, C, d. TODO: Fill in once found/derived.]

  45. EM for Linear Gaussians --- The Log-likelihood • When running EM, it can be good to keep track of the log-likelihood score --- it is supposed to increase every iteration

  46. EM for Extended Kalman Filter Setting • As the linearization is only an approximation, when performing the updates, we might end up with parameters that result in a lower (rather than higher) log-likelihood score •  Solution: instead of updating the parameters to the newly estimated ones, interpolate between the previous parameters and the newly estimated ones. Perform a “line-search” to find the setting that achieves the highest log-likelihood score

More Related