approximate: Approximate

Description Usage Arguments Value Examples

View source: R/dist.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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)

rinform documentation built on April 1, 2018, 12:12 p.m.