Repository navigation
Local FDR, estimation of null Z-score distribution - #2297
Conversation
|
I will look at it in more detail most likely after next week (spring break for elementary schools here). two questions after a quick browse Is there anything specific that exploits z-values, or is it just using the normal instead of the uniform distribution as reference distribution? (p-values as a integral transform) Would it be better to convert |
There was a problem hiding this comment.
same as
np.vander(zbins, deg+?) or vectorized zbins[:, None]**np.arange(deg + 1)
?
|
Regarding p-values versus z-scores: the local FDR is basically the ratio of the height of the density of null z-scores to the height of the density of all z-scores. So it is not natural to reformulate it in terms of p-values. The density ratio would be different after transforming to p-values. Another difference is that positive and negative effects are treated separately in local FDR. |
|
I'm looking at PRs that should be merged. Is this ready for review and merge or are there still changes? Is this implementation ok relative to the one in nipy? |
|
The model and parameters are the same between our approach and the Nipy approach. But the estimators seem to be different. I am following Efron's approach here, which uses maximum likelihood (restricted to the central part of the distribution). This MLE does not have a closed form, that is why I need to call |
There was a problem hiding this comment.
section header should be Attributes
|
A few smaller comments, otherwise looks good to merge to me. I guess we can expand this and share code with similar tasks in future without backwards compatibility problems in the API. The API looks pretty straight forward, but several methods remind me of other things that we don't have yet. One question on usage: Is there a recommendation for how to z-score the data before calling these functions. e.g. do we need to use a robust variance estimator? |
|
I think I have accounted for most of these comments. I changed the minimizer to only use the free parameters. Regarding usage, I think people usually use this approach with a moment-based Z-score. I suppose it could be used with a robust scale estimate but I've never tried that. |
There was a problem hiding this comment.
I think we should also here switch to an explicit null (0 could just be a numbering, in general)
mean_null sd_null prob_null ?
or maybe without 0 and without null since the name already says it's the Null distribution, and we don't need to add any _null to pdf for consistency.
|
I finished reading the Efron and the Schwartzman et al (NeuroImage) articles. I still think EmpiricalNull doesn't sound parametric enough, and I think the trailing 0 are not needed in it's attributes. (EstimatedNull would also sound ok) The only other issue I have is whether we can extend this to other distributions. Currently names like |
|
@kshedden I just saw by chance that you updated this a few days ago. I'll check and merge within a few days, or tonight. |
|
Sure, will do. Kerby On Thu, Dec 3, 2015 at 6:21 PM, Josef Perktold [email protected]
|
ENH: Local FDR, estimation of null Z-score distribution
|
merged, Sorry for the delay. |
This PR implements two techniques from the paper:
B Efron (2008). Microarrays, Empirical Bayes, and the Two-Groups Model. Statistical Science 23:1, 1-22.
The
local_fdrfunction calculates local False Discovery rates from Z-scores. We could possibly implement this as an option withinmultipletests, but it's nice to have the option to operate on z-scores rather than p-values, whichmutlipletestsdoes not allow.The
empirical_nullfunction estimates a non-standard normal distribution based on a set of Z-scores that consists of an unknown mixture of null and non-null hypotheses. It uses a likelihood-based version of the "central matching" idea.See also #1371.