Learn R Programming

rinform (version 1.0.2)

approximate: Approximate

Description

Approximate a given probability distribution probs to a given tolerance tol.

Usage

approximate(probs, tol)

Arguments

probs

Numeric vector giving a probability distribution.

tol

Numeric giving the tolerance.

Value

Dist object approximate from probs with tolerance tol.

Examples

Run this code
# NOT RUN {
# Approximate distributions with different tolerance
p <- c(0.12345, 0.23456, 1.0 - 0.12345 - 0.23456)
d <- approximate(p, tol = 0.1)
dump(d)

d <- approximate(p, tol = 0.001)
dump(d)

d <- approximate(p, tol = 0.00001)
dump(d)

# }

Run the code above in your browser using DataLab