  We consider the problem of computing the minimum value $f_{\min,K}$ of a
polynomial $f$ over a compact set $K \subseteq \mathbb{R}^n$, which can be
reformulated as finding a probability measure $\nu$ on $K$ minimizing $\int_K f
d\nu$. Lasserre showed that it suffices to consider such measures of the form
$\nu = q\mu$, where $q$ is a sum-of-squares polynomial and $\mu$ is a given
Borel measure supported on $K$. By bounding the degree of $q$ by $2r$ one gets
a converging hierarchy of upper bounds $f^{(r)}$ for $f_{\min,K}$. When $K$ is
the hypercube $[-1, 1]^n$, equipped with the Chebyshev measure, the parameters
$f^{(r)}$ are known to converge to $f_{\min,K}$ at a rate in $O(1/r^2)$. We
extend this error estimate to a wider class of convex bodies, while also
allowing for a broader class of reference measures, including the Lebesgue
measure. Our analysis applies to simplices, balls and convex bodies that
locally look like a ball. In addition, we show an error estimate in $O(\log r /
r)$ when $K$ satisfies a minor geometrical condition, and in $O(\log^2 r /
r^2)$ when $K$ is a convex body, equipped with the Lebesgue measure. This
improves upon the currently best known error estimates in $O(1 / \sqrt{r})$ and
$O(1/r)$ for these two respective cases.
