cao method code error

1 view (last 30 days)
mirwais
mirwais on 17 May 2012
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 Comments
Walter Roberson
Walter Roberson on 17 May 2012
What difference do you observe between what you expect and what you observe?
mirwais
mirwais on 18 May 2012
I observe a straight line but i expect that the line E1(m) stops changing when m is greater
than some value m0.

Sign in to comment.

Answers (0)

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!