Clear Filters
Clear Filters

Why confidence interval distributions overlap the distribution?

6 views (last 30 days)
Hi all,
I've a series of data that were scaled to a percentage of maximum which I need to compute the 20th percentile of the lower confidence interval distribution at 50%. So I fitted the data with lognormal distribution, truncated it to 100% and computed the two confidence distributions. Here the result I do not understand why the three distributions overlap each other. What's wrong in my code? Thanks
Here the code:
pd1 = fitdist(Neutral', 'Lognormal');
YPlot = cdf(pd1,XGrid);
pd1 = truncate(pd1,0,100);
pdCI(1) = makedist('LogNormal',pdci(1),pdci(3));
pdCI(2) = makedist('LogNormal',pdci(2),pdci(4));
pdCI(1) = truncate(pdCI(1),0,100);
pdCI(2) = truncate(pdCI(2),0,100);
YPlotUB = cdf(pdCI(2),XGrid);
YPlotLB = cdf(pdCI(1),XGrid);
[f x]=ecdf(Neutral);
legend('Fitted data','70% lower confidence bound','70% upper confidence bound','Empirical data','Location','Best')
xlabel('Time [%]','FontSize',14)

Answers (1)

Tom Lane
Tom Lane on 15 Jan 2016
A couple of things. First, take out your truncate statements and run the code. You'll see that the "LB" cdf is substantially below 1 and x=100. But when you truncate it, you force it up to 1 at x=100 and it looks a lot like the "UB" cdf.
Another thing is that it looks like you're using the lower limits of both parameters together, then the upper limits of both parameters together. That wouldn't necessarily give you a set of confidence bounds on the cdf.
I haven't quite got my head around what you'd like to do or how to do it.

Community Treasure Hunt

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

Start Hunting!