means: Successive means

View source: R/means.r

meansR Documentation

Successive means

Description

Successive means

Usage

means(x)

Arguments

x

a numeric vector

Details

This function computes successive means of the values in x.

Value

A vector of same length than x

Examples

# 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")

HervePerdry/M1SP documentation built on Dec. 16, 2024, 8:19 p.m.