There exists, logspace, linspace, what about probability space?
Mostra commenti meno recenti
Hi guys,
I want to create a set from [0,1] that's equally spaced in a probability plot such as for Probability of Detection vs Probability of False Alarm graphs.
logspace is sort of what I want but not exactly.
Is there a function for "probspace"?
Thanks, William
Risposte (2)
Walter Roberson
il 31 Ott 2012
No. But you can use fsolve() or the like to solve the cdf for particular values.
probspace = @(CDF, XMin, XMax, N) arrayfun( @(p) fsolve( @(x) CDF(x)-p, [Xmin, XMax]), linspace(0,1,N) );
XMin and XMax are required because probability functions vary in the range they are defined over.
CDF should be the function handle of the cumulative distribution function for the probability distribution you are interested in.
Tom Lane
il 1 Nov 2012
You haven't said what probability distribution you want. If it's the standard normal distribution, you could try
norminv(.1:.1:.9) % if you have the Statistics Toolbox
sqrt(2)*erfcinv(2*(.1:.1:.9)) % if you do not
This will give you values that are equally space on the probability scale, but are not themselves between 0 and 1.
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!