Filter löschen
Filter löschen

Confidence Interval

9 Ansichten (letzte 30 Tage)
Jorge am 28 Okt. 2011
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Okt. 2011
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
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.

Weitere Antworten (2)

Alex am 28 Okt. 2011
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 Kommentar
Jorge am 29 Okt. 2011
Thanks a lot.

Melden Sie sich an, um zu kommentieren.

Jorge am 31 Okt. 2011
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