Maximum Likelihood Estimation is a method of estimating the parameters of a probability distribution by maximizing a likelihood function, so that under the assumed statistical model the observed data is most probable.
WHY it matters: In ML, we constantly need to fit models (like Gaussian distributions for features, or logistic regression coefficients). MLE gives us a principled, mathematically rigorous way to find the "best" parameters from data.
Imagine you have a bag of colored marbles, but you can't see inside. You pull out 10 marbles: 7 red, 3 blue.
Now the question is: "What percentage of the marbles in the bag are red?"
You could guess anything—maybe 50% red, maybe 80% red. But which guess makes the most sense given what you pulled out?
MLE says: "Pick the percentage that would make it most likely to pull out exactly 7 red and 3 blue."
If the bag were70% red marbles, pulling out 7 red from 10 tries makes a lot of sense. If it were 10% red, pulling out 7 red would be super weird (very unlikely).
So MLE picks 70% red because that's the percentage that best explains what you actually saw. It's like working backwards from the result to figure out what the bag probably looks like inside.
What is Maximum Likelihood Estimation (MLE)? :: A method of estimating parameters of a probability distribution by finding the parameter values that maximize the likelihood function, making the observed data most probable under the assumed model.
What is the likelihood function for i.i.d. data? :: L(θ∣X)=∏i=1np(xi∣θ), the product of individual probabilities for each data point.
Why do we use log-likelihood instead of likelihood?
(1) Products become sums (easier calculus), (2) Monotonic so argmax is preserved, (3) Numerically stable (prevents underflow with tiny probabilities).
What is the MLE for the parameter p of a Bernoulli distribution with k successes in n trials?
p^MLE=nk, the sample proportion of successes.
What is the MLE for the mean μ of a Gaussian distribution (known variance)?
μ^MLE=xˉ=n1∑i=1nxi, the sample mean.
What are the three steps to find MLE analytically?
(1) Write log-likelihood ℓ(θ), (2) Take derivative dθdℓ, (3) Set to zero and solve for θ.
What is the relationship between least squares regression and MLE?
Under Gaussian noise assumption, minimizing squared loss is equivalent to maximizing the likelihood function.
Is MLE always unbiased? :: No! MLE is asymptotically unbiased (consistent) but can be biased for finite samples. Example: MLE for Gaussian variance uses n1 instead of n−11.
What is the invariance property of MLE?
If θ^MLE is the MLE for θ, then g(θ^MLE) is the MLE for g(θ) for any function g.
What does "asymptotic efficiency" of MLE mean?
MLE achieves the Cramér-Rao lower bound asymptotically, meaning no other consistent estimator has lower variance for large sample sizes.
Why do we assume i.i.d. (independent and identically distributed) samples in MLE?
So the joint probability factorizes as a product: P(X∣θ)=∏P(xi∣θ), allowing us to write the likelihood function.
How is cross-entropy loss related to MLE?
Cross-entropy loss is the negative log-likelihood for classification problems. Minimizing cross-entropy = maximizing likelihood under a categorical/Bernoulli model.
Maximum Likelihood Estimation (MLE) ka matlab hai ki ap data dekh kar wo parameters dhoondte ho jouss data ko sabse zyada probable banate hain. Socho ki tumhare pas kuch observations hain—jaise 10 coin flips mein 7 heads aye. Ab sawaal hai: coin kitna biased hai? Matlab, heads ka probability kya hai?
MLE kehta hai: "Wo probability value choose karo jo is result (7 heads out of 10) ko sabse likely banaye." Agar coin 70% heads deta hai, toh 7 heads milna makes sense. Agar 10% heads deta hai, toh 7 heads milna bahut rare event hoga. Toh MLE bolega p=0.7 best fit hai.
Machine learning mein yeh concept har jagah use hota hai. Jab tum linear regression fit karte ho (squared loss minimize karte ho), actually tum Gaussian likelihood maximize kar rahe ho—wahi MLE hai! Jab neural network train karta ho cross-entropy loss se, woh bhi MLE hai Bernoulli/Categorical distribution ke liye. Matlab, ML ka pora foundation MLE pe based hai. Understanding this makes you understand WHY we use certain loss functions, WHY least squares works, aur WHY probabilistic models itne powerful hain.
Formula simple hai: log-likelihood likho (product ko sum banao), derivative lo, zero pe set karo, solve karo. Bass! Har distribution ke liye yeh process repeat karo—Bernoulli ho, Gaussian ho, ya koi aur—aur tumhe optimal parameters mil jayenge data se. Yeh AI-ML ke sabse fundamental tools mein se ek hai.