# tablepress/3.4/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php

TablePress – Tables in WordPress made easy, version 3.4. 73 lines.

- Page: https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php
- Raw: https://pluginprobe.com/plugins/tablepress/3.4/raw/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php
- Modified: 2025-08-26T04:06:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php#L10-L20`.

```php
<?php

namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions;

use TablePress\PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;

class Fisher
{
	use ArrayEnabled;

	/**
	 * FISHER.
	 *
	 * Returns the Fisher transformation at x. This transformation produces a function that
	 *        is normally distributed rather than skewed. Use this function to perform hypothesis
	 *        testing on the correlation coefficient.
	 *
	 * @param mixed $value Float value for which we want the probability
	 *                      Or can be an array of values
	 *
	 * @return array<mixed>|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
	 *            with the same dimensions
	 */
	public static function distribution($value)
	{
		if (is_array($value)) {
			return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
		}

		try {
			$value = DistributionValidations::validateFloat($value);
		} catch (Exception $e) {
			return $e->getMessage();
		}

		if (($value <= -1) || ($value >= 1)) {
			return ExcelError::NAN();
		}

		return 0.5 * log((1 + $value) / (1 - $value));
	}

	/**
	 * FISHERINV.
	 *
	 * Returns the inverse of the Fisher transformation. Use this transformation when
	 *        analyzing correlations between ranges or arrays of data. If y = FISHER(x), then
	 *        FISHERINV(y) = x.
	 *
	 * @param mixed $probability Float probability at which you want to evaluate the distribution
	 *                      Or can be an array of values
	 *
	 * @return array<mixed>|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
	 *            with the same dimensions
	 */
	public static function inverse($probability)
	{
		if (is_array($probability)) {
			return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $probability);
		}

		try {
			$probability = DistributionValidations::validateFloat($probability);
		} catch (Exception $e) {
			return $e->getMessage();
		}

		return (exp(2 * $probability) - 1) / (exp(2 * $probability) + 1);
	}
}

```
