While doing simulations/experiments in your projects, sometimes you need to provide evidences to verify the confidence of the values obtained from your simulations/experiments. For example, you wrote an IOS application. Before you publish your APP, your boss wanted you to do some experiments to measure the average delay of your APP per processing a request. So you generated some requests randomly and did the experiment, and reported the data (i.e., the average delay) to your boss. At that time, your boss might not buy your results, because you did not provide any evidence to convince your boss that your results were reliable enough. At this time, the confidence intervals might be useful for you.
The following gives the formal definition of the confidence intervals from the book “”:
Let be a sample on a random variable , where has pdf . Let be specified. Let and be two statistics. We say that the interval is a confidence interval for if
That is, the probability that the interval includes is , which is called the confidence coefficient of the interval.
There are two different scenarios while calculating the confidence intervals of your estimations. The first case is that the standard deviation of the unknown random variable is known. The second one is that the standard deviation is unknown. The second case is more commonly encountered in real life. In this post, we will use confidence interval as an example to demonstrate the approach of computing confidence intervals.
First of all, we will make the following assumptions. The sample size in your simulation/experiment is , and sample mean is , the sample standard deviation (only needed in the second case) is
Confidence Interval ( Known)
By looking up the Z-table, we can find that the value corresponding to the confidence interval is , so the interval is
Confidence Interval ( Unknown)
By looking up the T-table, you will find the value for the confidence interval with different sample sizes is in the column (note that, unlike Z distribution, there are different T distributions for different sample sizes.). The interval con be computed as,
Notice
More details your can refer to Confidence Interval: How to Find a Confidence Interval: The Easy Way! and the Youtube videos Statistics 101: Confidence Intervals, Population Deviation Known, Statistics 101: Confidence Intervals, Population Deviation Unknown - Part 1, and Statistics 101: Confidence Intervals, Population Deviation Unknown - Part 2.