means | R Documentation |
Successive means
means(x)
x |
a numeric vector |
This function computes successive means
of the values in x
.
A vector of same length than x
# Illustration of the Law of large numbers
# using the normal distribution
set.seed(1)
x <- rnorm(5e3)
plot(means(x), type = "l", ylim = c(-.5,.5))
abline(h = 0, col = "red")
# Using t(1) (expected value is undefined)
x <- rt(5e3, df = 1)
plot(means(x), type = "l")
abline(h = 0, col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.