Probability that Array of Numbers Came from Distribution

probabilitystatistics

I am trying to figure out how compute the probability that an array of values came from a given distribution. For example, I want to determine that probability that [0.9, 0.3, 0.7] came from a Uniform distribution. I know that the probability of getting any specific value from a continuous distribution is zero. However, some arrays of numbers are far more uniform-like in their distribution than others.

One way I have thought about the problem is Root Mean Squared Error (RMSE) of the array from the mean of the distribution. For example, I wrote a little MATLAB script to estimate the RMSE Probability Distribution Function for an array of uniform numbers.

enter image description here

An array like [0.9, 0.3, 0.7] has an RMSE of 0.28 which is entirely reasonable whereas [0.5, 0.5, 0.5] has an RMSE of zero, which is almost impossible given this PDF. However, this approach isn't right either. An array like [0.8, 0.8, 0.8] is just as unlike a uniform distribution as [0.5, 0.5, 0.5] and yet it's RMSE is 0.3 which is reasonable. I think there must be an algorithm to do this, I suspect that I just don't know the right key-words for searching. I'm an engineer, not a probability and stats guy. Thanks!

Best Answer

What you are looking for is a goodness-of-fit test.

There you find an often used test called the chi-squared test. But you will find there also other fitting tests.

Related Question