  Given a standard Brownian motion $B^{\mu}=(B_t^{\mu})_{0\le t\le T}$ with
drift $\mu \in \mathbb{R}$ and letting $S_t^{\mu}=\max_{0\le s\le t}B_s^{\mu}$
for $0\le t\le T$, we consider the optimal prediction problem: \[V=\inf_{0\le
\tau \le T}\mathsf{E}(B_{\tau}^{\mu}-S_T^{\mu})^2\] where the infimum is taken
over all stopping times $\tau$ of $B^{\mu}$. Reducing the optimal prediction
problem to a parabolic free-boundary problem we show that the following
stopping time is optimal: \[\tau_*=\inf \{t_*\le t\le T\mid b_1(t)\le
S_t^{\mu}-B_t^{\mu}\le b_2(t)\}\] where $t_*\in [0,T)$ and the functions
$t\mapsto b_1(t)$ and $t\mapsto b_2(t)$ are continuous on $[t_*,T]$ with
$b_1(T)=0$ and $b_2(T)=1/2\mu$. If $\mu>0$, then $b_1$ is decreasing and $b_2$
is increasing on $[t_*,T]$ with $b_1(t_*)=b_2(t_*)$ when $t_*\ne 0$. Using
local time-space calculus we derive a coupled system of nonlinear Volterra
integral equations of the second kind and show that the pair of optimal
boundaries $b_1$ and $b_2$ can be characterized as the unique solution to this
system. This also leads to an explicit formula for $V$ in terms of $b_1$ and
$b_2$. If $\mu \le 0$, then $t_*=0$ and $b_2\equiv +\infty$ so that $\tau_*$ is
expressed in terms of $b_1$ only. In this case $b_1$ is decreasing on $[z_*,T]$
and increasing on $[0,z_*)$ for some $z_*\in [0,T)$ with $z_*=0$ if $\mu=0$,
and the system of two Volterra equations reduces to one Volterra equation. If
$\mu=0$, then there is a closed form expression for $b_1$. This problem was
solved in [Theory Probab. Appl. 45 (2001) 125--136] using the method of time
change (i.e., change of variables). The method of time change cannot be
extended to the case when $\mu \ne 0$ and the present paper settles the
remaining cases using a different approach.
