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

📄 end2end.m

📁 surrogates,替代数据生成算法源码
💻 M
字号:
% Endpoint matching procedure to alleviate bias in FT-based surrogates
%
% Usage: X2 = end2end(X)

function X2 = end2end(X)

if (nargin<1)
	X = [];
end
if (min(size(X))>1)
	error ('Not implemented for multivariate time series');
end

if (length(X)<50)
	X2 = X;
	warning ('Time series is too short for endpoint matching');
	return
end
pp = length(X);

if (abs(X(1)-X(end))>1e-3)
	l = floor(pp/25)+1;
	T1 = X(1:l);
	T2 = X(pp-l+1:pp);
	D_2 = (repmat(T1(:),1,l)-repmat(T2(:)',l,1)).^2;
	[v ind1 ind2] = minmin(D_2);
	if (v>1e-1)
		warning ('Unable to make ends meet');
		X2 = X;
	else
		X2 = X(ind1:pp-l+ind2);
	end
end

⌨️ 快捷键说明

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