Speculation, Heterogeneity and Learning: A Model of Exchange Rate Dynamics