mean_variance script