kerfdr {kerfdr} | R Documentation |
this function computes local fdr values by using a classical two-components mixture model with a semi-parametric density estimation. The code is freely inspired from the density
function.
kerfdr(pv, x = NULL, f0 = NULL, localfdr = NULL, pi1 = "storey", lambda = 0.5, bw = "sj-dpi", adjust = 1.0, trans = c("probit", "log", "none"), kernel = c("gaussian","epanechnikov", "rectangular", "triangular", "biweight","cosine", "optcosine"), pvMin = 0.0, pvMax = 1.0, verbose = FALSE, plot = TRUE)
pv |
a vector of p-values |
trans |
the transformation to apply on pv to produce x |
x |
transformation of pv, qnorm(pv) with "probit" (by default), log10(pv) with "log" |
f0 |
the sample density under the null hypothesis |
localfdr |
initial values for the local fdr |
pi1 |
proportion of alternative hypothesis (float) or a method (string) to compute it; by default it uses the method introduced by Storey |
bw |
a bandwidth value (float) or a method (string) to determine it |
lambda |
p-value threshold for the Storey's calculation of pi1 ; 0.5 by default |
adjust |
the bandwidth used is adjust*bw ; 1.0 by default |
kernel |
the kernel to use (string); "gaussian" by default |
plot |
if TRUE, it produces a graphical display of the local fdr estimations |
pvMin |
the p-value under which to take a truncature in consideration; 0.0 by default |
pvMax |
the p-value upper which to take a truncature in consideration; 1.0 by default |
verbose |
if TRUE, it activates the verbose mode; FALSE by default |
kerfdr returns a list including pv
, x
, pi1
, pi0
, bw
and the following components:
localfdr |
local fdr estimations |
f0 |
the estimated sample density under the null hypothesis |
f1 |
the estimated sample density under the alternative hypothesis |
f |
the resulting mixed density |
Mickael Guedj, Gregory Nuel
http://stat.genopole.cnrs.fr/sg/software/kerfdr
# p-values under the null hypothesis: pv0 = runif(10000) # p-values under the alternative hypothesis: pv1 = runif(500, 0,0.05) # local fdr estimations: myPv = c(pv0, pv1) kerfdr(pv = myPv)