English:
The log likelihood is a key concept in statistics and machine learning that quantifies how well a statistical model explains observed data. It is the natural logarithm of the likelihood function, which measures the probability of the observed data given the model parameters.
Key Concepts
-
Likelihood Function:
- Given a set of observed data and a model parameterized by , the likelihood function is: where represents the probability of the data under the model with parameters .
-
Log Likelihood:
- The log likelihood is the logarithm of the likelihood function:
- For independent and identically distributed (i.i.d.) data, the likelihood function for n samples can be written as: Taking the logarithm transforms the product into a sum:
-
Why Use the Log Likelihood?
- Numerical Stability: Products of probabilities can become extremely small, leading to underflow. Taking the logarithm mitigates this issue by transforming products into sums.
- Simplified Calculations: The log likelihood simplifies optimization problems because it is easier to differentiate sums than products.
- Interpretability: Logarithms are monotonic, meaning the log likelihood and the likelihood function achieve their maximum at the same parameter values.
Applications
-
Maximum Likelihood Estimation (MLE):
- In MLE, the goal is to find the parameters that maximize the likelihood of the observed data. Since maximizing the likelihood is equivalent to maximizing the log likelihood , the optimization problem becomes:
-
Model Comparison:
- The log likelihood can be used to compare different models. A higher log likelihood indicates that a model better explains the observed data.
-
Bayesian Inference:
- In Bayesian methods, the log likelihood is combined with the prior distribution to compute the posterior distribution: where is the prior.
Example
Suppose we observe data points , and we assume they come from a Poisson distribution with parameter . The likelihood function is:
For a Poisson distribution, . Thus:
Taking the logarithm:
Maximizing this log likelihood with respect to gives the maximum likelihood estimate (MLE) for .
Key Intuition
The log likelihood provides a measure of how plausible the observed data is under a given model. By maximizing the log likelihood, we find the parameters that make the data most probable, thus "fitting" the model to the data.
---
Vietnamese:
Log likelihood (logarit của hàm khả năng) là một khái niệm quan trọng trong thống kê và học máy, dùng để định lượng mức độ phù hợp của một mô hình thống kê với dữ liệu quan sát. Đây là logarit tự nhiên của hàm khả năng, đo lường xác suất của dữ liệu quan sát được với các tham số của mô hình.
Các khái niệm chính
-
Hàm khả năng (Likelihood Function):
- Với một tập dữ liệu quan sát và một mô hình tham số hóa bởi , hàm khả năng được định nghĩa là: , trong đó là xác suất của dữ liệu theo mô hình với tham số .
-
Log Likelihood:
- Log likelihood là logarit của hàm khả năng:
- Nếu dữ liệu được giả định là độc lập và phân phối giống nhau (i.i.d.), hàm khả năng cho mẫu có thể viết là: Lấy logarit sẽ chuyển tích thành tổng:
-
Tại sao sử dụng Log Likelihood?
- Ổn định số học (Numerical Stability): Tích của các xác suất có thể trở nên rất nhỏ, dẫn đến vấn đề underflow. Việc lấy logarit giúp giảm thiểu vấn đề này bằng cách chuyển tích thành tổng.
- Đơn giản hóa tính toán (Simplified Calculations): Log likelihood làm cho các bài toán tối ưu hóa dễ dàng hơn, vì tính tổng đơn giản hơn tính tích trong đạo hàm.
- Dễ diễn giải (Interpretability): Vì logarit là đơn điệu, log likelihood và likelihood đạt cực đại tại cùng một giá trị tham số.
Ứng dụng
-
Ước lượng hợp lý cực đại (Maximum Likelihood Estimation - MLE):
- Trong MLE, mục tiêu là tìm tham số tối đa hóa khả năng của dữ liệu quan sát. Vì tối đa hóa tương đương với tối đa hóa , bài toán tối ưu trở thành:
-
So sánh mô hình:
- Log likelihood được sử dụng để so sánh các mô hình khác nhau. Một log likelihood cao hơn chỉ ra rằng mô hình giải thích dữ liệu tốt hơn.
-
Suy diễn Bayes:
- Trong phương pháp Bayes, log likelihood được kết hợp với phân phối tiên nghiệm để tính phân phối hậu nghiệm: trong đó P(θ) là phân phối tiên nghiệm.
Ví dụ
Giả sử chúng ta quan sát dữ liệu , và giả định chúng được sinh ra từ một phân phối Poisson với tham số . Hàm khả năng là:
Với phân phối Poisson, . Do đó:
Lấy logarit:
Tối đa hóa log likelihood theo sẽ cho ước lượng hợp lý cực đại (MLE) của .
Trực giác chính
Log likelihood cung cấp một thước đo về mức độ "khả dĩ" của dữ liệu quan sát được dưới một mô hình cho trước. Bằng cách tối đa hóa log likelihood, chúng ta tìm ra các tham số giúp mô hình phù hợp nhất với dữ liệu.