The Horseshoe Estimator: Posterior Concentration around Nearly Black Vectors
S. L. van der Pas, B. J. K. Kleijn, A. W. van der Vaart
Introduction
for independent normal random variables with mean zero and variance . The vector is assumed to be sparse, in the ‘nearly black’ sense that the number of nonzero means
In general one would use a posterior distribution both for recovery and for uncertainty quantification. For the first, a measure of centre, such as a median or mode, suffices. For the second, one typically employs a credible set, which is defined as a central set of prescribed posterior probability. For realistic uncertainty quantification it is necessary that the posterior contracts to its center at the same rate as the posterior median or mode approaches the true parameter.
In this paper we study the posterior distribution resulting from the horseshoe prior, which is a one-component prior, introduced in (Carvalho, Polson and Scott, 2010, 2009) and expanded upon in (Scott, 2011; Polson and Scott, 2012a, b). It combines a pole at zero with Cauchy-like tails. The corresponding estimator does not face the computational issues of the point mass mixture models. Carvalho, Polson and Scott (2010) already showed good behaviour of the horseshoe estimator in terms of Kullback-Leibler risk when the true mean is zero. Datta and Ghosh (2013) proved some optimality properties of a multiple testing rule induced by the horseshoe estimator. In this paper, we prove that the horseshoe estimator achieves the minimax quadratic risk, possibly up to a multiplicative constant. We furthermore prove that the posterior variance is of the order of the minimax risk, and thus the posterior contracts at the minimax rate around the underlying mean vector. These results are proven under the assumption that the number of nonzero parameters is known. However, we also provide conditions under which the horseshoe estimator combined with an empirical Bayes estimator still attains the minimax rate, when is unknown.
The horseshoe prior
In this section, we give an overview of some known properties of the horseshoe estimator which will be relevant to the remainder of our discussion. The horseshoe prior for a parameter modelling an observation is defined hierarchically (Carvalho, Polson and Scott, 2010):
for , where is a standard half-Cauchy distribution. The parameter is assumed to be fixed in this paper, rendering the independent a priori. The corresponding density increases logarithmically around zero, while its tails decay quadratically. The posterior density of given and is normal with mean , where . Hence, by Fubini’s theorem:
If , this reduces to a Be distribution, which looks like a horseshoe. As illustrated in Figure 1, decreasing skews the prior distribution on towards one, corresponding to more mass near zero in the prior on and a stronger shrinkage effect in .
where denotes the degenerate hypergeometric function of two variables (Gradshteyn and Ryzhik, 1965).
An unanswered question so far has been how should be chosen. Intuitively, should be small if the mean vector is very sparse, as the horseshoe prior will then place more of its mass near zero. By approximating the posterior distribution of given in case a prior on is used, Carvalho, Polson and Scott (2010) show that if most observations are shrunk near zero, will be very small with high probability. They suggest a half-Cauchy prior on . Datta and Ghosh (2013) implemented this prior on and their plots of posterior draws for at various sparsity levels indicate the expected relationship between and the sparsity level: the posterior distribution of tends to concentrate around smaller values when the underlying mean vector is sparser. As will be discussed further in the next section, the value (up to a log factor) is optimal in terms of mean square error and posterior contraction rates.
In case is estimated empirically, as will be considered in section 4, the horseshoe estimator can be computed by plugging this estimate into expression (1), thereby avoiding the use of MCMC. Other aspects of the posterior, such as the posterior variance, can be computed using such a plug-in procedure as well. Polson and Scott (2012a) and Polson and Scott (2012b) consider computation of the horseshoe estimator based on the representation in terms of degenerate hypergeometric functions, as these can be efficiently computed using converging series of confluent hypergeometric functions. They report unproblematic computations for between and . A second option is to apply a quadrature routine to the integral representation in (1). As the continuity and symmetry of in can be taken advantage of when computing the horseshoe estimator for a large number of observations, the complexity of these computations mostly depends on the value of . Both approaches will be slower for smaller values of . Hence, if we use the (estimated) sparsity level (up to a log factor) for , the computation of the horseshoe estimator will be slower if there are fewer nonzero parameters. As noted by Scott (2010), problems arise in Gibbs sampling precisely when is small as well. Hence care needs to be taken with any computational approach if is suspected to be very close to zero.
The performance of the horseshoe prior, with additional priors on and , in various simulation studies has been very promising. Carvalho, Polson and Scott (2010) simulated sparse data where the nonzero components were drawn from a Student- density and found that the horseshoe estimator systematically beat the MLE, the double-exponential (DE) and normal-exponential-gamma (NEG) priors, and the empirical Bayes model due to Johnstone and Silverman (2004) in terms of square error loss. Only when the signal was neither sparse nor heavy-tailed did the MLE, DE and NEG priors have an edge over the horseshoe estimator. In similar experiments in (Carvalho, Polson and Scott, 2009; Polson and Scott, 2012a) the horseshoe prior outperformed the DE prior, while behaving similarly to a heavy-tailed discrete mixture. In a wavelet-denoising experiment under several noise levels and loss functions, the horseshoe estimator compared favorably to the discrete wavelet transform and the empirical Bayes model (Polson and Scott, 2010). Bhattacharya et al. (2012) applied several shrinkage priors to data with the underlying mean vector consisting of zeroes and fixed nonzero values and found the posterior median of the horseshoe prior performing better in terms of squared error than the Bayesian Lasso (BL), the Lasso, the posterior median of a point mass mixture prior as in (Castillo and Van der Vaart, 2012) and the empirical Bayes model proposed by Johnstone and Silverman (2004), and comparable to their proposed Dirichlet-Laplace (DL) prior with parameter . Results in (Armagan, Dunson and Lee, 2013) are similar. In a second simulation setting, Bhattacharya et al. (2012) generated data of length , with the first ten means equal to 10, the next 90 equal to a number and the remainder equal to zero. In this simulation, the horseshoe prior beat the BL (except when ) and the DL prior with parameter (except when ), while performing similarly to the DL prior with parameter . It is worthy of note that Koenker (2014) generated data according to the same scheme and applied the empirical Bayes procedures due to Martin and Walker (2014) (EBMW) and Koenker and Mizera (2014) (EBKM) to it. The MSE of EBMW was lower than that of the horseshoe prior for , while that of EBKM was much lower in all cases.
Mean square error and bounds on the posterior variance
Suppose . Then the estimator satisfies
for , as and
By the minimax risk result in (Donoho et al., 1992), we also have a lower bound:
as and . The choice , for , leads to an upper bound (2) of order , with (as can be seen from the proof) a multiplicative constant of at most . Thus, for this choice of , we have:
The horseshoe estimator therefore performs well as a point estimator, as it attains the minimax risk (possibly up to a multiplicative constant of at most 2 for ). This may seem surprising, as the prior does not include a point mass at zero to account for the assumed sparsity in the underlying mean vector. Theorem 3.1 shows that the pole at zero of the horseshoe prior mimics the point mass well enough, while the heavy tails ensure that large observations are not shrunk too much.
An upper bound on the rate of contraction of the posterior can be obtained through an upper bound on the posterior variance. The posterior variance can be expressed as:
Suppose . Then the variance of the posterior distribution corresponding to the horseshoe prior satisfies
for , as and .
Again, the choice , for leads to an upper bound (3) of the order of the minimax risk. This result indicates that the posterior contracts fast enough to be able to provide a measure of uncertainty of adequate size around the point estimate. Theorems 3.1 and 3.2 combined allow us to find an upper bound on the rate of contraction of the full posterior distribution, both around the underlying mean vector and around the horseshoe estimator.
Under the assumptions of Theorem 3.1, with , :
for every as .
Combine Markov’s inequality with the results of Theorems 3.1 and 3.2 for (4), and only with the result of Theorem 3.2 for (5). ∎
for and , as . This lower bound is sharp for vectors with entries equal to and the remaining entries equal to zero, if is such that .
for and , as .
Consider . Three cases can be discerned:
. Bounds (3) and (6) differ by a factor , as do (7) and (8). The gap can be closed by choosing .
These observations suggest that is a good choice, because then (2), (3), (6), (7), (8) are all of the order , suggesting that the posterior contracts at the minimax rate around both the truth and the horseshoe estimator.
Empirical Bayes estimation of τ𝜏\tau
A natural follow-up question is how to choose in practice, when is unknown. As discussed in section 2, the full Bayesian approach suggested by Carvalho, Polson and Scott (2010) performs well in simulations. The analysis of such a hierarchical prior would however require different tools than the ones we have used so far. An empirical Bayes estimate of would be a natural solution, and allows us in practice to use one of the representations in (1) for computations, instead of an MCMC-type algorithm.
Suppose we observe an -dimensional vector and we use as our estimator of . If satisfies the following two conditions for or :
The first condition requires that does not overestimate the fraction of nonzero means (up to a log factor) too much or by a too large probability. If , as we have assumed, then it is satisfied already by (and ). According to the last assertion of the theorem, this ‘universal threshold’ yields the rate (possibly up to a multiplicative constant). This is equal to the rate of the Lasso estimator with the usual choice of (Bickel, Ritov and Tsybakov, 2009). However, in the framework where , the estimator will certainly underestimate the sparsity level. A more natural estimator of is:
where and are positive constants. By Lemma A.7, this estimator satisfies the first condition for and if and or and . Thus will also lead to a rate of at most order under these conditions. Its behaviour will be explored further in section 5.
The rate can be improved to if the second condition is met as well, which ensures that the sparsity level is not underestimated too much or by a too large probability. As we are not aware of any estimators meeting this condition for all , this condition is currently mostly of theoretical interest. If the true mean vector is very sparse, in the sense that there are relatively few nonzero means or the nonzero means are close to zero, there is not much to be gained in terms of rates by meeting this condition. The extra occurrence of relative to the rate is of interest only if is relatively large. For instance, if for , then , which suggests a decrease of the proportionality constant in (9), particularly if is close to one. Furthermore, when is large, the constant in (9) may be sensitive to the fine properties of , as it depends on (as can be seen in the proof). If seriously underestimates the sparsity level, the corresponding value of from the second condition may be so small that the upper bound on the multiplicative constant before (9) becomes very large. Hence in this case, is required to be close to the proportion (up to a log factor) with large probability in order to get an optimal rate.
Datta and Ghosh (2013) warned against the use of an empirical Bayes estimate of for the horseshoe prior, because the estimate might collapse to zero. Their references for this statement, Scott and Berger (2010) and Bogdan, Ghosh and Tokdar (2008), indicate that they are thinking of a marginal maximum likelihood estimate of . However, an empirical Bayes estimate of does not need to be based on this principle. Furthermore, an estimator that satisfies the second condition from Theorem 4.1 or that is truncated from below by , would not be susceptible to this potential problem.
Simulation study
A simulation study provides more insight into the behaviour of the horseshoe estimator, both when using an empirical Bayes procedure with estimator (10) and when using the fully Bayesian procedure proposed by Carvalho, Polson and Scott (2010) with a half-Cauchy prior on . For each data point, 100 replicates of an -dimensional vector sampled from a distribution were created, where had either 20, 40 or 200 (5%, 10% or 50%) entries equal to an integer ranging from 1 to 10, and all the other entries equal to zero. The full Bayesian version was implemented using the code provided in (Scott, 2010), and the coordinatewise posterior mean was used as the estimator of . For the empirical Bayes procedure, the estimator (10) was used with and . Performance was measured by squared error loss, which was averaged across replicates to create Figure 2.
With , this leads to the ‘universal threshold’ of , or with , a ‘threshold’ at . Based on this property and the proofs of the main results, we can divide the underlying parameters into three cases:
Those that are exactly or close to zero, where the observations are shrunk close to zero;
Those that are larger than the threshold, where the horseshoe estimator essentially behaves like the identity;
Those that are close to the ‘threshold’, where the horseshoe estimator is most likely to shrink the observations too much.
The horseshoe estimator performs well in cases (i) and (ii) due to its pole at zero and its heavy tails respectively. The hardest parameters to recover from the noise are those that are close to the threshold, and these are the ones that affect the estimation risk the most. This phenomenon explains the peaks in the graphs of Figure 2 around .
Concluding remarks
The choice of the global shrinkage parameter is critical towards ensuring the right amount of shrinkage of the observations to recover the underlying mean vector. The value of was found to be optimal. Theorem 4.1 indicates that quite a wide range of estimators for will work well, especially in cases where the underlying mean vector is sparse. Of course, it should not come as a surprise that an estimator designed to recover sparse vectors will work especially well if the truth is indeed sparse. An interesting extension to this work would be to investigate whether the posterior concentration properties of the horseshoe prior still remain when a hyperprior is placed on . The result that (up to a log factor) yields optimal rates, together with the simulation results, suggests that in a fully Bayesian approach, a prior on which is restricted to $$ may perform better than the suggested half-Cauchy prior.
The simulation results also indicate that mean vectors with the nonzero means close to the universal threshold are the hardest to recover. In future simulations involving shrinkage rules, it would therefore be interesting to study the challenging case where all the nonzero parameters are at this threshold. The performance of the empirical Bayes estimator (10) leaves something to be desired around the threshold. In additional numerical experiments (not shown), we tried two other estimators of . The first was the ‘oracle estimator’ . For values of the nonzero means well past the ‘threshold’, the behaviour of this estimator was very similar to that of (10). However, before the threshold, the squared error loss of the empirical procedure with the oracle estimator was between that of the full Bayes estimator and empirical Bayes with estimator (10). The second estimator was the mean of the samples of from the full Bayes estimator. The resulting squared error loss was remarkably close to that of the full Bayes estimator, for all values of the nonzero means. Neither of these two estimators is of much practical use. However, their range of behaviours suggests room for improvement over the estimator (10), and it would be worthwhile to study more refined estimators for .
An interesting question is what aspects of the horseshoe prior are truly essential towards optimal posterior contraction properties. Our proofs do not elucidate whether the pole at zero of the horseshoe prior is required, or if a prior with heavy tails, and in a sense ‘sufficient’ mass at zero would work as well. The failure of the Lasso to concentrate around the true mean vector at the minimax rate does indicate that heavy tails in itself may not be sufficient, and adding mass at zero solves this problem (Castillo, Schmidt-Hieber and Van der Vaart, 2014; Castillo and Van der Vaart, 2012). It is possible that the pole at zero is inessential, in particular if the global tuning parameter is chosen carefully, for instance by empirical Bayes. If the tuning parameter is chosen by a full Bayes method, the peak may be more essential, depending on its prior.
Acknowledgements
The authors would like to thank two anonymous referees for their helpful suggestions, as well as James Scott for his advice on implementing the full Bayesian version of the horseshoe estimator.
Appendix A Proofs
This section begins with Lemma A.1, providing bounds on some of the degenerate hypergeometric functions appearing in the posterior mean and posterior variance. This is followed by two lemmas that are needed for the proofs of Theorems 3.1 and 3.2: Lemma A.2 provides two upper bounds on the horseshoe estimator and Lemma A.3 gives a bound on the absolute value of the difference between the horseshoe estimator and an observation. We then proceed to the proof of Theorem 3.1, after which Lemma A.4 provides upper bounds on the posterior variance. These upper bounds are then used in the proof of Theorem 3.2. The proof of Theorem 3.4 is given next, followed by Lemmas A.5 and A.6 supporting the proof of Theorem 3.5. This section concludes with the proofs of Theorem 4.1 and Lemma A.7, which both concern the empirical Bayes procedure discussed in section 4.
where (11) and (13) hold for , (12) holds for , and (14) and (15) hold for .
Write . We first note that for , we have , while for , we have . Hence, we can bound from above by:
and from below by half of that quantity. We bound the integral over in all cases by bounding the factor by 1 or . For the integral over , we first substitute , yielding: . For (11) and (13), we split the domain of integration into and . For , we bound by:
yielding (11). Similarly, for :
resulting in (13). The bound (12) is obtained similarly, but without splitting up further, by the inequality
For the bounds on , we split up the domain of integration into and , and then bound by:
If , the posterior mean of the horseshoe prior can be bounded above by:
, where is such that ;
, for any and .
We bound the integrals in the numerator and denominator of expression (1). For the first upper bound, we will use the fact that for , is bounded below by 1 and above by . The posterior mean can therefore be bounded by:
By Shafer’s inequality for the arctangent (Shafer, 1966):
which completes the proof for the first upper bound. For the second inequality, we note that, in the notation of Lemma A.1, . The bounds in Lemma A.1 yield the stated inequality. ∎
For , the absolute value of the difference between the horseshoe estimator and an observation can be bounded by a function such that for any :
We assume without loss of generality. By a change of variables of :
By following the proof of Watson’s lemma provided in Miller (2006), we can find bounds on the numerator and denominator of the above expression. First define and note that by Taylor’s theorem, where is between 0 and . Let be any number between 0 and 1. Because is not negative for , we have that for , : . The numerator can then be bounded by:
where , and . The denominator can similarly be bounded by:
where and . Hence:
For any fixed , this bound tends to zero as tends to infinity. If , the term containing could potentially diverge. For and , where is a positive constant, this term displays the following limiting behaviour as :
because , and the factor tends to zero as if and infinity otherwise. The condition is related to the choice of and can be improved to any constant strictly greater than by choosing appropriately close to one. Hence, we find that the absolute value of the difference between the posterior mean and an observation can be bounded by a function with the desired property. ∎
Nonzero parameters Denote . We will show
for all nonzero , which can be done by bounding :
Lemma A.3 yields the following bound on the difference between the observation and the horseshoe estimator: , where is such that for any . Combining this with the inequality , we have as :
which implies (16), as :
Parameters equal to zero We split up the term for the zero means into two parts:
where . For the first term, we have, by the first bound in Lemma A.2:
where the identity was used to bound . For the second term, because for all , we have by the identity , and by Mills’ ratio:
where the last inequality holds for . If we apply this inequality and combine this upper bound with the upper bound on the first term, we find, for (corresponding to ):
Hence, for :
Conclusion By (16) and (19), we find for :
The posterior variance when using the horseshoe prior can be expressed as:
;
.
where is the density of the marginal distribution of . Equality (20) can be found by combining the expressions
with the equality . The first upper bound is implied by the property and the fact that for . The second upper bound can be demonstrated by noting that for and hence:
Hence, as : , for any that increases as least as fast as when decreases. Now suppose . Then, by the bound from Lemma A.4, we find:
Zero means By the bound , we find for :
For , we consider the upper bound from Lemma A.4. From this bound, we get . Hence:
We bound the first integral from (A) by applying the first bound on from Lemma A.2:
because . For the second term in (A), we first note that the second bound from Lemma A.2 can be relaxed to:
By expanding , we see that the final term in (20) is equal to:
As is non-negative, we can bound the posterior variance from below by the final two terms in (20). By the above equality, this yields the following lower bound:
where is as in Lemma A.1. We now use the bounds from Lemma A.1 with and take equal to for some nonnegative constant . Then and . Taking for each bound on , , the term that diverges fastest as approaches zero, we find that the lower bound is asymptotically of the order:
By the substitution , we find:
where in the last step, we used for . By plugging this into (25), we find that as :
finishing the proof for the first statement of the theorem.
We first consider . By the first bound of Lemma A.4:
The first integral from (A) can be split into two parts by splitting up the factor , the first of which can be bounded, by substituting and applying Mills’ ratio:
The second of these integrals is, by , equal to:
By substituting in the second integral from (A) and then applying the same inequalities to it as to the first integral, the following bound is obtained:
If , then and , yielding an upper bound on (33) of order .
We now consider . We use the second bound of Lemma A.4:
Applying inequality from Lemma A.2 to the first integral yields the bound:
If , we have and thus this term will be of order . For the second integral from (A), we use bound (23). This leads to three integrals to be bounded, en .
and will all be of no larger order than if . ∎
For , the statement is immediate. By integration by parts the integral is seen to be equal to . For , the latter integral is bounded above by
This is further bounded above by a multiple of . ∎
Let be as in Lemma A.1. There exist functions with for and , such that,
We split the integral in the definition of over the intervals and . The first interval contributes, uniformly in ,
by the substitution . The integral tends to , by the dominated convergence theorem, for any . The second interval contributes, with the substitution :
In the second integral the argument satisfies , and hence , uniformly in and . Hence
as , by Lemma A.5. For the first integral we separately consider the cases and . If , then converges, and hence, by the dominated convergence theorem, uniformly in ,
If , then we substitute and rewrite the integral as
Denote and assume that for and for . We prove (7) by proving that there exists a positive constant such that
If (36) holds, we have, by Jensen’s inequality:
as . In addition, we have . For , with , the lower bound (12) on behaves as , while the upper bound (15) on behaves as , as . Therefore, for , we have . Thus, we can bound by:
By combining the lower bounds (37) and (38) with the upper bound (2), we arrive at (7). For the posterior variance, we already have by (24) and (26). Expression (8) can therefore be proven by showing that there exists a positive constant such that:
We shall show that the first and third integrals are negligible, while the second gives the approximation in (36). On the domain of the second integral, we have , so we can apply Lemma A.6 to see that this integral is asymptotic to
where and . On :
By the substitution , the remaining integral is equal to, with and :
by the dominated convergence theorem. This yields the approximation in (36), with .
For the first integral in (40), we use bound 1 from Lemma A.2, and obtain a bound on its absolute value equal to
where the last inequality follows by integration by parts. This is of much smaller order than the second integral from (40). In the third integral of (40), we bound by 1, giving the upper bound
by Mills’ ratio. This is also of much smaller order than the second integral from (40), thus concluding the proof of (36).
Proof of (39) By expanding the term in the numerator of the final term of (20), the posterior variance can be seen to be equal to:
Because can be interpreted as the mean of the density proportional to , and as the second moment, it follows that the term in square brackets in (43) is nonnegative. By (43), we write:
The first term in (A) is as (40), except without the factor . Following the same steps as the proof of (36), we see that it is smaller than a multiple of times the bound on (40), so it is of the order . The first and third integrals of the second term of (A) are also negligible. For the first, we use that the expression in square brackets is nonnegative and bounded above by , which in turn is bounded above by . We bound as in (42), with the difference that the leading factor is instead of . This leads to the order , much smaller than the claimed rate. For the third integral, we can bound the term in square brackets by 1 and use Mills’ ratio to see that it is of the order .
We are left with the middle integral of the second term of (A). On the domain of this integral, by Lemma A.6:
where , and is as in (41). We see that and are asymptotic to the same function on this domain. Since , it follows that up to , the middle integral is asymptotic to
We substitute to reduce this to
This is asymptotic to expression (39), with .
where (17) was used in the second line, and follows a standard normal distribution. If is such that holds with probability one on , we can use the inequality if to find:
and then bound each of terms on the right hand side. For the nonzero means, we take , while for the zero means, we consider . Note that for to be well-defined, we need and consequently, when we consider , we must have .
If , the inequality needed for (46) does not hold. For this case, we assume that with probability one, for some function , corresponding to . Then we find by (45):
By (47) and (48), we have for :
By this inequality combined with the inequality , we have:
By (46) and (A), we get for any such that :
Now suppose for some such that . First note that increases monotonically in , as is clear from
Because sign = sign and , we have:
And thus, by (18), we have for :
The function is monotonically increasing in for . Hence, with the choice or , the conditions stated in the theorem are sufficient for (54) to be bounded by the minimax squared error rate in the worst case.
Suppose and and define
For , this quantity will exceed if . If , we require , which is certainly satisfied if .