  We investigate the frequentist properties of Bayesian procedures for
estimation based on the horseshoe prior in the sparse multivariate normal means
model. Previous theoretical results assumed that the sparsity level, that is,
the number of signals, was known. We drop this assumption and characterize the
behavior of the maximum marginal likelihood estimator (MMLE) of a key parameter
of the horseshoe prior. We prove that the MMLE is an effective estimator of the
sparsity level, in the sense that it leads to (near) minimax optimal estimation
of the underlying mean vector generating the data. Besides this empirical Bayes
procedure, we consider the hierarchical Bayes method of putting a prior on the
unknown sparsity level as well. We show that both Bayesian techniques lead to
rate-adaptive optimal posterior contraction, which implies that the horseshoe
posterior is a good candidate for generating rate-adaptive credible sets.
