简体   繁体   English

使用Matlab进行一维高斯贝叶斯定性

[英]1D Gaussian Bayes Calssification using matlab

If I have 2 classes and one feature and the feature is normally distributes on both class with different mean and variance, something like that 如果我有2个类别和一个特征,并且该特征通常以不同的均值和方差分布在两个类别上,则类似 在此处输入图片说明

Now I want to find the equation of the discriminant surface and draw it on graph, something like that (this may not be the correct surface, it is just an illustration of what I am seeking for) 现在,我想找到可判别曲面的方程式并将其绘制在图形上,类似的东西(这可能不是正确的曲面,这只是我正在寻找的图示)

在此处输入图片说明

Is there a way to do that with matlab?! 有没有办法用matlab做到这一点?

Obviously, you'd like to classify a point as a point from distribution which has higher density at that point. 显然,您希望将一个点归类为分布中具有更高密度的点。 Thus, the point of separation would be the one where both densities are equal. 因此,分离点将是两个密度相等的点。 In general (multivariate) case your problem is known as Quadratic discriminant analysis . 通常(多变量)情况下,您的问题称为二次判别分析

For QDA one can find a separating curve (in general it's 2-nd order surface, a generalization of parabola) analytically. 对于QDA,可以解析地找到一条分离曲线(通常是2阶曲面,是抛物线的一般化)。 Fortunately, your case is 1-dimensional, so 1D parabola is just a point (or two). 幸运的是,您的情况是一维的,因此一维抛物线只是一个点(或两个点)。

The derivation goes as follows 推导如下

一维案例的QDA推导

The last one is a quadratic equation on x , its solution is the point of separation. 最后一个是x上的二次方程,其解是分离点。 In some cases there are 2 solutions, that means there are 2 points of intersection of densities. 在某些情况下,有2个解,这意味着有2个密度的交点。

What you need to do is to complete my derivation (write our formula(s) for x ), this x is a function of Gaussians' parameters, which you could calculate in any language you like. 您需要做的是完成我的推导(为x写下我们的公式),该x是高斯参数的函数,您可以使用任何喜欢的语言进行计算。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM