approximate: Approximate

Description Usage Arguments Value Examples

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)

ELIFE-ASU/rinform documentation built on May 26, 2019, 7:25 a.m.