|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
下面是经常使用的小数据量法程序,对于参数ts,注释里写是Sampling frequence,但程序里唯一用到这个参数的地方是:Y=aver_j_for_i/ts;
疑问是:求取李氏指数是根据Y序列的斜率的,而这里ts如果改变的话,岂不是直接影响了李氏指数的大小?请问ts的赋值依据是什么?即赋多大?
function [lyap_rosenstein,X,Y]=lyapunov_rosenstein(x,m,t,ts)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x----time series coloum format,!!!!Remember: in coloum format
% m----embedding dimension
% t----time delay
% ts---Sampling frequence
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%时间序列的平均周期,可以通过能量光谱平均频率的倒数估计出来,即功率谱法。
% 所以先对序列进行FFT
P=FFT_circletime(x);
% P=60;
Y=reconstitution(x,length(x),m,t);
M=length(x)-(m-1)*t;
Y=Y';
%找相空间中每个点的最近邻点(限制短暂分离P)
for i=1:M
%Calculate original distance
count_refer=1;
Refer=Y(i,:);
for j=1:M
if abs(j-i)<P %限制短暂分离
continue;
end
dist(count_refer)=norm(Refer-Y(j,:),2);
index_count_refer(count_refer)=j;
count_refer=count_refer+1;
end
[dist,h]=sort(dist); %升序排序,返回值分别是:排序后的向量和索引
Dist0(i)=dist(1); %取最小距离,即最近邻点
Index_Neighbor(i)=index_count_refer(h(1));
end
%对相空间中的每个相点,计算出该邻域点对(即该点与其最近邻点)的i个离散时间步后的距离
for j=1:M
for i=1:min(M-j,M-Index_Neighbor(j))
orignal_point_i=Y(j+i,:);
neighbor_point_i=Y(Index_Neighbor(j)+i,:);
dist1_k(j,i)=norm(orignal_point_i-neighbor_point_i,inf);% distance accordingly
end
end
% 对上述的第1个离散步、第2个离散步...第i个离散步的ln(dist1_k)的平均值
[row,col]=size(dist1_k);
for i=1:col
cout_j_for_i=1;
sum_j_for_i=0;
for j=1:row
if dist1_k(j,i)~=0
sum_j_for_i=sum_j_for_i+log(dist1_k(j,i));
cout_j_for_i=cout_j_for_i+1;
end
end
aver_j_for_i(i)=sum_j_for_i/cout_j_for_i;
end
%用最小二乘拟合直线,斜率即为最大lyapunov指数
X=1:col;
Y=aver_j_for_i/ts;
figure;
plot(1:length(Y),Y);
grid on;
xlabel('i');
ylabel('lyapunov(i)');
title('lyapunov指数');
|
|