xintaow 发表于 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

xintaow 发表于 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

3QMM 发表于 2008-3-2 17:26

是啊,没有reconstitution和correlation_integral等于没有给

buiesea 发表于 2008-3-26 11:06

时间延迟tau用什么方法算得啊?有相关程序吗?

shuilan1984ly 发表于 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

berya 发表于 2009-3-8 21:55

回复 7楼 realhappy 的帖子

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

我调试了一下还是这样的,求大牛帮忙!

francisca 发表于 2010-2-25 13:37

function C_I=correlation_integral(X,M,r)
有一点小问题,
需要把sita=heaviside(r,d), 改成sita=heaviside(r-d);
就可以运行了

guofengfirst 发表于 2010-10-20 16:30

什么国外的源代码 上当

zhenxing2000 发表于 2011-1-7 13:50

先看看程序能否运行

zhenxing2000 发表于 2011-1-7 14:29

??? Undefined function or variable "ln_r".

Error in ==> G_P at 36
plot(ln_r(m,:),ln_C(m,:));
这个错误该怎样修改?

ChaChing 发表于 2011-1-7 22:18

回复 25 # zhenxing2000 的帖子

常见的程序出错问题整理 (eight), 3F
http://forum.vibunion.com/forum/thread-46001-1-1.html

sjdwjt 发表于 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;
页: 1 [2]
查看完整版本: 求计算关联维数的MATLAB程序