fit_model function

Fit model and obtain parameter estimates