ecostate function

fit EcoState model