Home > wafo > wstats > wqqplot.m

wqqplot

PURPOSE ^

Plot empirical quantile of X vs empirical quantile of Y

SYNOPSIS ^

h=wqqplot(x,y,ps);

DESCRIPTION ^

 WQQPLOT   Plot empirical quantile of X vs empirical quantile of Y
 
  CALL:  h = wqqplot(x,y,ps)
 
   h   = handle to the plotted figure
   x,y = data 
   ps  = plot symbol (default '+')
 
  If two distributions are the same (or possibly linearly 
  transformed) the points should form an approximately straight 
  line.
 
  Example:
    R1=wgumbrnd(1,0,[],1,100);
    R2=wgumbrnd(2,2,[],1,100);
    wqqplot(R1,R2)
 
  See also  wquantile

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function h=wqqplot(x,y,ps);
002 %WQQPLOT   Plot empirical quantile of X vs empirical quantile of Y
003 %
004 % CALL:  h = wqqplot(x,y,ps)
005 %
006 %  h   = handle to the plotted figure
007 %  x,y = data 
008 %  ps  = plot symbol (default '+')
009 %
010 % If two distributions are the same (or possibly linearly 
011 % transformed) the points should form an approximately straight 
012 % line.
013 %
014 % Example:
015 %   R1=wgumbrnd(1,0,[],1,100);
016 %   R2=wgumbrnd(2,2,[],1,100);
017 %   wqqplot(R1,R2)
018 %
019 % See also  wquantile
020 
021 % testen on: matlab 5.3
022 % History:
023 % revised pab 24.10.2000
024 % added nargchk
025 % updated header to comform to wafo style
026 error(nargchk(2,3,nargin))
027 if nargin<3, ps = '+'; end
028 x = sort(x);
029 y = sort(y);
030 if length(x) < length(y)
031    n = length(x);
032    h=plot(x, wquantile(y, ((1:n)-0.5)/n, 1), ps);
033 elseif length(y) < length(x)
034    n = length(y);
035    h=plot(wquantile(x, ((1:n)-0.5)/n, 1), y, ps);
036 else
037    h=plot(x,y,ps);
038 end
039 xlabel('Data X')
040 ylabel('Data Y')
041

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003