disc.exp: Expected Value of a Discrete Random Variable

Description Usage Arguments Value Examples

View source: R/ch5-fn.R

Description

Expected Value of a Discrete Random Variable

Usage

1
2
disc.exp(xv, xf, mt, dig = 3, prt = TRUE, plot = FALSE,
  pos = "topright")

Arguments

xv

Vector of random variable values

xf

Vector of probability (or frequency) distribution

mt

graph title

dig

Number of digits below the decimal point (default=3)

prt

Print detailed output? Default: FALSE

plot

Plot the PDF? Default: FALSE

pos

Legend location, Default: 'topright'

Value

list(Ex=expected value, Dx=standard deviation, Vx=variance)

Examples

1
2
3
p = c(1, 3, 3, 1)
x = c(-3, -1, 1, 3)*100
disc.exp(x, p)

tjssu/Rstat documentation built on Aug. 8, 2020, 12:38 p.m.