WGGAMCDF Generalized Gamma cumulative distribution function CALL: F = wggamcdf(x,a,b,c); F = distribution function evaluated at x a,b,c = parameters The generalized Gamma distribution is defined by its pdf f(x;a,b,c)=c*x^(a*c-1)/b^(a*c)*exp(-(x/b)^c)/gamma(a), x>=0, a,b,c>0 Example: x = linspace(0,7,200); p1 = wggamcdf(x,1,2,1); p2 = wggamcdf(x,3,1,1); plot(x,p1,x,p2)
Check if all input arguments are either scalar or of common size. | |
Display message and abort function. | |
Incomplete gamma function. | |
Not-a-Number. |
is an internal function to dist2dcdf dist2dprb. | |
Joint (Scf,Hd) PDF for nonlinear waves with a JONSWAP spectra. | |
Joint (Scf,Hd) PDF for linear waves with JONSWAP spectra. | |
Marginal wave height, Hd, CDF for Ochi-Hubble spectra. | |
Marginal wave height, Hd, CDF for Torsethaugen spectra. | |
Is an internal routine for wggamfit | |
Parameter estimates for Generalized Gamma data. |
001 function F = wggamcdf(x,a,b,c); 002 %WGGAMCDF Generalized Gamma cumulative distribution function 003 % 004 % CALL: F = wggamcdf(x,a,b,c); 005 % 006 % F = distribution function evaluated at x 007 % a,b,c = parameters 008 % 009 % The generalized Gamma distribution is defined by its pdf 010 % 011 % f(x;a,b,c)=c*x^(a*c-1)/b^(a*c)*exp(-(x/b)^c)/gamma(a), x>=0, a,b,c>0 012 % 013 % Example: 014 % x = linspace(0,7,200); 015 % p1 = wggamcdf(x,1,2,1); p2 = wggamcdf(x,3,1,1); 016 % plot(x,p1,x,p2) 017 018 % Reference: Cohen & Whittle, (1988) "Parameter Estimation in Reliability 019 % and Life Span Models", p. 220 ff, Marcel Dekker. 020 021 % Tested on; Matlab 5.3 022 % History: 023 % revised pab 23.10.2000 024 % - added comnsize, nargchk+ default values on b c. 025 % added ms 09.08.2000 026 027 028 error(nargchk(2,4,nargin)) 029 if nargin<3|isempty(b), b=1; end 030 if nargin<4|isempty(c), c=1; end 031 [errorcode x a b c] = comnsize(x,a,b,c); 032 033 if errorcode > 0 034 error('x, a, b and c must be of common size or scalar.'); 035 end 036 037 F = zeros(size(x)); 038 ok= ((a >0) & (b> 0) & (c>0)); 039 040 041 k=find(x >= 0 & ok); 042 if any(k), 043 F(k)= gammainc((x(k)./b(k)).^c(k),a(k)); 044 end 045 046 % Return NaN if the arguments are outside their respective limits. 047 k3 = find(~ok); 048 if any(k3) 049 tmp = NaN; 050 F(k3) = tmp(ones(size(k3))); 051 end 052 053 054 055 056 057
Comments or corrections to the WAFO group