autocorrelation.m

来自「混沌时间序列预测工具箱」· M 代码 · 共 25 行

M
25
字号
function [tau] = AutoCorrelation(X,maxLags,IsPlot)% 自相关法求混沌时间序列重构的时间延迟% 输入参数:X         混沌时间序列%           maxLags  最大时间延迟% 输出参数:tau     时间延迟 ACF = autocorr(X,maxLags);   % 求自相关函数ACF = ACF(2:end);            % 将第一个 tau=0 的情况去掉   % 自相关函数下降到初始值的 1-1/e 时的 tau 即为所求 (tau 从 1 开始)gate = (1-exp(-1))*ACF(1);temp = find(ACF<=gate);if (isempty(temp))    disp('err: max delay time is too small!')    tau = [];else    tau = temp(1);    endif IsPlot    figure;    plot(1:length(ACF),ACF)    xlabel('Lag');    title('自相关法求时延');end

⌨️ 快捷键说明

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