# finding normality from a set of samples of MEAN

I have set of 1000 samples. each sample represents MEAN of X amount transactions response time.

Now I have a running transaction , I know it's current response time but I want to know if this particular transactions elapsed time is normal relative to my all previously collected sample.

is there a statistical method that is a good fit for this case ?

• I don't think the question is answerable without additional information. What is the distribution of transaction response time? Is it Gaussian? Can you edit the question to add a histogram of response times? (not a histogram of means; a histogram of the individual transaction response times) – D.W. Apr 13 '17 at 20:41
• thank you for answering. data is like 80 ms 81 ms 84 ms 79 ms 86 ms .... it is a normal distribution. in other words. data is not skewed. – deb Apr 13 '17 at 20:49
• @deb, could you clarify what you meant by 'is normal relative to my all previously collected sample'? – fade2black Jun 13 '17 at 2:29

You can't, from the information listed.

You say in the comments that the distribution of transaction times is Gaussian. A Gaussian distribution has two parameters: $\mu$ (its mean) and $\sigma^2$ (its variance). Based on the 1000 observed values, you can make a good estimate of what the underlying value of $\mu$ is. However, there is no way to infer $\sigma^2$, the variance. Consequently, when you observe a new transaction time, you can't tell whether it is normal or abnormal.

Suppose $\mu = 100$ and you observe a transaction whose response time is $105$. Is that abnormal? There's no way to know. If the variance of the Gaussian distribution is $0.1$, it is highly abnormal. If the variance is $10$, it is entirely typical/normal.

• @deb has 1000 samples. He may visualize the data, and infer mean and variance. Also the graph can suggest whether or not the data is distributed according to the normal distribution. – fade2black Jun 12 '17 at 23:59
• @deb, Also "normality" may depend on what bounds you choose on the normal curve. For example you may consider the running time to be "abnormal" if it is two times standard deviation beyond the mean (out of 95%). Read about z-scores. – fade2black Jun 13 '17 at 0:05
• @fade2black please, visualizing data requires to calculate it. Also if this is automatic detection, it would require some human to gaze at the plot and manually tag it. Reading the plot is not the best idea possible. Deb is gone for some time, buf you have an answer, by all means please write it. – Evil Jun 13 '17 at 0:10

Generally, data gathered from natural phenomena obeys normal distribution, I think your data should obey the normal distribution as well. The more you have data the better you may do estimation or prediction. Wikipedia says:

In statistics, normality tests are used to determine if a data set is well-modeled by a normal distribution and to compute how likely it is for a random variable underlying the data set to be normally distributed.

There are many methods to do the test.

Simple back-of-the-envelope test takes the sample maximum and minimum and computes their z-score, or more properly t-statistic (number of sample standard deviations that a sample is above or below the sample mean), and compares it to the 68–95–99.7 rule: if one has a 3σ event (properly, a 3s event) and substantially fewer than 300 samples, or a 4s event and substantially fewer than 15,000 samples, then a normal distribution will understate the maximum magnitude of deviations in the sample data.

But if your sample data is fixed ( I mean does not change with time) then you can precompute necessary statistics and later compare and draw conclusion in $O(1)$ time. But I would update my sample data once a day or hour, and then check it visually (for example you may detect outliers) and recompute statistics on a regular base.

• @Evil, do you understand exactly what OP means by "normal" in his original sentence "elapsed time is normal relative to my all previously collected sample"? What do you mean by "fit" in your comment? => "...OP asks about testing if the sample fits the collected samples" – fade2black Jun 13 '17 at 2:13