The stats_dens_pmf_hypergeometric is not correct...substitute the function in statistic.c with the following one:
PHP_FUNCTION(stats_dens_pmf_hypergeometric)
{
double y;
double X;
double M;
double K;
double N;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &X, &M, &K, &N) == FAILURE) {
RETURN_FALSE;
}
if ((int)(X + M) >= (int)(K + N)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "possible division by zero - X+M >= K+N");
/* RETURN_FALSE; */
}
y = (binom(K, X) * binom(M-K, N-X))/binom(M, N);
//y = binom(n1, N1) * binom (n2, N2)/binom(n1 + n2, N1 + N2);
RETURN_DOUBLE(y);
}
stats_dens_pmf_hypergeometric
(PECL stats >= 1.0.0)
stats_dens_pmf_hypergeometric —
Description
float stats_dens_pmf_hypergeometric
( float $n1
, float $n2
, float $N1
, float $N2
)
Warning
This function is currently not documented; only its argument list is available.
Parameters
- n1
-
- n2
-
- N1
-
- N2
-
Return Values
stats_dens_pmf_hypergeometric
belcastro at tigem dot it
09-Apr-2009 05:26
09-Apr-2009 05:26
