Probability Plot with Confidence Interval

 Akzeptierte Antwort

UJJWAL
UJJWAL am 28 Sep. 2011

1 Stimme

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

5 Kommentare

Jacob Misura
Jacob Misura am 12 Jun. 2017
Just found this question and this answer is amazing thank you for helping people!!!!
Dennis Craggs
Dennis Craggs am 9 Jan. 2021
Bearbeitet: Dennis Craggs am 9 Jan. 2021
This code worked for a normal distribution, but not for a lognormal. So I made changes from normal to lognormal as follows:
pd = fitdist(a,'lognormal');
ci = paramci(pd);
probplot('lognormal',a);
h = probplot(gca,@(a,x,y)logncdf(a,x,y),[ci(1,1),ci(1,2)]);
t = probplot(gca,@(a,x,y)logncdf(a,x,y),[ci(2,1),ci(2,2)]);
The confidence limit lines were not plotted around the best fit line. Any idea what went wrong?
Diego
Diego am 5 Jul. 2024
Can you do it for a distribution gev?
Paul
Paul am 2 Jun. 2026 um 11:57
This only looks to do two of the four options it plots the 95% confidence interval using smallest mu and smallest sigma and largest mu and largest sigma. It does not plot smallest mu and largest sigma and largest mu with smallest sigma. Is there any reason for that?
Paul
Paul am 3 Jun. 2026 um 12:42
Also probplot scales to match the 1st and 3rd quartile so the reference line is not necesarily the same as the mu and standard deviation that comes out of fitdist. Can plot a probplot using the mu and standard deviation from fitdist and compare to the reference line.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

arif rabbani
arif rabbani am 2 Mai 2013

0 Stimmen

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

1 Kommentar

Dennis Craggs
Dennis Craggs am 9 Jan. 2021
gca is a reference to the last graphic created.
a is the original data set
x and y are used for the confidence intervals. I don't know the code, but the ci is a variance covariance matrix. h and t are used to reference the upper confidence bound and t for the lower confidence bound.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 28 Sep. 2011

Kommentiert:

am 3 Jun. 2026 um 12:42

Community Treasure Hunt

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

Start Hunting!

Translated by