Fitting Wave Height Data to a Probability Distribution - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Applications and Example Worksheets : Science and Engineering : Fitting Wave Height Data to a Probability Distribution

Fitting Wave Height Data to a Probability Distribution

Introduction

The University of Maine records real-time accelerometer data from buoys deployed in the Gulf of Maine and the Caribbean (http://gyre.umeoce.maine.edu/buoyhome.php). The data can be downloaded from their website, and includes the significant wave height recorded at regular intervals for the last few months.

 

This application does the following:

 

• 

Downloads accelerometer data for Buoy PR206 (located just off the coast of Puerto Rico at a latitude of 18° 28.46' N and a longitude of 66° 5.94' W)

• 

Fits the significant wave height to a Weibull distribution by using two methods: maximum likelihood estimation and moment matching

• 

Plots the fitted distributions on top of a histogram of the experimental data

 

Download and Plot Significant Wave Height Data in a Histogram

restart:

withplots:withStatistics:withOptimization:

urlhttp://gyre.umeoce.maine.edu/data/gomoos/buoy/php/view_csv_file.php?ncfile=/data/gomoos/buoy/archive/PR206/realtime/PR206.waves.triaxys.realtime.nc:

dataImportMatrixurl

sigWaveHeightRemoveNonNumericdata..,2:

nnumelemssigWaveHeight

n8273

(2.1)

numBins40:

p1HistogramsigWaveHeight,bincount=numBins,color=COLORRGB,150255,40255,27255,thickness=0,style=patchnogrid,transparency=0.5,background=ColorTools:-ColorRGB,236255,240255,241255,axis=gridlines=10,color=RGB1,1,1,axesfont=Arial,labels=Significant Wave Height (m),Distribution,labeldirections=horizontal,vertical,labelfont=Arial,size=800,500:

displayp1

Maximum Likelihood Estimation

PunapplyProbabilityDensityFunctionWeibullalpha,beta,t,t,alpha,beta

Pt&comma;α&comma;β0t<0βt1+β&ExponentialE;tαβαβotherwise

(3.1)

maxLike:=α&comma;βaddlnPsigWaveHeighti&comma;α&comma;β&comma;i&equals;1..n&colon;

Warning, (in maxLike) `i` is implicitly declared local

resultsMLEMaximizemaxLikeα&comma;β&comma;&alpha;&equals;0.01..5&comma;&beta;&equals;0.01..5

resultsMLE−4839.27465547207612&comma;α=1.34452570778020&comma;β=2.83250005643047

(3.2)

p2plotevalPt&comma;alpha&comma;beta&comma;resultsMLE2 &comma;t&equals;minsigWaveHeight..maxsigWaveHeight&comma;color&equals;black&comma;legend&equals;Maximum Likelihood Estimation&comma;thickness&equals;3&comma;legendstyle&equals;font&equals;Arial&colon;

Moment Matching

resultsMM:=fsolveMomentsigWaveHeight&comma;1&equals;MomentWeibull&alpha;&comma;&beta;&comma;1&comma;MomentsigWaveHeight&comma;2&equals;MomentWeibull&alpha;&comma;&beta;&comma;2&comma;&alpha;&equals;1&comma;&beta;&equals;1

resultsMMα=1.342796022&comma;β=2.958762705

(4.1)

p3plotevalPt&comma;alpha&comma;beta&comma;resultsMM &comma;t&equals;minsigWaveHeight..maxsigWaveHeight&comma;color&equals;RGB150255&comma;40255&comma;27255&comma;thickness&equals;3&comma;legend&equals;Moment Matching&comma;legendstyle&equals;font&equals;Arial&colon;

Results

displayp1&comma;p2&comma;p3&comma;size&equals;800&comma;500