Fitting nonlinear time series models with applications to stochastic variance models