Description Usage Arguments Value Examples
Generic function to make accumulate observations from a series. If an invalid distribution is provided, no events will be observed. If an invalid event is provided, then the number of valid events to that point will be added to the distribution and a warning will be raised.
1 | accumulate(d, events)
|
d |
Dist object representing the distribution. |
events |
Numeric representing the observed events. |
Dist giving the updated distribution.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Accumulate observations to a distribution from collected events
d <- Dist(c(5, 5))
dump(d)
xs <- sample(0:1, 10, TRUE)
d <- accumulate(d, xs)
dump(d)
xs <- matrix(0, 10, 3)
xs[, 1] <- sample(0:1, 10, TRUE)
xs[, 2] <- sample(2:3, 10, TRUE)
xs[, 3] <- sample(0:2, 10, TRUE)
d <- accumulate(d, xs)
dump(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.