maximum likelihood fitting