bundles / scipy 1.17.1 / scipy / stats / _stats_py / PearsonRResult / confidence_interval
function
scipy.stats._stats_py:PearsonRResult.confidence_interval
source: /scipy/stats/_stats_py.py :4304
Signature
def confidence_interval ( self , confidence_level = 0.95 , method = None ) Summary
The confidence interval for the correlation coefficient.
Extended Summary
Compute the confidence interval for the correlation coefficient statistic with the given confidence level.
If method is not provided, The confidence interval is computed using the Fisher transformation F(r) = arctanh(r) [1]. When the sample pairs are drawn from a bivariate normal distribution, F(r) approximately follows a normal distribution with standard error 1/sqrt(n - 3), where n is the length of the original samples along the calculation axis. When n <= 3, this approximation does not yield a finite, real standard error, so we define the confidence interval to be -1 to 1.
If method is an instance of BootstrapMethod, the confidence interval is computed using scipy.stats.bootstrap with the provided configuration options and other appropriate settings. In some cases, confidence limits may be NaN due to a degenerate resample, and this is typical for very small samples (~6 observations).
Parameters
confidence_level: floatThe confidence level for the calculation of the correlation coefficient confidence interval. Default is 0.95.
method: BootstrapMethod, optionalDefines the method used to compute the confidence interval. See method description for details.
Returns
ci: namedtupleThe confidence interval is returned in a
namedtuplewith fieldslowandhigh.
Aliases
-
scipy.stats._stats_py.PearsonRResult.confidence_interval