hyper_param {exams.forge}R Documentation

Parameters for Hypergeometric Distributions

Description

Generates a data frame with potential values for m, n and k. If hyper2 is FALSE then the parametrization of stats::dhyper() is used, otherwise n+m, m and k is used and transformed to m, n and k. In accordance with specific conditions it holds that:

The parameters norm, pois and binom can take on the values NA, TRUE, FALSE, or be defined as a function of the format: ⁠function(m, n, k)⁠. These values determine which ⁠(m, n, k)⁠ combinations are eligible:

Please be aware that there is no guarantee that the resulting data frame will include a valid solution.

Usage

hyper_param(
  m,
  n,
  k,
  mean = NA,
  sd = NA,
  norm = NA,
  pois = NA,
  binom = NA,
  tol = 1e-06,
  hyper2 = FALSE
)

Arguments

m

numeric: the number of white balls in the urn

n

numeric: the number of black balls in the urn

k

numeric: the number of balls drawn from the urn, hence must be in 0, 1, ..., m+n

mean

integer or numeric: number of digits the mean should have

sd

integer or numeric: number of digits the standard deviation should have

norm

logical or function: normal approximation possible

pois

logical or function: poisson approximation possible

binom

logical or function: binomial approximation possible

tol

numeric: the tolerance for numerical comparison (default: '1e-6)

hyper2

logical: should the standard R parametrization ⁠(m, n, k)⁠ be used or ⁠(n+m, m, k)⁠?

Value

A data frame with possible the choices of n , p, mean and sd.

Examples

hyper_param(7:14, 1:13, 3:10, norm=FALSE, pois=FALSE, binom=FALSE, hyper2=TRUE)

[Package exams.forge version 1.0.10 Index]