pmf: Create pmf object

View source: R/pmf_calcs.R

pmfR Documentation

Create pmf object

Description

Create pmf object

Usage

pmf(x, p)

Arguments

x

either a sample of values from which to estimate a PMF based on frequency if p is missing, or unique x values with probability p

the

probabilty of each unqiue value of x occuring

Value

data.frame of class pmf

Examples

samp <- sample(c(-1000, 100, 800), size = 1e4, replace = TRUE)
pmf(samp)
pmf(x = c(-1000, 100, 800), p = c(0.25, 0.5, 0.25))

WhiteJP/jpw documentation built on April 17, 2025, 5:47 a.m.