|
楼主 |
发表于 2009-8-31 00:42
|
显示全部楼层
function [clutter,sig,neigh_lag,neigh_amount,neigh_num,epsilon]=StateSpaceProject(time_series,dim,delay,...
project_space_vector,eps_min,eps_step,eps_max,neigh_min)
length=max(size(time_series));
Vnum=length-(dim-1)*delay;
for m=1:dim
series_emb(m,1:Vnum)=time_series(1+(m-1)*delay:Vnum+(m-1)*delay);
end
% %%%%%%%
for j=1:Vnum
current_point=series_emb(:,j);
% research neighbour matrix
neigh_amount(j)=0;
neigh_num(1,j)=0;
for eps=eps_min:eps_step:eps_max
epsilon(j)=eps;
for k=1:Vnum
comparing_point=series_emb(:,k);
if k~=j&k~=neigh_num(:,j)
distance=norm(current_point-comparing_point,2);
if distance<eps&abs(k-j)>10 % 限定时间邻近点不被记为相空间邻点
neigh_amount(j)=neigh_amount(j)+1;
neighbour(:,neigh_amount(j),j)=comparing_point;
neigh_num(neigh_amount(j),j)=k;
end
end
end
if neigh_amount(j)>neigh_min
neigh_lag(j)=1;
break;
else if epsilon(j)==eps_max
neigh_lag(j)=0;
end
end
end
% caculate center vector
center_vec=zeros(dim,1);
for k=1:neigh_amount(j)
center_vec=center_vec+neighbour(:,k,j);
end
center_vec=center_vec/neigh_amount(j);
% construct matrix A
for k=1:neigh_amount(j)
if neighbour(:,k,j)==center_vec
neighbour(:,k:neigh_amount(j)-1,j)=neighbour(:,k+1:neigh_amount(j),j);
end
matrix_A(:,k)=(neighbour(:,k,j)-center_vec)/norm(neighbour(:,k,j)-center_vec,2);
end
[u,s,v]=svd(matrix_A);
clear v;
ul(:,project_space_vector)=u(:,project_space_vector);
% u(:,project_space_vector)=[];
if neigh_lag(j)>=0
% project to noise subspace
separated_chaos=center_vec+ul*ul'*(current_point-center_vec);
separated_sig=current_point-separated_chaos;
% separated_sig1=u*u'*(current_point-center_vec);
else
% separated_sig=ul*ul'*(current_point-center_vec);
% separated_chaos=current_point-separated_sig;
end
separated_clutter(:,j)=separated_chaos;
separated_signal(:,j)=separated_sig;
% separated_signal1(:,j)=separated_sig1;
end
temp=zeros(dim,length);
temp1=zeros(dim,length);
% temp2=zeros(dim,length);
%
for k=1:dim
temp(k,1+(k-1)*delay:Vnum+(k-1)*delay)=separated_clutter(k,:);
temp1(k,1+(k-1)*delay:Vnum+(k-1)*delay)=separated_signal(k,:);
% temp2(k,1+(k-1)*delay:Vnum+(k-1)*delay)=separated_signal1(k,:);
end
%
for k=1:dim
clutter((k-1)*delay+1:k*delay)=sum(temp(:,(k-1)*delay+1:k*delay),1)/k;
sig((k-1)*delay+1:k*delay)=sum(temp1(:,(k-1)*delay+1:k*delay),1)/k;
% sig1((k-1)*delay+1:k*delay)=sum(temp2(:,(k-1)*delay+1:k*delay),1)/k;
end
%
clutter(1+(dim-1)*delay:Vnum)=sum(temp(:,1+(dim-1)*delay:Vnum),1)/dim;
sig(1+(dim-1)*delay:Vnum)=sum(temp1(:,1+(dim-1)*delay:Vnum),1)/dim;
% sig1(1+(dim-1)*delay:Vnum)=sum(temp2(:,1+(dim-1)*delay:Vnum),1)/dim;
%
for k=1:dim
kk=dim-k+1;
clutter(length-kk*delay+1:length-(kk-1)*delay)=sum(temp(:,length-kk*delay+1:length-(kk-1)*delay),1)/kk;
sig(length-kk*delay+1:length-(kk-1)*delay)=sum(temp1(:,length-kk*delay+1:length-(kk-1)*delay),1)/kk;
% sig1(length-kk*delay+1:length-(kk-1)*delay)=sum(temp2(:,length-kk*delay+1:length-(kk-1)*delay),1)/kk;
end
这是我在网上找到的程序,但是不知道这个函数中变量的含义,比如[clutter,sig,neigh_lag,neigh_amount,neigh_num,epsilon]=StateSpaceProject(time_series,dim,delay,...
project_space_vector,eps_min,eps_step,eps_max,neigh_min)
time_series是时间序列?dim是相关维?delay是延迟时间,project_space_vector??eps_min,eps_step,eps_max这些是说嵌入维??neigh_min? clutter,sig,neigh_lag,neigh_amount,neigh_num,epsilon? |
|