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

📄 ardeglch.m

📁 matlab下实现kaplan算法
💻 M
字号:
function [labs,resids] = ardeglch(data, inlabels, modelorder, iqrcrit)% labs = arresid(data, inlabels, modelorder, iqrcrit)% identifies outliers in a time series by% looking at the residuals of a forward and% backward AR fit.% Excludes from the fit beats labeled 0 in <inlabels>% iqrcrit gives the criteria in inter-quartile range units% for an outlier.% Returns a vector of the same length as the data which% contains a 0 for any beat marked as bad either in inlabels% or from the AR fit.% [labs,resids] = ardeglch...% gives the actual values of the residuals as an optional second argumentif nargin < 3   modelorder = 3;endif nargin < 4  iqrcrit = 3.5;end% fit the forward modellabforward = arresid(data, inlabels, modelorder);% fit the backward modellabbackward = arresid( data((length(data)):-1:1), inlabels((length(data)):-1:1), modelorder);% take the smaller of the two residuals, remembering% to put labbackward back in forward order.labels = min(labforward, labbackward(length(data):-1:1) );resids = labels;% Compute the interquartile range and limits for outliers.lims = prctile(labels,[25 50 75]);iqrange = lims(3) - lims(1);bottom = lims(1) - iqrange*iqrcrit;top = lims(3) + iqrange*iqrcrit;% bogus points are marked as 666666 in <labels> or as 0 in <inlabels>labs = (labels > bottom & labels < top & labels ~= 666666 & inlabels ~= 0 );

⌨️ 快捷键说明

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