最大似然 极大似然_实例最大似然解释

最大似然 极大似然

Introduction :

简介

In machine learning, the purpose is to find certain types of patterns. To do so, you need to train a model over a dataset using algorithms so that the model can learn from those data. Once it’s trained, the model can be used to predict on a different data that it hasn’t seen before.

在机器学习中,目的是找到某些类型的模式。 为此,您需要使用算法在数据集中训练模型,以便模型可以从这些数据中学习。 训练完成后,该模型可用于预测以前从未见过的不同数据。

For example, we can use a ML model in order to predict if a patient has diabetes or if he’s healthy depending on features like its blood pressure, its weight etc…

例如,我们可以使用ML模型来根据患者的血压,体重等特征来预测患者是否患有糖尿病或他是否健康……

Each machine learning model has parameters. They are very important and they define how the model looks like.

每个机器学习模型都有参数。 它们非常重要,它们定义了模型的外观。

The Maximum Likelihood Estimation (MLE) is a method of estimating the parameters of a model. This estimation method is used a lot.

最大似然估计(MLE)是一种估计模型参数的方法。 该估计方法被大量使用。

The background you’re required to have :

您需要具备的背景:

Probability distributions, density functions, events, independance between random variables, joint probability.

概率分布,密度函数,事件,随机变量之间的独立性,联合概率。

How does it work ?

它是如何工作的 ?

To estimate the parameters using the maximum likelihood method, we need, first of all, to define a likelihood function in order to calculate the conditional probability of observing the data sample given a probability distribution and distribution parameters.

为了使用最大似然法估计参数,我们首先需要定义一个似然函数,以便计算在给定概率分布和分布参数的情况下观察数据样本的条件概率。

Likelihood function :

似然函数:

The likelihood function is a function of statistcal model’s parameters calculated from observed data.

似然函数是根据观测数据计算出的统计模型参数的函数。

The words « likelihood » and « probability » don’t have exactly the same meaning. Indeed, « probability » represents the plausibility of an event according to a model, with no specific reference to observed data. And « likelihood » describes the plausibility of a model parameters’ value, given the observation of realizations of a random variable.

“可能性”和“概率”这两个词的含义并不完全相同。 实际上,“概率”表示根据模型的事件的合理性,而没有具体参考观察到的数据。 在观察到随机变量实现的情况下,“似然”描述了模型参数值的合理性。

Suppose that the joint probability density function of your sample X = (X1,…,Xn) is f(x| θ), where θ is a vector of parameters. X = x is an observed sample point. Then the function of θ :

假设样本X =(X1,…,Xn)的联合概率密度函数为f(x |θ),其中θ是参数的向量。 X = x是观察到的采样点。 然后θ的函数:

L(θ |x) = f(x |θ) is the likelihood function.

L(θ| x)= f(x |θ)是似然函数。

For a better understanding, if we are in a case that L(θ1|x) > L(θ2|x), then our observed sample x is more likely to have been observed if θ = θ1 than if θ = θ2.

为了更好地理解,如果我们在L(θ1| x)> L(θ2| x)的情况下,则与θ=θ2相比,如果θ=θ1,则更有可能观察到观察到的样本x。

It also means that the most plausible value for θ between θ1 and θ2, is θ1.

这也意味着在θ1和θ2之间的θ最合理的值为θ1。

If we suppose that X1,…,Xn are iid, we can also write the likelihood function as :

如果我们假设X1,…,Xn是iid,我们也可以将似然函数写为:

Image for post

Let see two examples that will help you understand.

让我们看两个例子来帮助您理解。

Image for post
Image for post

Maximum Likelihood Estimation :

最大似然估计:

As said before, the maximum likelihood estimation is a method that determines values for the parameters of a model. Those parameters are found such that they maximize the likelihood function. When we find the maximum of the likelihood function, we actually find the parameters which are most likely to have produced the observed data.

如前所述,最大似然估计是一种确定模型参数值的方法。 找到那些参数,以使它们最大化似然函数。 当我们找到似然函数的最大值时,实际上就是找到最有可能产生观测数据的参数。

Often, to make it easy, we actually maximize the log of the likelihood function. We call it the log-likelihood function.

通常,为了简化起见,我们实际上使似然函数的对数最大化。 我们称其为对数似然函数。

Indeed, the log function transforms the multiplication to a sum. Moreover, the maximum of the log function is also the maximum of the original function.

实际上,对数函数将乘法转换为和。 此外,对数函数的最大值也是原始函数的最大值。

You can use different methods to maximize this function. Usually, when it’s possible, we just derivate it and compare it to 0.

您可以使用不同的方法来最大化此功能。 通常,只要有可能,我们就将其推导并将其与0进行比较。

Image for post
Image for post
Image for post
Image for post

Visualization :

可视化

Let’s see how the MLE works with normal distribution.

让我们看看MLE如何与正态分布一起工作。

Image for post
Thank’s to William Fleshman — Medium for this great GIF
感谢 威廉·弗莱什曼 ( William Fleshman) -这个伟大的GIF媒介

You can find a very good explanation of it in this video:

您可以在此视频中找到很好的解释:

Conclusion :

结论:

Maximum Likelihood Estimation is very useful to find optimal parameters of a Machine Learning model.

最大似然估计对于查找机器学习模型的最佳参数非常有用。

If you have further questions, you can contact me on LinkedIn (click here).

如果您还有其他问题,可以通过LinkedIn与我联系( 单击此处 )。

翻译自: https://medium.com/@lilouset/maximum-likelihood-explanation-with-examples-7bdf960efacd

最大似然 极大似然

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值