⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fnn.m

📁 有用的几个动力学物理量。包括自相关函数(acorr.m)
💻 M
字号:
function [p]=fnn(y,de,tau,th,kth);  %function [nfnn]=fnn(y,de,tau,th,kth)%%determine the number of false nearest neighbours for the time%series y embedded in dimension de with lag tau. %%for each pair of values (de,tau) the data y is embeded and the%nearest neighbour to each point (excluding the immediate%neighbourhood of n points) is determined. If the ratio of the%distance of the next (kth) points and these points is greater than%th then they are counted as false nearest neighbours.%% default:% th=5% kth=1%% p(i,j) is the proportion of false nearest neighbours for de(i)% and tau(j).%%Michael Small%3/3/2005%ensmall@polyu.edu.hkif nargin<5,  kth=1;  disp(['th = ',int2str(kth)]);end;if nargin<4,  th=5;  disp(['th = ',int2str(th)]);end;if nargin<3,  tau=firstzero(y);  disp(['tau = ',int2str(tau)]);end;if nargin<2,  de=[1:10];  disp(['de = ',int2str(de(1)),':',int2str(de(end))]);end;p=[];for t=tau,  px=[];  for d=de,    %embed the data    X=embed(y,d,t);    [dx,nx]=size(X);    %find the nearest neighbours of each point    ind=nearest(X(:,1:(nx-kth)),tau); %whooh hooo!        %distance between each point and its nearest neighbour    d0=rms(X(:,(1:(nx-kth)))'-X(:,ind)');    %... and after one time step    d1=rms(X(:,(kth+1):nx)'-X(:,ind+1)');    %exclude any coincident points    d1(d0==0)=[];    d0(d0==0)=[];        %calculate the proportion fnn    ifnn=sum((d1./d0)>th)/length(d0);        %disp    disp(['tau = ', int2str(t),', de = ',int2str(d),', nfnn = ',num2str(ifnn*100),'%']);        px=[px ifnn];  end;    p=[p;px];    end;p=p';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -