GLmix: Kiefer-Wolfowitz NPMLE for Gaussian Location Mixtures

Description Usage Arguments Details Value Author(s) References


Kiefer Wolfowitz Nonparametric MLE for Gaussian Location Mixtures


GLmix(x, v = 300, sigma = 1, hist = FALSE, histm = 300,
  weights = NULL, ...)



Data: Sample Observations


Undata: Grid Values defaults equal spacing of with v bins, when v is a scalar


scale parameter of the Gaussian noise, may take vector values of length(x)


If TRUE then aggregate x to histogram bins, when sigma is vector valued this option is inappropriate unless there are only a small number of distinct sigma values.


histogram bin boundaries, equally spacing with histm bins when scalar.


replicate weights for x obervations, should sum to 1


other parameters to pass to KWDual to control optimization


Kiefer Wolfowitz MLE as proposed by Jiang and Zhang for the Gaussian compound decision problem. The histogram option is intended for large problems, say n > 1000, where reducing the sample size dimension is desirable. When sigma is heterogeneous and hist = TRUE the procedure tries to do separate histogram binning for distinct values of sigma, however this is only feasible when there are only a small number of distinct sigma. By default the grid for the binning is equally spaced on the support of the data. This function does the normal convolution problem, for gamma mixtures of variances see GVmix, or for mixtures of both means and variances TLVmix.

The predict method for GLmix objects will compute means, medians or modes of the posterior according to whether the Loss argument is 2, 1 or 0, or posterior quantiles if Loss is in (0,1).


An object of class density with components:


points of evaluation on the domain of the density


estimated function values at the points v, the mixing density


the estimated mixture density function values at x


Log likelihood value at the proposed solution


prediction of mean parameters for each observed x value via Bayes Rule


exit code from the optimizer


Roger Koenker


Kiefer, J. and J. Wolfowitz Consistency of the Maximum Likelihood Estimator in the Presence of Infinitely Many Incidental Parameters Ann. Math. Statist. Volume 27, Number 4 (1956), 887-906.

Jiang, Wenhua and Cun-Hui Zhang General maximum likelihood empirical Bayes estimation of normal means Ann. Statist., Volume 37, Number 4 (2009), 1647-1684.

Koenker, R and I. Mizera, (2013) “Convex Optimization, Shape Constraints, Compound Decisions, and Empirical Bayes Rules,” JASA, 109, 674–685.

Search within the REBayes package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.