ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.144.227.146 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ |
Upload File : |
<?php namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations; class HyperGeometric { /** * HYPGEOMDIST. * * Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of * sample successes, given the sample size, population successes, and population size. * * @param mixed $sampleSuccesses Integer number of successes in the sample * @param mixed $sampleNumber Integer size of the sample * @param mixed $populationSuccesses Integer number of successes in the population * @param mixed $populationNumber Integer population size * * @return float|string */ public static function distribution($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber) { $sampleSuccesses = Functions::flattenSingleValue($sampleSuccesses); $sampleNumber = Functions::flattenSingleValue($sampleNumber); $populationSuccesses = Functions::flattenSingleValue($populationSuccesses); $populationNumber = Functions::flattenSingleValue($populationNumber); try { $sampleSuccesses = DistributionValidations::validateInt($sampleSuccesses); $sampleNumber = DistributionValidations::validateInt($sampleNumber); $populationSuccesses = DistributionValidations::validateInt($populationSuccesses); $populationNumber = DistributionValidations::validateInt($populationNumber); } catch (Exception $e) { return $e->getMessage(); } if (($sampleSuccesses < 0) || ($sampleSuccesses > $sampleNumber) || ($sampleSuccesses > $populationSuccesses)) { return Functions::NAN(); } if (($sampleNumber <= 0) || ($sampleNumber > $populationNumber)) { return Functions::NAN(); } if (($populationSuccesses <= 0) || ($populationSuccesses > $populationNumber)) { return Functions::NAN(); } $successesPopulationAndSample = (float) Combinations::withoutRepetition($populationSuccesses, $sampleSuccesses); $numbersPopulationAndSample = (float) Combinations::withoutRepetition($populationNumber, $sampleNumber); $adjustedPopulationAndSample = (float) Combinations::withoutRepetition( $populationNumber - $populationSuccesses, $sampleNumber - $sampleSuccesses ); return $successesPopulationAndSample * $adjustedPopulationAndSample / $numbersPopulationAndSample; } }