王国杰的博客分享 http://blog.sciencenet.cn/u/gwangcc Be Silly

博文

Theil Sen Trend Estimator

已有 7861 次阅读 2013-9-13 16:09 |系统分类:科研笔记

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);



https://blog.sciencenet.cn/blog-569118-724636.html

上一篇:inpaint data gaps of N dimensions
下一篇:Mann-Kendall Tau (aka Tau-b) with Sen's Method
收藏 IP: 222.190.109.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-7-28 08:21

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部