use fitcurve to compute parameteres