Simultaneous estimation of multiple parameters has received a great deal of recent interest, with applications in multiple testing, causal inference, and large-scale data analysis. Most approaches to simultaneous estimation use empirical Bayes methodology. Here we propose an alternative, completely frequentist approach based on nonparametric regression. We show that simultaneous estimation can be viewed as a constrained and penalized least-squares regression problem, so that empirical risk minimization can be used to estimate the optimal estimator within a certain class. We show that under mild conditions, our data-driven decision rules have asymptotically optimal risk that can match the best known convergence rates for this compound estimation problem. Our approach provides another perspective to understand sufficient conditions for asymptotic optimality of simultaneous estimation. Our proposed estimators demonstrate comparable performance to state-of-the-art empirical Bayes methods in a variety of simulation settings and our methodology can be extended to apply to many practically interesting settings.