Inheritance diagram for nipy.algorithms.statistics.empirical_pvalue:
This module contains several routines to get corrected p-values estimates, based on the observation of data/p-values. It yields 3 main approaches: - benjamini-Hochberg fdr - a class that fits a gaussian model to the central part of an histogram, following schwartzman et al, 2009. 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
Author : Bertrand Thirion, 2008-2011
Bases: object
Basic class to handle false discovery rate computation Members: x the samples from which the fdr is derived, assumed to be a normal variate
The Benjamini-Horchberg procedure is used
Methods
all_fdr | |
check_pv | |
pth_from_pvals |
Parameters : | pv: array of p-values : |
---|
Returns the fdr associated with each the values
Parameters : | pv : ndarray of shape (n)
|
---|---|
Returns : | q : array of shape(n)
|
Do some basic checks on the pv array: each value should be within [0,1]
Parameters : | pv : array of shape (n)
|
---|---|
Returns : | pv : array of shape (n)
|
Returns the critical p-value associated with an FDR alpha
Parameters : | pv : array of shape (n), optional
alpha : float, optional
|
---|---|
Returns : | pth: float :
|
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 | |
fdrcurve | |
learn | |
plot | |
threshold | |
uncorrected_threshold |
Initialize an empirical null normal object.
Parameters : | x : 1D ndarray
|
---|
Given a threshold theta, find the estimated fdr
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 :
|
---|
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 correponding to an alpha-level fdr for x
Parameters : | alpha : float, optional
verbose : boolean, optional
|
---|
Compute the threshold correponding to a specificity alpha for x
Parameters : | alpha : float, optional
verbose : boolean, optional
|
---|
Computing some prior probabilities that the voxels of a certain map are in class disactivated, null or active uning 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 of all values assuming a Gaussian distribution
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, the input data : alpha: float, optional, the desired significance : |
---|---|
Returns : | th: 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. computing some probability that the voxels of a certain map are in class disactivated, null or active
Parameters : | x array of shape (nvox,1): the map to be analysed : test=None array of shape(nbitems,1): :
alpha = 0.01 the prior weights of the positive and negative classes : prior_strength = 100 the confidence on the prior :
verbose=0 : verbosity mode fixed_scale = False, boolean, variance parameterization :
mpaxes=None: axes handle used to plot the figure in verbose mode :
bias = 0: allows a recaling of the posterior probability :
theta = 0 the threshold used to correct the posterior p-values :
return_estimator: boolean, optional :
|
---|