类似于 Feller 的抛硬币图
来自 Feller (1950) 概率论简介:
长度为 n 的路径可以解释为由 n 次连续抛硬币组成的理想实验的记录。如果 +1 代表正面,那么 Sk 等于第 k 次试验结束时正面与反面的累积数量之差(正或负)。经典的描述介绍了虚构的赌徒彼得,他在每次尝试中赢或输一个单位金额。序列 S1、S2、...Sn 代表 Peter 的连续累积增益。
我有一列来自真实的抛硬币实验的 1 和 0,并且想构建一个类似于费勒呈现的图表(如上所述)。 cumsum 和plotCsum 似乎并不完全是我想要的。
From Feller (1950) An Introduction to Probability Theory:
A path of length n can be interpreted as the record of an ideal experiment consisting of n successive tosses of a coin. If +1 stands for heads, then Sk equals the (positive or negative) excess of the accumulated number of heads over tails at the conclusion of the kth trial. The classical description introduces the fictitious gambler Peter who at each trial wins or loses a unit amount. The sequence S1, S2,...Sn then represents Peter's successive cumulative gains.
I have a column of ones and zeros from a real coin toss experiment and would like to construct a graph similar to that Feller presents (as described above). cumsum and plotCsum don't seem to be quite what I am looking for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许如果你将 0 转换成 -1 就可以了
Maybe it works if you convert the 0 into -1