Learn R Programming

scidb (version 1.1-2)

hypergeometric-methods: Hypergeometric functions in Package scidb

Description

Distribution and quantile functions for the hypergeometric distribution.

Usage

## S3 method for class 'scidb_or_scidbdf':
phyper(x, q, m, n, k, new="p",`eval`=FALSE)
## S3 method for class 'scidb_or_scidbdf':
qhyper(x, p, m, n, k, new="q",`eval`=FALSE)

Arguments

x
A scidb or scidbdf object.
q
A SciDB attribute name (character) or numeric constant representing the quantile, for example the number of white balls drawn without replacement from an urn which contains both black and white balls.
m
A scidb attribute name or numeric constant representing the number of white balls in the urn.
n
A scidb attribute name or numeric constant representing the number of black balls in the urn.
k
A scidb attribute name or numeric constant representing the number of balls drawn from the urn.
p
A scidb attribute name or numeric constant representing probability between 0 and 1.
new
A character name for the result attribute.
eval
(Optional) If true, execute the query. Otherwise defer evaluation.

Value

  • A scidb, scidbdf reference object.

Details

The hypergeometric distribution is used for sampling without replacement. The density of this distribution with parameters m, n and k is given by

$$p(x) = \left. {m \choose x}{n \choose k-x} \right/ {m+n \choose k}$$

for $x = 0, \ldots, k$.

The quantile is defined as the smallest value $x$ such that $F(x) \ge p$, where $F$ is the distribution function.

phyper gives the distribution function, qhyper gives the quantile function.

Examples

Run this code
# Write me

Run the code above in your browser using DataLab