cao method code error

6 次查看(过去 30 天)
mirwais
mirwais 2012-5-17
Hi everyone, I'm trying to write this code for finding minimum embedding dimension with Cao method.In spite of working hard, i could't achieve right results or where the error was.Could anyone help me?
x=1:10;
tao=1;
N=length(x);
mmax=3;
for m=1:mmax-1
M=N-m*tao;
Y=psr_deneme(x,m,tao,M);%Phase space reconstruction of time series x Y=Mxm matrix
a=0;
for n=1:M
y0=ones(M,1)*Y(n,:);
distance=max(abs(Y-y0),[],2);
[neardis nearpos]=sort(distance);
newpoint=[Y(n,:) x(n+m*tao)];
newneig=[Y(nearpos(2),:) x(nearpos(2)+m*tao)];
R1=max(abs(newpoint-newneig),[],2);
a=a+R1/neardis(2);
end
E(m)=a/M;
end
E1(m)=E(2:end)/E(1:end-1);
plot(1:length(E1),E1)
  2 个评论
Walter Roberson
Walter Roberson 2012-5-17
What difference do you observe between what you expect and what you observe?
mirwais
mirwais 2012-5-18
I observe a straight line but i expect that the line E1(m) stops changing when m is greater
than some value m0.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Financial Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by