⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decluster.m

📁 极值理论中各种函数及图像的程序。matlab实现。
💻 M
字号:
function out=decluster(series,gap,graphopt)
%Declusters clustered point process data so that Poisson assumption is 
%more tenable over a high threshold.
%
%  USAGE: out=decluster(series,gap,graphopt)
%
% series: Data vector (elements are assigned time indices [0,1] corresponding to their
%         sequences).
%    gap: Any consecutive exceedances separated by more than this amount is considered
%         to belong different clusters.
%grapopt: Should be 1 if plots required.
%
%    out: declustered series.

times=series(:,1);
gaps=diff(times);
longgaps=(gaps>gap);
if sum(longgaps)<=1,
    disp('Decluster parameter too large');
    return
end
cluster=[0;cumsum(longgaps)];

for i=0:cluster(end),
ser=[series(:,1) repmat(NaN,length(series),1)];
ser(cluster==i,2)=series(cluster==i,2);
[y,ind]=max(ser(:,2));
inds(i+1)=ind;
out(i+1,:)=series(ind,:);
end
if graphopt==1,
subplot(221)
plot(times,series(:,2),'.')
xlabel('Scaled Time Index');
subplot(222)
qplot(gaps,0);
subplot(223)
plot(times(inds),out(:,2),'.')
xlabel('Scaled Time Index')
subplot(224)
inds2=times(inds);
qplot(diff(inds2),0);
end

function c=mymax(v),
c=find(v==max(v));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -