Description Details Functions References Examples
The NPMLEmix-package fits nonparametric Gaussian location mixture models for z-scores arising out of several hypotheses, while taking into account any available covariate information. It also provides three important functions: marg1(), marg2() (both based on marginal likelihoods), npmleEM() (based on joint data likelihood) for inference in multiple testing.
(Y_1,X_1),… ,(X_n,Y_n) are i.i.d. samples drawn from the model,
Y|X=x\sim (1-π^*(x))φ(y)+π^*(x)\underbrace{\int_{θ}φ(y-θ)\,dG(θ)}_{φ_1(y)}, \qquad X\sim m_X(\cdot)
where π^*(\cdot) represents the logistic link function, φ(\cdot) is the standard Gaussian density and G(\cdot) is some unknown probability measure on the real line. Usually, π^*(\cdot) is referred to as the signal proportion, φ_1(\cdot) is called the signal density and G(\cdot) is called mixing distribution. The i^{th} local false discovery rate is then defined as
lfdr_i=\frac{(1-π^*(X_i))φ_0(Y_i)}{(1-π^*(X_i))φ_0(Y_i)+π^*(X_i)φ_1(Y_i)}
All the principal functions estimate the unknown parameters - π^*(\cdot) and φ_1(\cdot), and consequently the lfdr_i's. The optimization algorithms use quasi-Newton routines such as the BFGS (Broyden-Fletcher-Goldfarb-Shanno) algorithm and the separable convex optimization routine available in the Rmosek optimization suite. The principal functions accept a vector of z-scores (Y)'s and a covariate matrix X in their list of arguments. Read the documentations for each function to check whether or not to add a column of 1's to X matrix.
The principal functions in the NPMLEmix-package: marg1(), marg2(), npmleEM().
Deb, N., Saha, S., Guntuboyina, A. and Sen, B., 2018. Two-component Mixture Model in the Presence of Covariates. arXiv preprint arXiv:1810.07897.
Scott, J.G., Kelly, R.C., Smith, M.A., Zhou, P. and Kass, R.E., 2015. False discovery rate regression: an application to neural synchrony detection in primary visual cortex. Journal of the American Statistical Association, 110(510), pp.459-471.
Efron, B., 2005. Local false discovery rates.
Koenker, R. and Mizera, I., 2014. Convex optimization in R. Journal of Statistical Software, 60(5), pp.1-23.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | require(NPMLEmix)
### Using the makedata() method ###
x=cbind(runif(1000),runif(1000))
n=1000
atoms=c(-2,0,2)
probs=c(0.48,0.04,0.48)
variances=c(1,16,1)
sx=c(-3,1.5,1.5)
### Generating the data ###
st=makedata(n,x,sx,atoms,probs,variances)
### Output the vector of local false discovery rates ###
st$localfdr
### Using the marg1() method ###
st=makedata(100,cbind(runif(100),runif(100)),c(0,1,-1),c(0,1),c(0.4,0.6),c(1,1))
### Use the default rejection level ###
defm1=marg1(st$y, cbind(1, st$xs))
### Use a new rejection level of 0.1 ###
nodefm1=marg1(st$y, cbind(1, st$xs), level = 0.1)
### Output the vector of prior probabilities ###
defm1$p
### Output the rejection set ###
nodefm1$rejset
### Using the marg2() method ###
st=makedata(100,cbind(runif(100),runif(100)),c(0,1,-1),c(0,1),c(0.4,0.6),c(1,1))
### Use the default rejection level ###
defm2=marg2(st$y, cbind(1, st$xs))
### Use a new rejection level of 0.1 ###
nodefm2=marg2(st$y, cbind(1, st$xs), level = 0.1)
### Output the vector of prior probabilities ###
defm2$p
### Output the rejection set ###
nodefm2$rejset
### Using the npmleEM() method ###
st=makedata(100,cbind(runif(100),runif(100)),c(0,1,-1),c(0,1),c(0.4,0.6),c(1,1))
### Use the default rejection level and default initialization ###
npmle1=npmleEM(st$y, cbind(1, st$xs))
### Use a new rejection level of 0.1 and marg2() initialization ###
npmle2=npmleEM(st$y, cbind(1, st$xs), level = 0.1, initp = 2)
#' ### Use a new rejection level of 0.1 and FDRreg() initialization ###
npmle3=npmleEM(st$y, cbind(1, st$xs), level = 0.1, initp = 3)
### Use the best initialization among marg1(), marg2() and FDRreg()###
npmle4=npmleEM(st$y, cbind(1, st$xs), level = 0.2, initp = 4)
### Output the vector of prior probabilities ###
npmle1$p
### Output the rejection set ###
npmle2$rejset
### Output the vector of local false discovery rates ###
npmle3$localfdr
### Output the vector of estimated conditional densities ###
npmle4$den
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.