I'm using the code from Tianren Liu's answer to How do I robustly typeset a double-hat? to typeset double-hat accents in math mode, but sometimes the horizontal alignment is off. To wit:
\documentclass{article}
\usepackage{statmath}
\makeatletter
\newcommand{\doublehat}[1]{%
\begingroup%
\let\macc@kerna\z@%
\let\macc@kernb\z@%
\let\macc@nucleus\@empty%
\hat{\raisebox{.35ex}{\vphantom{\ensuremath{#1}}}\smash{\hat{#1}}}%
\endgroup%
}
\makeatother
\begin{document}
$$\hat\bfbeta \quad \hat\bfu$$
$$\doublehat\bfbeta \quad \doublehat\bfu$$
\end{document}
This yields:
The double hat on the u is fine, but that on the beta is much further to the left than it should be, and doesn't look good. I lack the TeX skills to fix this, but would much appreciate the help of any wizard. Thanks!

