Switching nonparametric regression models for a single curve and