The statistical distribution of the mean squared weighted deviation