ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
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" |
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\).
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.
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.
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.
character(*, SK), parameter pm_mathFisher::MODULE_NAME = "@pm_mathFisher" |
Definition at line 89 of file pm_mathFisher.F90.