91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 889B
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-07-14
  • 語言: Matlab
  • 標(biāo)簽: mann_kendall??

資源簡介

mann_kendall趨勢分析,程序中沒有考慮結(jié),MATLAB源碼

資源截圖

代碼片段和文件信息

%?Time?Series?Trend?Detection?Tests
%?[?z?sl?lcl?ucl?]?=?trend(?y?dt?)
%?where?z?=?Mann-Kendall?Statistic
%?sl?=?Sen‘s?Slope?Estimate
%?lcl?=?Lower?Confidence?Limit?of?sl
%?ucl?=?Upper?Confidence?Limit?of?sl
%?y?=?Time?Series?of?Data
%?dt?=?Time?Interval?of?Data
function?[?z?sl?lcl?ucl?]?=?trendMK(?y?dt?)
n?=?length(?y?);

%?Mann-Kendall?Test?for?N?>?40
disp(?‘Mann-Kendall?Test;‘?);
if?n?disp(?‘WARNING?-?sould?be?more?than?40?points‘?);
end;

%?calculate?statistic
s?=?0;
for?k?=?1:n-1
for?j?=?k+1:n
s?=?s?+?sign(?y(j)?-?y(k)?);
end;
end;

%?variance?(?assuming?no?tied?groups?)
v?=?(?n?*?(?n?-?1?)?*?(?2?*?n?+?5?)?)?/?18;

%?test?statistic
if?s?==?0
z?=?0;
elseif?s?>?0
z?=?(?s?-?1?)?/?sqrt(?v?);
else
z?=?(?s?+?1?)?/?sqrt(?v?);
end;?

%?should?calculate?Normal?value?here
nor?=?1.96;
%?results
disp(?[?‘?n?=?‘?num2str(?n?)?]?);
disp(?[?‘?Mean?Value?=?‘?num2str(?mean(?y?)?)?]?);
disp(?[?‘?Z?statistic?=?‘?num2str(?z?)?]?);
if?abs(?z?)?disp(?‘?No?significant?trend‘?);
z?=?0;
elseif?z?>?0
disp(?‘?Upward?trend?detected‘?);
else
disp(?‘?Downward?trend?detected‘?);
end;
disp(?‘Sens?Nonparametric?Estimator:‘?);

%?calculate?slopes
ndash?=?n?*?(?n?-?1?)?/?2;
s?=?zeros(?ndash?1?);
i?=?1;
for?k?=?1:n-1
for?j?=?k+1:n
s(i)?=?(?y(j)?-?y(k)?)?/?(?j?-?k?)?/?dt;
i?=?i?+?1;
end;
end;

%?the?estimate
sl?=?median(?s?);
disp(?[?‘?Slope?Estimate?=?‘?num2str(?sl?)?]?);
%?variance?(?assuming?no?tied?groups?)
v?=?(?n?*?(?n?-?1?)?*?(?2?*?n?+?5?)?)?/?18;
m1?=?fix(?(?ndash?-?nor?*?sqrt(?v?)?)?/?2?);
m2?=?fix(?(?ndash?+?nor?*?sqrt(?v?)?)?/?2?);
s?=?sort(?s?);
lcl?=?s(?m1?);
ucl?=?s(?m2?+?1?);
disp(?[?‘?Lower?Confidence?Limit?=?‘?...
num2str(?lcl?)?]?);
disp(?[?‘?Upper?Confidence?Limit?=?‘?...
num2str(?ucl?)?]?);

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1812??2015-04-11?20:36??trendMK.m

評論

共有 條評論