  We prove that the convex least squares estimator (LSE) attains a $n^{-1/2}$
pointwise rate of convergence in any region where the truth is linear. In
addition, the asymptotic distribution can be characterized by a modified
invelope process. Analogous results hold when one uses the derivative of the
convex LSE to perform derivative estimation. These asymptotic results
facilitate a new consistent testing procedure on the linearity against a convex
alternative. Moreover, we show that the convex LSE adapts to the optimal rate
at the boundary points of the region where the truth is linear, up to a log-log
factor. These conclusions are valid in the context of both density estimation
and regression function estimation.
