Learn R Programming

Rmpfr (version 0.6-0)

mpfr-distr-etc: Distribution Functions etc (MPFR)

Description

For some R standard (probability) density, distribution or quantile functions, we provide MPFR versions.

Usage

dpois (x, lambda, log = FALSE) dbinom(x, size, prob, log = FALSE) dnorm (x, mean = 0, sd = 1, log = FALSE)
pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

x,q, lambda, size,prob, mean,sd
numeric or mpfr vectors. All of these are “recycled” to the length of the longest one.
log, log.p, lower.tail
logical, see pnorm, dpois, etc.

Value

A vector of the same length as the longest of x,q, ..., of class mpfr with the high accuracy results of the corresponding standard R function.

Details

pnorm() is based on erf() and erfc() which have direct MPFR counter parts and are both reparametrizations of pnorm, erf(x) = 2*pnorm(sqrt(2)*x) and erfc(x) = 2* pnorm(sqrt(2)*x, lower=FALSE).

See Also

pnorm, dbinom, dpois in standard package stats.

pbetaI(x, a,b) is a mpfr version of pbeta only for integer a and b.

Examples

Run this code
x <- 1400+ 0:10
print(dpois(x, 1000), digits =18) ## standard R's double precision
dpois(mpfr(x, 120), 1000)## more accuracy for the same

Run the code above in your browser using DataLab