Limiting distribution of weighted processes of residuals. Application to parametric nonlinear autoregressive models