mean_function function

Mean function