Re: Probability scale

Phil Reardon <[email protected]>
Newsgroups gmane.comp.gnu.octave.graphics
Organization PCRTechnologies
Message-ID <[email protected]>
On Fri, 26 Sep 2003 19:45:10 -0500
"John W. Eaton" <[email protected]> wrote:

> On 26-Sep-2003, Phi Reardon <[email protected]> wrote:
> 
> | It seems to me (correct me if I am wrong) that octave can plot on
> | linear or log scales, but not probability scales.  This would not be
> | too hard to implement, it seems to me, but is not a current octave
> | (or gnuplot) capability.  If it were in place, then log-probability
> | graphs of distributions like the log-normal distribution would be
> | easy.  Since this is a common sort of distribution, and even a
> | common sort of graph paper, how about it?
> 
> OK, write it up and send in a patch.
> 
> If there is something similar in Matlab, it would probably help to
> have a compatible interface.
> 
> jwe
> 

A patch is probably outside my skillset, but here is a little routine that locates the tic marks.  I hope it will inspire someone else to look at implementing it in octave/gnuplot.


function ans = pinv(y)
# probinv calculates the inverse of the normal cumulative distribution function
  ans = erfinv(y/50.0 - 1.0);
#  printf("y=%f,   ans=%e\n",y,ans);
endfunction
                                                                                
tics = [0.1;0.2;0.3;0.4;0.5;0.6;0.7;0.8;0.9;1.0;2.0;3.0;4.0;5.0;6.0;7.0;8.0;9.0;10.0;20.0;30.0;40.0;50.0;60.0;70.0;80.0;90.0;95.0;99.0;99.9];
                                                                                
L=15.0  #length of the scale in some unit, e.g. cm.
                                                                                
jmax=length(tics);
for j = 1:jmax
# v evaluates to 0 for j=1, L for j=jmax.
# It represents the distance from the base of the scale to the jth tic
  v(j) = L*(pinv(tics(1)) - pinv(tics(j)))/(pinv(tics(1)) - pinv(tics(jmax)));
  printf("  %f     %e\n",tics(j), v(j));
endfor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.