Skip to content
Prev 153693 / 398500 Next

Simple estimate of a probability by simulation

On Wed, Aug 20, 2008 at 7:56 AM, Alberto Monteiro
<albmont at centroin.com.br> wrote:
Which can be even more succinctly expressed as
mean(delta > 0)

It's also often informative to plot the running estimate so you have
some idea whether or not you've done enough samples:

plot(cumsum(delta > 0) / seq_along(delta), type="l")

Hadley