Home > wafo > wavemodels > ochi98pdf.m

ochi98pdf

PURPOSE ^

Ochi's (1998) PDF of peaks and troughs of non-gaussian processes

SYNOPSIS ^

y = ochi98pdf(x,a,b)

DESCRIPTION ^

 OCHI98PDF Ochi's (1998) PDF of peaks and troughs of non-gaussian processes 
  
   CALL:  f = ochi98pdf(x,A1,A2)  
  
           f = PDF 
           x = wave heights  
       A1 A2 = scale parameters for troughs and crests, respectively. 
   where 
       A1 = sqrt(2*s1^2/(1-(.4*(c1/s1)^2) 
       A2 = sqrt(2*s2^2/(1-(.4*(c2/s2)^2) 
       si = sigmai/(1+L2)  
  
   The size of f is the common size of X, A1 and A2.  A scalar input    
   functions as a constant matrix of the same size as the other input. 
  
  Example: 
   x =linspace(0,10).'; a1 = 2.5; a2 = 2; 
   plot(x,ochi98pdf(x,a1,a2),x,wraylpdf(x,sqrt(a1^2+a2^2))  
  
  See also  wnormcdf, wraylpdf

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function y = ochi98pdf(x,a,b) 
002 %OCHI98PDF Ochi's (1998) PDF of peaks and troughs of non-gaussian processes 
003 % 
004 %  CALL:  f = ochi98pdf(x,A1,A2)  
005 % 
006 %          f = PDF 
007 %          x = wave heights  
008 %      A1 A2 = scale parameters for troughs and crests, respectively. 
009 %  where 
010 %      A1 = sqrt(2*s1^2/(1-(.4*(c1/s1)^2) 
011 %      A2 = sqrt(2*s2^2/(1-(.4*(c2/s2)^2) 
012 %      si = sigmai/(1+L2)  
013 % 
014 %  The size of f is the common size of X, A1 and A2.  A scalar input    
015 %  functions as a constant matrix of the same size as the other input. 
016 % 
017 % Example: 
018 %  x =linspace(0,10).'; a1 = 2.5; a2 = 2; 
019 %  plot(x,ochi98pdf(x,a1,a2),x,wraylpdf(x,sqrt(a1^2+a2^2))  
020 % 
021 % See also  wnormcdf, wraylpdf 
022  
023  
024  
025 %  Reference: 
026 %       [1]  Michel K. Ochi (1998), 
027 %       "Probability distributions of peaks and troughs of non-gaussian processes" 
028 %        Probabilistic Engineering Mechanics, Vol 13, No 4, pp 291-298 
029  
030 % TODO % explanation on how to evaluate the scale parameters 
031  
032 % Tested on: matlab 5.2 
033 % History 
034 % revised pab 04.11.2000 
035 % - now independent of stats toolbox 
036 % revised pab 29.02.2000  
037 % changed name from ochipdf to ochi98pdf 
038 % by  Per A. Brodtkorb 17.02.99 
039  
040 error(nargchk(3,3,nargin)) 
041  
042  
043 [errorcode x a b] = comnsize(x,a,b); 
044  
045 if errorcode > 0 
046     error('Requires non-scalar arguments to match in size.'); 
047 end 
048  
049 % Initialize Y to zero. 
050 y=zeros(size(x)); 
051  
052 % Return NaN if A or B is not positive. 
053 k1 = find(a <= 0|b<= 0); 
054 if any(k1)  
055     tmp   = NaN; 
056     y(k1) = tmp(ones(size(k1))); 
057 end 
058  
059 k=find(a > 0 & b>0 & x > 0 & x < inf); 
060 if any(k), 
061    r1 = a(k).^2; r2 = b(k).^2;xk = x(k); 
062  y(k)=2*xk./(r1+r2).^2.*(r1.*exp(-xk.^2./r1)+   r2.*exp(-xk.^2./r2)+... 
063            2*sqrt(pi*r1.*r2./(r1+r2))./(r1+r2).*exp(-xk.^2./(r1+r2))... 
064     .*(2*xk.^2./(r1+r2)-1).*(wnormcdf(sqrt(2*r2./r1./(r1+r2)).*xk )    - wnormcdf(-sqrt(2*r1./r2./(r1+r2)).*xk ) )); 
065   end 
066  
067  
068 k=find(a > 0 & (b==0 | a==b)); 
069 if any(k), 
070   y(k)=wraylpdf(x(k),a(k)/sqrt(2)); 
071 end 
072 k=find(a == 0 & b>0); 
073 if any(k), 
074   y(k)=wraylpdf(x(k),b(k)/sqrt(2)); 
075 end 
076

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