We study the estimation of the mean function of a continuous-time stochastic process and its derivatives. The covariance function of the process is assumed to be nonparametric and to satisfy mild smoothness conditions. Assuming that n independent realizations of the process are observed at a sampling design of size N generated by a positive density, we derive the asymptotic bias and variance of the local polynomial estimator as n,N increase to infinity. We deduce optimal sampling densities, optimal bandwidths, and propose a new plug-in bandwidth selection method. We establish the asymptotic performance of the plug-in bandwidth estimator and we compare, in a si...