Fast inference in nonlinear dynamical systems using gradient matching