mean.rv: Distribution of the Arithmetic Mean of a Random Vector

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/mean_rv.R

Description

mean.rv computes the distribution of the arithmetic average of its argument rv object.

Usage

1
2
## S3 method for class 'rv'
mean(x, ...)

Arguments

x

an object

...

further arguments passed to or from other methods

Details

mean gives the distribution (that is, a random variable object) of the statistic sum x_i/n (sum(x)/length(x)).

In particular, mean(x) of a random vector x of length one is equal to x as it would be in the case of numerical x.

To find the expectation of a random vector x (that is, the individual means of random components in a vector), use rvmean(x) (same as E(x) and Pr(x)).

Author(s)

Jouni Kerman jouni@kerman.com

References

Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.

See also vignette("rv").

See Also

rvmean

Examples

1
2
3
4
  y <- rvnorm(10, mean=0, sd=1)
  m1 <- mean(y)
  m2 <- rvnorm(1, mean=0, sd=1/sqrt(10))
  print(c(m1, m2)) # should have the same distribution

jsta/rv documentation built on Feb. 12, 2022, 5:13 p.m.