Nonparametric estimation for an autoregressive model