Home > wafo > wstats > empdistr.m

empdistr

PURPOSE ^

Computes and plots the empirical CDF

SYNOPSIS ^

[Fz] = empdistr(z,varargin)

DESCRIPTION ^

 EMPDISTR Computes and plots the empirical CDF 
           and optionally compares it with distribution G.
 
   CALL:  F = empdistr(X,G,plotflag,sym);
 
         F  = empirical distribution of X, two column matrix.
         X  = data vector.
         G  = cdf, two column matrix (optional).
   plotflag = 0  no plotting
              1 plot cdf F(x) (default)
              2 plot 1-F(x) on a semilog y-scale
              3 plot 1-F(x) on a log log scale
        sym = {s1,s2} cell array or comma separated list of plot 
              symbols for F and G, respectively.
              (default {'b','r--'})
  
  NOTE:  SYM can be given anywhere after X
 
  Example:
    R = wgevrnd(.8,1,11,1,100);
    x = linspace(5,15,200);
    empdistr(R,[x;wgevcdf(x,.8,1,11)]','g')
 
  See also  cumtrapz, cempdistr

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function [Fz] = empdistr(z,varargin)
002 %EMPDISTR Computes and plots the empirical CDF 
003 %          and optionally compares it with distribution G.
004 %
005 %  CALL:  F = empdistr(X,G,plotflag,sym);
006 %
007 %        F  = empirical distribution of X, two column matrix.
008 %        X  = data vector.
009 %        G  = cdf, two column matrix (optional).
010 %  plotflag = 0  no plotting
011 %             1 plot cdf F(x) (default)
012 %             2 plot 1-F(x) on a semilog y-scale
013 %             3 plot 1-F(x) on a log log scale
014 %       sym = {s1,s2} cell array or comma separated list of plot 
015 %             symbols for F and G, respectively.
016 %             (default {'b','r--'})
017 % 
018 % NOTE:  SYM can be given anywhere after X
019 %
020 % Example:
021 %   R = wgevrnd(.8,1,11,1,100);
022 %   x = linspace(5,15,200);
023 %   empdistr(R,[x;wgevcdf(x,.8,1,11)]','g')
024 %
025 % See also  cumtrapz, cempdistr
026 
027 % Tested on: Matlab 5.3, 5.2, 5.1
028 % History:
029 % revised pab 25.10.2000
030 %  - made call to cempdistr instead -> making maintainence easier.
031 % revised pab 07.03.2000
032 % - enabled so that f may be empty while plotflag is given 
033 % modified by Per A. Brodtkorb 10.11.98
034 % to accept both pdf and cdf's. Also enabled new plotting features,
035 % plotting of  probability of exceedances on a semilogy paper ....
036 % revised ms 13.06.2000
037 % - pdf usage removed (can't distinguish between a cdf and an increasing pdf)
038 % - changed axis labelling in figures
039 % - changed to staircaseplot when plotflag=2,3
040 % - revised header info
041 % - moved the conditional version to cempdistr
042 
043 
044 error(nargchk(1,5,nargin))
045 Fz1 = cempdistr(z,-inf,varargin{:});
046 if nargout>0
047   Fz=Fz1;
048 end
049 return
050 
051 
052 
053 
054 
055 
056 
057 
058

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