fit_meanvar function

Fit a model for mean and variance