|
function b = get_trend(y)
% b is the slope, i.e., changes per step.
N=size(y,1); % [col, 1]
x=(1:N)'; % [col, 1]
bls = regress(y,[ones(N,1) x]);
Comb = combnk(1:N,2);
theil=diff(y(Comb),1,2)./diff(x(Comb),1,2);
b=median(theil);
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-7-28 08:21
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社