Inheritance diagram for nipy.algorithms.statistics.empirical_pvalue:
Routines to get corrected p-values estimates, based on the observations.
It implements 3 approaches:
Benjamini-Hochberg FDR: http://en.wikipedia.org/wiki/False_discovery_rate
a class that fits a Gaussian model to the central part of an histogram, following [1]
[1] Schwartzman A, Dougherty RF, Lee J, Ghahremani D, Taylor JE. Empirical null and false discovery rate analysis in neuroimaging. Neuroimage. 2009 Jan 1;44(1):71-82. PubMed PMID: 18547821. DOI: 10.1016/j.neuroimage.2008.04.182
This is typically necessary to estimate a FDR when one is not certain that the data behaves as a standard normal under H_0.
a model based on Gaussian mixture modelling ‘a la Oxford’
Author : Bertrand Thirion, Yaroslav Halchenko, 2008-2012
Bases: object
Class to compute the empirical null normal fit to the data.
The data which is used to estimate the FDR, assuming a Gaussian null from Schwartzmann et al., NeuroImage 44 (2009) 71–82
Methods
fdr(theta) | Given a threshold theta, find the estimated FDR |
fdrcurve() | Returns the FDR associated with any point of self.x |
learn([left, right]) | Estimate the proportion, mean and variance of a Gaussian distribution |
plot([efp, alpha, bar, mpaxes]) | Plot the histogram of x |
threshold([alpha, verbose]) | Compute the threshold corresponding to an alpha-level FDR for x |
uncorrected_threshold([alpha, verbose]) | Compute the threshold corresponding to a specificity alpha for x |
Initialize an empirical null normal object.
Parameters: | x : 1D ndarray
|
---|
Given a threshold theta, find the estimated FDR
Parameters: | theta : float or array of shape (n_samples)
|
---|---|
Returns: | afp : value of array of shape(n) |
Returns the FDR associated with any point of self.x
Estimate the proportion, mean and variance of a Gaussian distribution for a fraction of the data
Parameters: | left: float, optional :
right: float, optional :
|
---|
Notes
This method stores the following attributes:
Plot the histogram of x
Parameters: | efp : float, optional
alpha : float, optional
bar=1 : bool, optional mpaxes=None: if not None, handle to an axes where the fig : will be drawn. Avoids creating unnecessarily new figures : |
---|
Compute the threshold corresponding to an alpha-level FDR for x
Parameters: | alpha : float, optional
verbose : boolean, optional
|
---|---|
Returns: | theta: float :
|
Compute the threshold corresponding to a specificity alpha for x
Parameters: | alpha : float, optional
verbose : boolean, optional
|
---|---|
Returns: | theta: float :
|
Basic checks on the p_values array: values should be within [0,1]
Assures also that p_values are at least in 1d array. None of the checks is performed if p_values is None.
Parameters: | p_values : array of shape (n)
|
---|---|
Returns: | p_values : array of shape (n)
|
Returns the FDR associated with each p value
Parameters: | p_values : ndarray of shape (n)
|
---|---|
Returns: | q : array of shape(n)
|
Return FDR threshold given p values
Parameters: | p_values : array of shape (n), optional
alpha : float, optional
|
---|---|
Returns: | critical_p_value: float :
|
Computing some prior probabilities that the voxels of a certain map are in class disactivated, null or active using a gamma-Gaussian mixture
Parameters: | x: array of shape (nvox,) :
test: array of shape (nbitems,), optional :
verbose: 0, 1 or 2, optional :
mpaxes: matplotlib axes, option. :
bias: float, optional :
gaussian_mix: float, optional :
return_estimator: boolean, optional :
|
---|---|
Returns: | bfp: array of shape (nbitems,3) :
estimator: nipy.labs.clustering.ggmixture.GGGM object :
|
Return the FDR associated with each value assuming a Gaussian distribution
Return FDR threshold given normal variates
Given an array x of normal variates, this function returns the critical p-value associated with alpha. x is explicitly assumed to be normal distributed under H_0
Parameters: | x: ndarray :
alpha: float, optional :
|
---|---|
Returns: | threshold : float
|
Returns the smooth histogram corresponding to the density underlying the samples in x
Parameters: | x: array of shape(n_samples), :
bins: array of shape(nbins+1), optional, :
nbins: int, optional, :
normalized: bool, optional :
|
---|---|
Returns: | h: array of shape (nbins) :
bins: array of shape(nbins+1), :
|
Fit the data with a 3-classes Gaussian Mixture Model, i.e. compute some probability that the voxels of a certain map are in class disactivated, null or active
Parameters: | x: array of shape (nvox,1) :
test: array of shape(nbitems,1), optional :
alpha: float, optional :
prior_strength: float, optional :
verbose: int :
fixed_scale: bool, optional :
mpaxes: :
bias: bool :
theta: float :
return_estimator: boolean, optional :
|
---|---|
Returns: | bfp : array of shape (nbitems,3):
estimator : nipy.labs.clustering.GMM object
|
Notes
Our convention is that: