Home > wafo > papers > wafodemo > wafofig3.m

wafofig3

PURPOSE ^

Probability density distributions (pdf) of wave period, Tt,

SYNOPSIS ^

wafofig3

DESCRIPTION ^

  WAFOFIG3  Probability density distributions (pdf) of wave period, Tt,
            i.e., down-to-upcrossing:
            Theoretical pdf given the theoretical spectral density, S (solid), 
            theoretical pdf given the estimated spectral density from
            the simulated data, Sest (green dash-dot), and
            a kernel density estimate from the simulated data (red dash).
            The histogram shows the wave periods extracted from simulated 
            data.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function wafofig3
002 % WAFOFIG3  Probability density distributions (pdf) of wave period, Tt,
003 %           i.e., down-to-upcrossing:
004 %           Theoretical pdf given the theoretical spectral density, S (solid), 
005 %           theoretical pdf given the estimated spectral density from
006 %           the simulated data, Sest (green dash-dot), and
007 %           a kernel density estimate from the simulated data (red dash).
008 %           The histogram shows the wave periods extracted from simulated 
009 %           data.
010 %
011 
012 % Revised pab Feb2005
013 % -updated call to kdebin and spec2thpdf
014 global  WAFOFIGNUM
015 
016 if isempty(WAFOFIGNUM)
017   disp('You must start wafodemo in order to run this script')
018   clear global WAFOFIGNUM
019   return
020 end
021 
022 global xt u rate
023 global St Ste Tt fTt fTte Np nit speed  
024 global kdeTt kernel hs L2
025 
026 if nit<0
027   opt = rindoptset('method',abs(nit),'speed',speed);
028 else
029   opt = rindoptset('method',0,'nit',(nit),'speed',speed);
030 end
031 
032 % Only need to calculate Globals which is not empty
033 if isempty(Tt)
034   Tt=dat2wa(xt,u,'d2u','dw',rate);
035 end
036 if isempty(fTt)
037   fTt = spec2thpdf(St,u,'Tt',[0 11 Np],[],opt);
038 end
039 if isempty(fTte)
040   fTte = spec2thpdf(Ste,u,'Tt',[0 11 Np],[],opt);
041 end
042 if isempty(kdeTt)
043   kopt = kdeoptset('kernel',kernel,'hs',hs,'L2',L2);
044   kdeTt=kdebin(Tt,kopt);
045 end
046 whisto(Tt,max(22,2*sqrt(length(Tt))),[],1)
047 hold on
048 pdfplot(kdeTt,'r--')
049 pdfplot(fTt,'-')
050 pdfplot(fTte,'g-.')
051 hold off
052 axis([0 inf 0 inf])
053 
054 wafostamp('Figure 3','(ER)')

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