MATLAB Answers

Probability Plot with Confidence Interval

95 views (last 30 days)
Jessica Lam
Jessica Lam on 28 Sep 2011
Commented: Jacob Misura on 12 Jun 2017
Hi
I would like to plot one probability plot with the confidence interval, like the plot in the below link
But I just found the following Matlab build-in functions , normplot() and probplot() which do not include the confidence interval.
Any suggestion would be greatly appreciated! Many thanks in advance!
Jessica

  0 Comments

Sign in to comment.

Accepted Answer

UJJWAL
UJJWAL on 28 Sep 2011
Hi Jessica, Functions like normplot and probplot allow you to mark the probability distribution of your data with respect to a specified distribution like Normal or Rayleigh etc.
Confidence Interval is something that they do not evaluate so they do not include an option explicitly for them. You will have to specify the confidence interval values of the parameters of your distribution and then you can plot them. I think the below program will help :-
clc;
clear all;
a= random('normal',10,4,1,100); % Generate a normally distributed random numbers
pd = fitdist(a','normal'); % Creates a ProbDistUnivParam object by fitting the data to a normal distribution. For details look at Documentation
ci = paramci(pd); % This function calculates the values of the parameters based on a certain confidence interval. Here the by default the confidence interval is 95 percent
probplot(a);
h=probplot(gca,@(a,x,y)normcdf(a,x,y),[ci(1,1),ci(1,2)]);
set(h,'color','r','linestyle','-')
t= probplot(gca,@(a,x,y)normcdf(a,x,y),[ci(2,1),ci(2,2)]);
set(t,'color','g','linestyle','-.')
For further help reply back or mail. I hope it will help you.
HAPPY TO HELP
UJJWAL

  1 Comment

Jacob Misura
Jacob Misura on 12 Jun 2017
Just found this question and this answer is amazing thank you for helping people!!!!

Sign in to comment.

More Answers (1)

arif rabbani
arif rabbani on 2 May 2013
please describe the following term, h=probplot(gca,@(a,x,y)normcdf(a,x,y),[ci(1,1),ci(1,2)]);

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!