Empirical Bayes methods in classical and Bayesian inference