Tidal fitting toolbox

버전 1.3 (422 KB) 작성자: Aslak Grinsted
fit tidal components to an observed series of sea level and use them for prediction
다운로드 수: 8.1K
업데이트 날짜: 2014/12/15

라이선스 보기

* Fitting of tidemodels to e.g. sea level data.
* Predictions of tide based on tide model.
Uses familar syntax from polyfit/polyval: tidalfit/tidalval

% TIDALFIT: Fits a tidal model to data

tidalfit uses the HAMELS (ordinary least squares)
technique to fit tidal components to the detrended data. Additionally it
can also do robust fitting.

Please include an acknowledgement to Aslak Grinsted if you use this code.

USAGE: tidal=tidalfit(data[,parameter,value])

INPUT:
------
data: A two column vector.
\ - first column should be a serial date number (See help datenum)
\ - second column should be the y-values (i.e. sea level)
\ (missing values and nans are OK.)

OPTIONAL PARAMETERS:
--------------------
Components: cell-array of strings with names of the which
\ components should be included in the fit? (ALL is default)
\ Note: The routine will only attempt to fit components
\ that have period<data_timespan/4 and period>dt*2.
FittingMethod: 'OLS' for ordinary least squares or 'ROBUST' for robustfitting.
\ (default=OLS)
RobustFitOptions: cell of options for robustfit. (See help robustfit.)
\ only used if FittingMethod='ROBUST'. (default={})
DetrendData: should the data be detrended prior to fitting? (default=true)

Note: optional parameters can be specified using abbreviations. e.g. RFO for RobustFitOptions.

OUTPUT:
-------
If no output arguments are specified the routine will display the results
visually.

tidal: A struct-array containing the fitted model parameters.
\ .name: name of tidal component (see e.g. http://www.mhl.nsw.gov.au/www/tide_glossary.htmlx)
\ .period:period of tidal component in days
\ .speed: frequency of tidal component in degrees per solar hour
\ .amp: amplitude of fitted component
\ .phase: phase of fitted component

Components that are not included in the fit will have NaN in .amp and .phase.



EXAMPLE:
data=datenum(1971,1,1):datenum(2008,1,1);
data=[data;randn(size(data))]';
tidal=tidalfit(data,'fm','robust');
future=[datenum(2008,1,1):datenum(2009,1,1)'];
plot(future,tidalval(tidal,future));

인용 양식

Aslak Grinsted (2024). Tidal fitting toolbox (https://www.mathworks.com/matlabcentral/fileexchange/19099-tidal-fitting-toolbox), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R14
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Oceanography and Hydrology에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.3

added example html

1.0.0.0

mathworks didn't update the file correctly last time, so i have to re-upload it again. (It is still the old zip file but description has changed.)