Plotting on probability paper
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Need some help with plotting: I'm calculating probability of detection (Pd) as a function of number of pulses (N). Is there any way to scale the Pd axis to match a probability paper display? I'm familiar with functions such as probplot and normplot but I think they are useless in my case (my data is already probability values).
6 commentaires
bym
le 4 Juil 2011
just give some sample data, there is no way to attach sample data except via 3rd party host site
Réponse acceptée
the cyclist
le 16 Juil 2011
Use the norminv() function to convert your Pd probability values into z-scores.
z = norminv(Pd);
figure
plot(N,z);
p_label = [0.001 0.01 0.05 0.1 0.25 0.5 0.75 0.9 0.95 0.99 0.999 0.9999 0.99999];
set(gca,'YTick',norminv(p_label))
set(gca,'YTickLabel',p_label)
3 commentaires
Yimin Lim
le 2 Fév 2018
Hi, is there any way to plot this while retaining the probability scale? can't really find any thread on this at all.
Plus de réponses (2)
Oleg Komarov
le 16 Juil 2011
N = 1:50;
Pd = [ 0.000383300630824923 0.00304135866412469 0.0115018297345039 0.0299724820999226 0.0620021866776590 0.109393828951169 0.171732062381264 0.246552187406658 0.329955743864937 0.417405529850324 0.504469775589605 0.587373712581881 0.663308835662832 0.730518912100307 0.788219407087160 0.836417608881746 0.875693476402896 0.906985359331223 0.931407248664091 0.950109249769390 0.964182240138594 0.974601251259546 0.982199211646827 0.987662230603251 0.991538575189021 0.994255111160449 0.996136711333829 0.997425684412606 0.998299510385346 0.998886064327547 0.999276105246741 0.999533163271662 0.999701142182148 0.999810022829196 0.999880051534573 0.999924758662280 0.999953097907271 0.999970939636442 0.999982099032798 0.999989035045252 0.999993320015178 0.999995951806419 0.999997559162203 0.999998535534269 0.999999125521121 0.999999480227800 0.999999692439166 0.999999818798839 0.999999893693984 0.999999937888214 ];
f = figure;
ax = axes('Parent',f,'YScale','log','YMinorTick','on',...
'YMinorGrid','on','YGrid','on',...
'YColor',[.5 .5 .5],'XScale','log',...
'XMinorTick','on','XMinorGrid','on',...
'XGrid','on','XColor',[.5 .5 .5],...
'MinorGridLineStyle','-','box','on');
hold(ax(1),'all');
% Create loglog
loglog(N,Pd,'LineWidth',2);
% Overwrite axes to make it black keeping grey grid
prop = get(ax(1),{'Xlim','Ylim','Xtick','Ytick'});
ax(2) = axes('Parent',f,'YScale','log','XScale','log','box','on',...
'Color','none','Xlim',prop{1},'Ylim',prop{2},...
'Xtick',prop{3},'Ytick',prop{4});
The result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168174/image.png)
EDIT: QQplot against normal
qqplot(norminv(Pd))
PS. Here Pd is a cdf
4 commentaires
Warda Panondi
le 15 Nov 2019
Dear Everyone,
i will take as an oppurtunity to ask related to this topic, I just what to ask on how to plot linear probablity plot as the picture shown.
for example.
x=[ 44 38 36 35 27 26.5 26 26 24 23.5 23 23 21 20.5 19.5 19 19 19 19 19 18 18 17.6 17 17 17 16 16 16 16 14.5 14 13 11 11 10 9 8.5 ]
y = [ 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 0.974359 ]
and im looking that my result would be like this.
![probabilityPlot.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/248467/probabilityPlot.jpeg)
Hoping for your help.
Best Regards,
Warda
the cyclist
le 15 Nov 2019
Modifié(e) : the cyclist
le 15 Nov 2019
Every value in your y vector seems to identical, so you cannot get a plot that looks like that from the data you posted.
Larry B
le 9 Oct 2015
Do not know if this is an issue for you anymore, but I also wanted to do CDF curves on probability paper. Cam Sulzberger, MathWorks Technical Support Department, created the below program for doing so. I added the following lines to my CDF program plotting both simulation results and theoretical curves: .... plotProbGraphPaper(a1,w1,'-k','linewidth',3); hold on plotProbGraphPaper(a1,w2,'vk','linewidth',3); hold on plotProbGraphPaper(a1,w3,'--k','linewidth',3); hold on plotProbGraphPaper(a1,w4,'sk','linewidth',3); hold on plotProbGraphPaper(a1,w5,':k','linewidth',3); hold on plotProbGraphPaper(a1,w6,'dk','linewidth',3); hold on plotProbGraphPaper(a1,w7,'-.k','linewidth',3); hold on plotProbGraphPaper(a1,w8,'dk','linewidth',3); hAx = gca; hAx.YLim(1) = norminv(0.0001); hAx.YLim(2) = norminv(0.999); hold off...
Attached is the resulting curves for a non-central Chi-Squared CDF. Pretty slick!! Thanks, Cam!!
------function plotProbGraphPaper(x,y,varargin) % plotProbGraphPaper(x,y,_) % Sets the y-axis limits and tick marks to display in the style of % probability graph paper
% Plot the data, converting to z-scores z = norminv(y); plot(x,z,varargin{:}) hAx = gca; % % Define potential tick locations ticks = [.0001 .0005 .001 .005 .01 .05 .1 .25 .5 ... .75 .9 .95 .99 .995 .999 .9999 .99995]; ticksNV = norminv(ticks);
% Remove ticks that are outside the y-axis range hAx.YLimMode = 'auto'; keepTicks = ticksNV >= hAx.YLim(1) & ticksNV <= hAx.YLim(2); ticks = ticks(keepTicks); ticksNV = ticksNV(keepTicks);
% Remove ticks that are too close together tol = 0.025*diff(hAx.YLim); iTickBack = ceil(length(ticksNV)/2); iTickFwd = iTickBack-1; keepTicks = true(size(ticksNV)); while iTickFwd > 0 if ticksNV(iTickFwd) > ticksNV(iTickBack)-tol keepTicks(iTickFwd) = false; else iTickBack = iTickFwd; end iTickFwd = iTickFwd-1; end iTickFwd = iTickBack+1; while iTickFwd < length(ticksNV) if ticksNV(iTickFwd) < ticksNV(iTickBack)+tol keepTicks(iTickFwd) = false; else iTickBack = iTickFwd; end iTickFwd = iTickFwd+1; end if ~all(keepTicks) ticks = ticks(keepTicks); ticksNV = ticksNV(keepTicks); end
% Assign the tick values and labels using norminv hAx.YTick = ticksNV; hAx.YTickLabel = ticks;
% Add grid hAx.XGrid = 'on'; hAx.XMinorGrid = 'off'; hAx.YGrid = 'on'; hAx.YMinorGrid = 'off';
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!