为什么Excel和Matlab给出不同的结果? [英] Why do Excel and Matlab give different results?

查看:583
本文介绍了为什么Excel和Matlab给出不同的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有352k值,我想从所有值中查找最频繁的值. 数字四舍五入到小数点后两位. 我在Matlab中使用命令mode(a),在Excel中使用命令mode(B1:B352000),但是结果有所不同.

I have 352k values and I want to find the most frequent values from all of them. Numbers are rounded to two decimal places. I use the commands mode(a) in Matlab and mode(B1:B352000) in Excel, but the results are different.

我在哪里犯了错误,或者我可以相信哪个?

Where did I make a mistake, or which one can I believe?

谢谢

//edit:当我使用诸如average之类的其他命令时,结果是相同的.

//edit: When I use other commands like average, the results are the same.

推荐答案

来自 Wikipedia :

对于连续分布的样本,例如[0.935 ...,1.211 ...,2.430 ...,3.668 ...,3.874 ...],该概念无法以其原始形式使用,因为没有两个值将完全相同,因此每个值将仅出现一次.为了估计基本分布的模式,通常的做法是通过将频率值分配给相等距离的间隔来离散化数据,就像制作直方图一样,将这些值有效地替换为分配给它们的间隔的中点.然后,该模式就是直方图达到峰值的值.对于中小样本,如果选择的太窄或太宽,此过程的结果对间隔宽度的选择都很敏感

For a sample from a continuous distribution, such as [0.935..., 1.211..., 2.430..., 3.668..., 3.874...], the concept is unusable in its raw form, since no two values will be exactly the same, so each value will occur precisely once. In order to estimate the mode of the underlying distribution, the usual practice is to discretize the data by assigning frequency values to intervals of equal distance, as for making a histogram, effectively replacing the values by the midpoints of the intervals they are assigned to. The mode is then the value where the histogram reaches its peak. For small or middle-sized samples the outcome of this procedure is sensitive to the choice of interval width if chosen too narrow or too wide

因此,两个程序可能使用不同的间隔大小,从而产生不同的答案.您可以相信两者(我想),但是知道返回的值是对不均衡分布的真实模式的近似值.

Thus, it is likely that the two programs use a different interval size, yielding different answers. You can believe both (I presume) but knowing that the value returned is an approximation to the true mode of the undelying distribution.

这篇关于为什么Excel和Matlab给出不同的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆