functions to run model fit of univariate data. Thanks, Xiao.