EX: Expected Value and Variance

View source: R/StatsAndCIs.r

EXR Documentation

Expected Value and Variance

Description

Expected Value and Variance for the distribution of a discrete random variable. (For didactical purposes..)

Usage

EX(x, p)
VarX(x, p)

Arguments

x

the values of the random variable

p

the probabilities of the values

Value

numeric value

Author(s)

Andri Signorell <andri@signorell.net>

Examples

EX(x=c(1:3), p=c(0.2, 0.5, 0.3))
VarX(x=c(1:3), p=c(0.2, 0.5, 0.3))

AndriSignorell/DescTools documentation built on April 13, 2024, 6:33 a.m.