Generalized Instrumental Variables Estimation of Nonlinear Rational Expectations Models