概率分布值图
我有
求和为 1
概率值: 0.06,0.06,0.1,0.08,0.12,0.16,0.14,0.14,0.08,0.02,0.04
,将随机变量可能取其值的相应区间 上面列表中的相应概率:
126,162,233,304,375,446,517,588,659,730,801,839
如何绘制概率分布?
在x轴上,间隔值,间隔直方图与概率值之间?
谢谢。
I have
probability values: 0.06,0.06,0.1,0.08,0.12,0.16,0.14,0.14,0.08,0.02,0.04
,summing up to 1
the corresponding intervals where a stochastic variable may take its value with the corresponding probability from the above list:
126,162,233,304,375,446,517,588,659,730,801,839
How can I plot the probability distribution?
On the x axis, the interval values, between the intervals histogram with the probability value?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样
快速回答 ? (包含
rect
后,您可能不需要lines
调用,并且可以将其更改为plot(x,p,type="n")<像往常一样,我会推荐
par(bty="l",lty=1)
作为我首选的图形默认值...)(说明:“s”和“S”是两个不同的阶梯类型(请参阅
?plot
中的详细信息): I使用它们来获得分布的左边界和右边界。)编辑:在您的评论中,您说“(它)看起来不像直方图”。不太清楚你想要什么。我在上面的例子中添加了矩形——也许就这样了?或者你也可以这样做,
但是正确设置 x 轴标签是一件很痛苦的事情。
How about
for a quick answer? (With the
rect
included you might not need thelines
call and might be able to change it toplot(x,p,type="n")
. As usual I would recommendpar(bty="l",lty=1)
for my preferred graphical defaults ...)(Explanation: "s" and "S" are two different stair-step types (see Details in
?plot
): I used them both to get both the left and right boundaries of the distribution.)edit: In your comments you say "(it) doesn't look like a histogram". It's not quite clear what you want. I added rectangles in the example above -- maybe that does it? Or you could do
but getting the x-axis labels right is a pain.