在 Excel 中计算概率并绘制 cdf
现在我有一列数据是这样的:
0.000000
0.000000
0.000000
0.000000
0.024995
0.024996
0.024996
0.024997
0.024997
0.024997
0.024997
0.025004
0.025010
0.025011
0.025996
0.025996
0.025996
首先我想计算这些数据的累积概率,并将它们显示在B列中,然后根据A列和B列,绘制CDF图。
有人知道我应该使用什么公式吗?
Now I have a column of data like this:
0.000000
0.000000
0.000000
0.000000
0.024995
0.024996
0.024996
0.024997
0.024997
0.024997
0.024997
0.025004
0.025010
0.025011
0.025996
0.025996
0.025996
First I want to calculate the cumulative probability of these data, and show them in column B, then based on Column A and B, to draw a CDF graph.
Anyone one knows what formula should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在第一个条目(在我的示例中为 B1)左侧的单元格中,输入以下内容:
然后将其填充到该列中。
要创建 CDF 图表,请使用 x 值
=A1:A17
和 y 值=B1:B17
创建散点图(带有插值线)。注:
由于数据开头有多个重复值,因此您可能只想绘制 x 值
=A4:A17
和 y 值=B4:B17
。这实际上取决于变量的性质。如果明确最小可能值为零,则可以这样做。In the cell to the left of the first entry (B1 in my example), enter the following:
Then fill this down the column.
To create the CDF chart, create a scatter plot (with interpolated lines) with x-values
=A1:A17
and y-values=B1:B17
.Note:
Since you have several duplicate values at the start of your data, you may want to plot only x-value
=A4:A17
and y-values=B4:B17
. This is really depends on the nature of your variable. You can do it this way if it's clear the minimum possible value is zero.我假设您提供的数字是概率密度函数 (PDF) 并且您想要根据该 PDF 计算累积分布函数 (CDF)。在这种情况下...
B1 就简单地是
=A1
。 B2=B1+A2
、B3=B2+A3
等。然后突出显示 B 列中的数据,单击“插入”选项卡,然后选择折线图。或者,您可以在 B1=SUM(A$1:A1)
中执行并填写。顺便说一句,CDF 通常在 0 到 1 之间单调递增。您的 PDF 不会生成一直到 1 的 CDF。因此,如果这是您的目标,那么您要么没有列出所有数据在 PDF 中,或者您需要稍微不同地缩放内容。您可以将 A 列中的每个元素除以这些元素的总和,总和将为 1。不过,如果您想要的是正确定义的 CDF,则可以直接通过设置 B1
=SUM(A$1 :A1)/SUM(A:A)
并再次填写。I am assuming the numbers you are providing are a Probability Density Function (PDF) and that you want to compute a Cumulative Distribution Function (CDF) from that PDF. In that case...
B1 would simply be
=A1
. B2=B1+A2
, B3=B2+A3
, etc. Then highlight the data in column B, click the "Insert" Tab, and select a line graph. Alternatively you could do in B1=SUM(A$1:A1)
and fill down.BTW, CDF's are usually monotonically increasing between 0 and 1. Your PDF doesn't generate a CDF which goes all the way to 1. So, if this is what you're aiming for, you're either not listing all of the data in your PDF, or you need to scale things a little differently. You could divide each element in column A by the sum of those elements, and that will sum to 1. If all you want is a properly defined CDF, though, you can do it directly by setting B1
=SUM(A$1:A1)/SUM(A:A)
and again fill down.