ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_mathFisher Module Reference

This module contains procedures and generic interfaces for evaluating the Fisher transformation and its inverse.
More...

Data Types

interface  getFisher
 Generate and return the Fisher transformation of the input Fisher z value.
More...
 
interface  getFisherInv
 Generate and return the inverse Fisher transformation of the input Fisher z value.
More...
 

Variables

character(*, SK), parameter MODULE_NAME = "@pm_mathFisher"
 

Detailed Description

This module contains procedures and generic interfaces for evaluating the Fisher transformation and its inverse.

The Fisher transformation (or Fisher z-transformation) of a Pearson correlation coefficient is its inverse hyperbolic tangent (atanh).
When the sample correlation coefficient \(r\) is near \(+1\) or \(-1\), its distribution is highly skewed, which makes it difficult to estimate confidence intervals and apply tests of significance for the population correlation coefficient \(\rho\).
The Fisher transformation solves this problem by yielding a variable whose distribution is approximately normally distributed, with a variance that is stable over different values of \(r\).

Definition

Given a set of \(N\) bivariate sample pairs \((X_i, Y_i), i = 1, ..., N\), the sample correlation coefficient \(r\) is given by,

\begin{equation} r = {\frac{\up{cov}(X, Y)}{\sigma_{X}\sigma_{Y}}} = \frac{ \sum_{i = 1}^{N}(X_{i} - {\bar{X}})(Y_{i} - {\bar {Y}}) }{ {\sqrt{\sum_{i = 1}^{N}(X_{i} - {\bar{X}})^{2}}}{\sqrt{\sum_{i=1}^{N}(Y_{i} - {\bar {Y}})^{2}}} } \end{equation}

Here \(\up{cov}(X, Y)\) stands for the covariance between the variables \(X\) and \(Y\) and \(\sigma\) stands for the standard deviation of the respective variable. The Fisher z-transformation of \(r\) is defined as,

\begin{equation} z = {1 \over 2} \ln \left( {1 + r \over 1 - r} \right) = \up{atanh}(r) ~, \end{equation}

where \(\ln\) is the natural logarithm function and atanh is the inverse hyperbolic tangent function.

If \((X, Y)\) has a bivariate normal distribution with correlation \(\rho\) and the pairs \((X_i, Y_i)\) are independent and identically distributed, then \(z\) is approximately normally distributed with mean,

\begin{equation} {1 \over 2} \ln \left({{1 + \rho} \over {1 - \rho}} \right) ~, \end{equation}

and standard deviation

\begin{equation} 1 \over {\sqrt {N - 3}} ~, \end{equation}

where \(N\) is the sample size, and \(\rho\) is the true correlation coefficient.

This transformation and its inverse,

\begin{equation} r = {\frac{\exp(2z) - 1}{\exp(2z) + 1}} = \up{tanh}(z) ~, \end{equation}

can be used to construct a large-sample confidence interval for \(r\) using standard normal theory and derivations.

Note
The Fisher transformation can be applied to any doubly-bounded variable to make it doubly unbounded.
A prime example of this is the binary mixture fraction.
See also
pm_sampleCor
Test:
test_pm_mathFisher


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, April 23, 2017, 1:36 AM, Institute for Computational Engineering and Sciences (ICES), University of Texas at Austin

Variable Documentation

◆ MODULE_NAME

character(*, SK), parameter pm_mathFisher::MODULE_NAME = "@pm_mathFisher"

Definition at line 89 of file pm_mathFisher.F90.