matlab:二维数据分箱
我需要一些帮助来计算累积分布。
假设我有这样的数据:
data = abs(randn(1000,1));
我必须计算概率累积分布并将其分箱以减少点数。我这样做(让 bin = 50):
[n, x] = hist(data, 50);
y = cumsum(n);
y = y./max(y);
问题是,现在我有很多接近 y=1 的点,但只有少数接近零。我想要点的均匀分布(y 轴上的附加分箱?)。我希望你明白我的意思:) 我怎样才能做到这一点? 谢谢!
I need some help with calculating cumulative distribution.
lets say I have data like that:
data = abs(randn(1000,1));
I have to calculate probability cumulative distribution and bin it to reduce amount of points. I am doing it like that (lets take bin = 50):
[n, x] = hist(data, 50);
y = cumsum(n);
y = y./max(y);
The problem is, that now I have a lot of points close to y=1, but only few close to zero. I'd like to have kind of equal distribution distribution of points (additional binning on y axis?). I hope you know what I mean :) How I can do that?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,这实际上意味着在您的
data
向量中,许多点都接近 0。通常的过程是使用 log:log2 或 log10 来转换数据,具体取决于数据的性质。尝试
您也可以尝试用
sqrt
代替log
或其他函数。更新
在发表评论后查看问题,我认为您想使用如下内容:
So, it actually means that in your
data
vector many points are close to 0. The usual procedure is to transform the data using log: log2 or log10, depending on the nature of the data.Try
You can also try
sqrt
instead oflog
or other functions.UPDATE
Reviewing the question after your comment I think you want to use something like this: