Consider the regression model Yi=X′iβ+g(ti)+eiYi=Xi′β+g(ti)+ei for i=1,⋯,ni=1,⋯,n. Here gg is an unknown Holder continuous function of known order pp in R,βR,β is a k×1k×1 parameter vector to be estimated and eiei is an unobserved disturbance. Such a model is often encountered in situations in which there is little real knowledge about the nature of gg. A piecewise polynomial gngn is proposed to approximate gg. The least-squares estimator ^ββ^ is obtained based on the model Yi=X′iβ+gn(ti)+eiYi=Xi′β+gn(ti)+ei. It is shown that ^ββ^ can achieve the usual parametric rates n−1/2n−1/2 with the smallest possible asymptotic variance for the case that XX and TT are correlated.