Essays in rational expectations and in migration