Confidence Interval

7 ビュー (過去 30 日間)
Jorge
Jorge 2011 年 10 月 28 日
Good afternoon. I am working in MATLAB, developed a software that uses the generation of random numbers according to the normal distribution. I wanted to know how to calculate the confidence interval for this generation of numbers? For example, 15,000 numbers with N (0,2.5).
thank you

採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 28 日
The confidence of what ?
Do you perhaps mean the confidence that the generated numbers really are representative of the normal distribution, then consider (for example) using http://www.mathworks.com/help/toolbox/stats/ttest.html
Keep in mind, of course, that low confidence is not disproof. With the normal distribution you could end up with 15000 copies of the number -42: such a thing is not impossible, just low probability.
  1 件のコメント
Jorge
Jorge 2011 年 10 月 29 日
Thanks.

サインインしてコメントする。

その他の回答 (2 件)

Alex
Alex 2011 年 10 月 28 日
Like Walter said, you need to define what you mean by "confidence interval".
A normal distribution can be purely characterized by it's first 2 moments, which are more commonly known as the Mean and the Variance (hence N(mean, variance)).
If you want to see how close your random set of 1500 numbers are to N(0,.25) you simply need to take the mean of those number and the variance of the numbers.
If the mean of those numbers is near 0 and the variance is near .025, then you can have a high confidence that your sample space represIents a normal distribution adequately.
Going to other distributions will make this much harder, because they need more information, compared to a Normal dist., to be characterized.
Addition: if you want a way to measure how close the sample is to the distribution, I would suggest a MSE ErrorAmount = ((wanted var - sample var)^2 + (wanted mean - actual mean)^2)
  1 件のコメント
Jorge
Jorge 2011 年 10 月 29 日
Thanks a lot.

サインインしてコメントする。


Jorge
Jorge 2011 年 10 月 31 日
So, i use the ttest functin. 1st i generate 15000 numbers using valor=normrnd(0,2.5,[1 15000]) and then i make ttest(valor,0.05) and i see that h=0, variance is 0,3496 and CI is [-0.0588 0.0208].
So, variance of 34.96% is good? i have made a lot of search and i dont found nothing about levels of variance...
i made another simulation with 400 generated number N(0,1.25) and i found a variance about 36.05%.
thanks a lot.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by