0% found this document useful (0 votes)
44 views2 pages

F1 Machine Learning EM Algorithm Practice

The document contains a practice sheet for a machine learning course focusing on the Expectation-Maximization (EM) algorithm, with various questions related to Gaussian and Poisson mixture models, responsibilities, and parameter updates. It includes computations for log-likelihood, posterior probabilities, expected assignment probabilities, and updates for Beta and Gamma distributions. Additionally, it addresses the theoretical aspects of the EM algorithm, such as its steps, convergence, and suitability for estimating parameters in incomplete data scenarios.

Uploaded by

kingslayer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

F1 Machine Learning EM Algorithm Practice

The document contains a practice sheet for a machine learning course focusing on the Expectation-Maximization (EM) algorithm, with various questions related to Gaussian and Poisson mixture models, responsibilities, and parameter updates. It includes computations for log-likelihood, posterior probabilities, expected assignment probabilities, and updates for Beta and Gamma distributions. Additionally, it addresses the theoretical aspects of the EM algorithm, such as its steps, convergence, and suitability for estimating parameters in incomplete data scenarios.

Uploaded by

kingslayer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BITS F464 Machine Learning E-M Algorithm Practice Sheet

Q1. Verstappen’s race in dry conditions is modelled as a mixture of two Gaussians. Given Gaussian
1 𝑥−µ 2
1 −2( )
Distribution: 𝑒 σ

2πσ
2
●​ Quali Mode: µ1 = 87, σ1 = 2, π1 = 0. 7
2
●​ Fuel-Saving Mode: µ2 = 90, σ2 = 2, π2 = 0. 3
Give lap times X = {88, 89, 91}. Compute the log-likelihood.

Q2. Drivers adjust their driving styles based on tyre wear. Given initial means: µ1 = 88 & µ2 = 92,
computed responsibilities: γ(𝑧𝑖1) = {0. 8, 0. 5, 0. 2} & γ(𝑧𝑖2) = {0. 2, 0. 5, 0. 8}, and lap times:
𝑋 = {87, 90, 94}. Update the new mean values using the Maximisation Step.

2
Q3. In a race, Scuderia Ferrari’s lap times follow a Gaussian µ1 = 91 & σ1 = 1 and Red Bull Racing are
2
modelled with µ2 = 88 & σ1 = 1. Given observed lap times X = {89, 92, 87} and π1 = π2 = 0. 5.
Compute the posterior probability that each lap was set by Scuderia Ferrari.

Q4. Torro Rosso pit stop errors are modelled using a Poisson Mixture Model. Given Poisson Distribution:
−λ 𝑥
𝑒 λ
𝑃(𝑋 = 𝑥 | λ) = 𝑥!
. There are two types of errors:
●​ Minor Errors λ1 = 1 per pit stop
●​ Major Errors λ2 = 4 per pit stop
Given pit stop error counts X = {1, 2, 0, 5, 3, 1} with initial π1 = 0. 7 & π2 = 0. 3. Compute expected
assignment probabilities for each pit stop.

Q5. In a wet Monaco Grand Prix, we suspect two types of drivers - Rain Masters and Strugglers. Given
the observed lap time (in s): 𝑋 = {75. 2, 76. 1, 80. 5, 81. 3, 82. 9}. Assume a Gaussian Mixture Model
(GMM) with two components initialised with µ1 = 76, µ2 = 81, σ1 = σ2 = 1 & π1 = π2 = 0. 5 .
Compute initial responsibilities for each lap time.

Q6. Answer briefly: Explain the two main steps of the Expectation-Maximization (EM) algorithm. Why is
the E-step necessary, and what does it compute? What happens in the M-step, and how does it update
parameters?

Q7. F1 teams get known sponsors and unknown investors. We model the funding distribution using the
α
β α−1 −β𝑥
Gamma Mixture Model. Given Gamma Distribution: 𝑓(𝑥, α, β) = Γ(α)
𝑥 𝑒
●​ Sponsor Money: 𝐺𝑎𝑚𝑚𝑎(α1 = 3, β1​ = 1)
●​ Hidden Investors: 𝐺𝑎𝑚𝑚𝑎(α2 = 5, β2​ = 2)
Given observed funding amounts (in million $) X = {3, 4, 6, 8, 2, 7, 5} with π1 = 0. 6 & π2 = 0. 4.
Compute the expected probability that 6 M $ came from hidden investors.

Q8. Explain in short:


1.​ Why does the EM algorithm always increase the likelihood in each iteration?
2.​ Can EM guarantee convergence? If so, what does it converge to? Explain in short.

Q9. A team models the risk of spinning out in wet conditions using Beta distributions. Given Beta
Γ(α+β) α−1 β−1
Distribution: Γ(α)Γ(β)
𝑥 (1 − 𝑥)
●​ Careful Drivers: α1 = 4 & β1 = 6
●​ Aggressive Drivers: α2 = 8 & β2 = 2

Observed spin counts (per 10 laps): X = {1, 2, 3, 0, 2, 1}. Compute the updated Beta parameters after one
E-M step.

Q10. A company has two types of defective machines, Type A and Type B. When a machine fails, the
company records the failure but does not know which type of machine failed.

●​ Type A fails with probability 𝑝𝐴​and Type B fails with probability 𝑝𝐵.
●​ A randomly chosen machine is of Type A with probability λ and of Type B with probability 1−λ.

(a) Why is the Expectation-Maximization (E-M) algorithm suitable for estimating 𝑝𝐴, 𝑝𝐵 and λ given this
incomplete data?

(b) What challenges might arise when using the E-M algorithm for this problem?

Common questions

Powered by AI

In the maximization step, the new mean values are calculated as weighted averages of the lap times according to the responsibilities. For µ1, it is calculated as the sum of γ(𝑧𝑖1) times X divided by the sum of γ(𝑧𝑖1), resulting in (0.8*87 + 0.5*90 + 0.2*94) / (0.8+0.5+0.2). For µ2, calculate (0.2*87 + 0.5*90 + 0.8*94) / (0.2+0.5+0.8).

Calculate the sufficient statistics for the Beta distribution given the spins observed. Perform the E-step by assigning probabilities to each driver's category based on the Beta distribution. In the M-step, update each distribution parameter: α(new) = ∑γ * (observed counts + prior α - 1), β(new) = ∑γ * (1 - observed counts + prior β - 1), where γ is the responsibility for either careful or aggressive drivers.

The EM algorithm is suitable because it can handle latent variables, allowing for estimation of probabilities even when the classification of data points (machine types) is incomplete. It iteratively refines the parameter estimates (probabilities) by calculating expected values of latent variables in the E-step and updating parameters based on these expectations in the M-step. Challenges include the algorithm potentially converging to local maxima and requiring good initial parameter estimates to ensure reasonable solutions.

The log-likelihood is found by computing the probability of each lap time under both Gaussian components and then taking the logarithm of the sum of these probabilities weighted by their respective component probabilities. For each lap time, calculate the probability under the Quali Mode and Fuel-Saving Mode using p(x|Quali) = (1/(√(2π*σ1^2))) * exp(-(x-µ1)^2/(2*σ1^2)) and p(x|Fuel-saving) = (1/(√(2π*σ2^2))) * exp(-(x-µ2)^2/(2*σ2^2)). Then, the total probability for each lap time is π1*p(x|Quali) + π2*p(x|Fuel-saving). Finally, the log-likelihood is the sum of the logarithms of these probabilities across all lap times.

Calculate the probability of observing each error count under the minor and major error Poisson distributions. For a count xi, compute the probability under each distribution: P(xi|Minor) = (e^(-λ1) * λ1^xi) / xi! and P(xi|Major) = (e^(-λ2) * λ2^xi) / xi!. The expected assignment probability for each pit stop is then π1*P(xi|Minor) / [π1*P(xi|Minor) + π2*P(xi|Major)] for minor errors, and π2*P(xi|Major) / [π1*P(xi|Minor) + π2*P(xi|Major)] for major errors.

The EM algorithm ensures an increase in likelihood due to its design: the E-step computes the expected log-likelihood which the M-step then maximizes. This guarantees a non-decreasing sequence of the expected log-likelihood. EM converges to a local maximum of the likelihood function, not necessarily a global maximum, due to its iterative refinement based on the initial configuration.

Compute the probability of observing 6 million dollars under each component of the Gamma distribution. Use the density f(x|α,β) = β^α/Γ(α) * x^(α-1) * e^(-βx). For the hidden investors, compute P(x=6|α2,β2) = (2^5/Gamma(5)) * 6^(5-1) * e^(-2*6). The expected probability is then π2*P(6|Hidden) / [π1*P(6|Sponsor) + π2*P(6|Hidden)].

The E-step computes the expected value of the latent variables, given current parameter estimates, by assigning weights (responsibilities) to components in the mixture model based on observed data. The M-step maximizes the expected log-likelihood found in the E-step with respect to the parameters, updating the model parameters. The E-step is necessary to infer the most likely component that generated each observation, while the M-step refines the model parameters given these inferred assignments.

First, calculate the likelihood of each lap time under the model for Scuderia Ferrari and Red Bull using their respective Gaussian distributions. For a lap time x: p(x|Ferrari) = (1/(√(2πσ1^2))) * exp(-(x-µ1)^2/(2σ1^2)) and p(x|Red Bull) = (1/(√(2πσ2^2))) * exp(-(x-µ2)^2/(2σ2^2)). Use these to calculate the posterior using Bayes' theorem: P(Ferrari|x) = π1*p(x|Ferrari) / (π1*p(x|Ferrari) + π2*p(x|Red Bull)) for each lap time in X = {89, 92, 87}.

Compute the responsibility of each component for each lap time. For a lap time xi, the responsibility for component 1 is γ(z1|xi) = π1*p(xi|µ1, σ1) / [π1*p(xi|µ1, σ1) + π2*p(xi|µ2, σ2)], where p(x|µ,σ) is the Gaussian probability density function. Use initial parameters to compute these values across all lap times in X.

You might also like