声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: ndhutu

[综合讨论] 求计算关联维数的MATLAB程序

[复制链接]
发表于 2007-7-5 11:35 | 显示全部楼层
function C_I=correlation_integral(X,M,r)
%the function is used to calculate correlation integral
%C_I:the value of the correlation integral
%X:the reconstituted state space,M is a m*M matrix
%m:the embedding demention
%M:M is the number of embedded points in m-dimensional space
%r:the radius of the Heaviside function,sigma/2<r<2sigma
%calculate the sum of all the values of Heaviside
%skyhawk
sum_H=0;
for i=1:M
fprintf('%d/%d\n',i,M);
for j=i+1:M
d=norm((X(:,i)-X(:,j)),inf);%calculat the distances of each two points in matris M with sup-norm
sita=heaviside(r,d);%calculate the value of the heaviside function
sum_H=sum_H+sita;
end
end
C_I=2*sum_H/(M*(M-1));%the value of correlation integral
回复 支持 反对
分享到:

使用道具 举报

发表于 2007-7-5 11:36 | 显示全部楼层

这样就可以运行了

function X=reconstitution(data,N,m,tau)
%该函数用来重构相空间
% m 为嵌入空间维数
% tau 为时间延迟
% data 为输入时间序列
% N 为时间序列长度
% X 为输出,是m*n 维矩阵
M=N-(m-1)*tau;%相空间中点的个数
for j=1:M %相空间重构
for i=1:m
X(i,j)=data((i-1)*tau+j);
end
end
发表于 2008-3-2 17:26 | 显示全部楼层
是啊,没有reconstitution和correlation_integral等于没有给
发表于 2008-3-26 11:06 | 显示全部楼层
时间延迟tau用什么方法算得啊?有相关程序吗?
发表于 2008-11-12 11:44 | 显示全部楼层
我用了correlation_integral函数,但是出现错误??? Undefined function or variable 'heaviside'.

Error in ==> D:\Program Files\matlab\work\correlation_integral.m
On line 15  ==>         sita=heaviside(r,d);%calculate the value of the heaviside function

Error in ==> D:\Program Files\matlab\work\G.m
On line 326  ==> C(k)=correlation_integral(Y,M,r);%calculate the correlation integral
发表于 2009-3-8 21:55 | 显示全部楼层

回复 7楼 realhappy 的帖子

Error in ==> G_P at 29
plot(ln_r(m,:),ln_C(m,:));

我调试了一下还是这样的,求大牛帮忙!
发表于 2010-2-25 13:37 | 显示全部楼层
function C_I=correlation_integral(X,M,r)
有一点小问题,
需要把sita=heaviside(r,d), 改成sita=heaviside(r-d);
就可以运行了
发表于 2010-10-20 16:30 | 显示全部楼层
什么国外的源代码 上当
发表于 2011-1-7 13:50 | 显示全部楼层
先看看程序能否运行
发表于 2011-1-7 14:29 | 显示全部楼层
??? Undefined function or variable "ln_r".

Error in ==> G_P at 36
plot(ln_r(m,:),ln_C(m,:));
这个错误该怎样修改?
发表于 2011-1-7 22:18 | 显示全部楼层
回复 25 # zhenxing2000 的帖子

常见的程序出错问题整理 (eight), 3F
http://forum.vibunion.com/forum/thread-46001-1-1.html
发表于 2012-7-26 11:50 | 显示全部楼层
matlab官网找了一个heaviside的程序

function H=heaviside(z)
% Heaviside step function (smoothed version)
% Copyright (c) 2009,
% Yue Wu @ ECE Department, Tufts University
% All Rights Reserved  

Epsilon=10^(-5);
H=zeros(size(z,1),size(z,2));
idx1=find(z>Epsilon);
idx2=find(z<Epsilon & z>-Epsilon);
H(idx1)=1;
for i=1:length(idx2)
    H(idx2(i))=1/2*(1+z(idx2(i))/Epsilon+1/pi*sin(pi*z(idx2(i))/Epsilon));
end;
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-20 13:42 , Processed in 0.056348 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表