How to calculate 90% confidence interval
17 views (last 30 days)
Show older comments
Hi,
I have a question on determine the value of 90% cofidence from a set of data. The question shown below.
Q.Assume ln(abc) is normally distributed and hence estimate the abc that will be exceeded for 0.1%.
What I have done:
abc = textread('abc.txt', '', 'headerlines', 1);
Inabc=log(abc);
pd = fitdist(abc,'Normal')
pd =
NormalDistribution
Normal distribution
mu = -0.456292 [-0.554295, -0.358289]
sigma = 0.668189 [0.605717, 0.745143]
I have generate a normal distrubution by In(abc) but how to estimate the abc that will be exceeded for 0.1% .
0 Comments
Answers (1)
Star Strider
on 5 Oct 2020
Edited: Star Strider
on 5 Oct 2020
abc = readmatrix('abc.txt');
Inabc=log(abc);
pd = fitdist(abc,'Normal')
ci10 = paramci(pd, 'Alpha',0.1).' % 10% CI
ci05 = paramci(pd, 'Alpha',0.05).' % 5% CI
producing:
pd =
NormalDistribution
Normal distribution
mu = 0.792155 [0.703932, 0.880378]
sigma = 0.60151 [0.545272, 0.670785]
ci10 =
0.7182 0.8661
0.5539 0.6590
ci05 =
0.7039 0.8804
0.5453 0.6708
I calculated the 5% CI simply to be certain I was reading them correctly. The transpose operation (.') puts them in row-order form to match the original fitdist output.
EDIT — (5 Oct 2020 at 12:08)
I copied your code as you posted it, then noticed that you are actually fitting ‘Inabc’, not ‘abc’.
The correct paramterrs for the transformed data are:
ci10 =
-0.5384 -0.3742
0.6153 0.7320
ci05 =
-0.5543 -0.3583
0.6057 0.7451
You could also have used:
pd = fitdist(abc,'Lognormal')
producing the same results.
.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!