24小时热门版块排行榜    

查看: 1054  |  回复: 1

唳天鹄

新虫 (正式写手)

[求助] 求教:如何用matlab求关联维数??? 已有1人参与

菜鸟,什么都不懂,哪位大侠知道,可否给个例子》。。。
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hppdyx

木虫 (知名作家)

【答案】应助回帖

感谢参与,应助指数 +1
你看看这个例子行不行
CODE:
function [ln_r,ln_C]=G_P(data,N,tau,min_m,max_m,ss)
% the function is used to calculate correlation dimention with G-P algorithm
% data:the time series
% N: the length of the time series
% tau: the time delay
% min_m:the least embedded dimention m
% max_m:the largest embedded dimention m
% ss:the stepsize of r
%skyhawk
for m=min_m:max_m
Y=reconstitution(data,N,m,tau);%reconstitute state space
M=N-(m-1)*tau;%the number of points in state space
for i=1:M-1
for j=i+1:M
d(i,j)=max(abs(Y(:,i)-Y(:,j)));%calculate the distance of each two
end %points in state space
end
max_d=max(max(d));%the max distance of all points
d(1,1)=max_d;
min_d=min(min(d));%the min distance of all points
delt=(max_d-min_d)/ss;%the stepsize of r
for k=1:ss
r=min_d+k*delt;
C(k)=correlation_integral(Y,M,r);%calculate the correlation integral
ln_C(m,k)=log(C(k));%lnC(r)
ln_r(m,k)=log(r);%lnr
fprintf('%d/%d/%d/%d\n',k,ss,m,max_m);
end
plot(ln_r(m,:),ln_C(m,:));
hold on;
end
fid=fopen('lnr.txt','w');
fprintf(fid,'%6.2f %6.2f\n',ln_r);
fclose(fid);
fid = fopen('lnC.txt','w');
fprintf(fid,'%6.2f %6.2f\n',ln_C); fclose(fid);

不以风骚惊天下,但求淫荡动世人
2楼2013-12-13 13:06:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 唳天鹄 的主题更新
信息提示
请填处理意见