This article develops a rich class of discrete-time, nonlinear dynamic term structure models (DTSMs). Under the risk-neutral measure, the distribution of the state vector X t resides within a family of discrete-time affine processes that nests the exact discrete-time counterparts of the entire class of continuous-time models in Duffie and Kan (1996) and Dai and Singleton (2000). Under the historical distribution, our approach accommodates nonlinear (nonaffine) processes while leading to closed-form expressions for the conditional likelihood functions for zero-coupon bond yields. As motivation for our framework, we show that it encompasses many of the equilibrium models with habit-based preferences or recursive preferences and long-run risks. We illustrate our methods by constructing maximum likelihood estimates of a nonlinear discrete-time DTSM with habit-based preferences in which bond prices are known in closed form. We conclude that habit-based models, as typically parameterized in the literature, do not match key features of the conditional distribution of bond yields. (JEL G12, C50, E13, E21) We are grateful for comments from participants in seminars at the University of Chicago, NYU, the AFA meetings, the Jackson Hole Finance Conference, and the Federal Reserve Bank of New York. We would like to thank Yakov Amihud, Raghu Sundaram, two anonymous referees, and Raman Uppal, the Editor, for helpful comments.