Skip to content
Snippets Groups Projects
Commit 8f587879 authored by marwan's avatar marwan
Browse files

added embedding delay

parent f3f348f7
No related branches found
No related tags found
No related merge requests found
...@@ -6,11 +6,14 @@ function out=fnn(varargin) ...@@ -6,11 +6,14 @@ function out=fnn(varargin)
% Y=FNN(X,M), where M is a scalar, computes the FNN up to dimension M. % Y=FNN(X,M), where M is a scalar, computes the FNN up to dimension M.
% The defeault is M=10. % The defeault is M=10.
% %
% Y=FNN(X,M,R,S), where R and S are scalars, applies the neighbourhood % Y=FNN(X,M,T), where T is a scalar, computes the FNN using delay T.
% The defeault is T=1.
%
% Y=FNN(X,M,T,R,S), where R and S are scalars, applies the neighbourhood
% criterion R and the size of the neighbourhood S. The defeault is R=2 % criterion R and the size of the neighbourhood S. The defeault is R=2
% and S=Inf. % and S=Inf.
% %
% Y=FNN(X,M,R,S,N), where N is a scalar, uses N random samples for % Y=FNN(X,M,T,R,S,N), where N is a scalar, uses N random samples for
% the determination of the FNNs. This speeds up the estimation, % the determination of the FNNs. This speeds up the estimation,
% especially for long data series. The defeault is N=length(X) if % especially for long data series. The defeault is N=length(X) if
% the data length is smaller than 500, else N=200. % the data length is smaller than 500, else N=200.
...@@ -31,7 +34,7 @@ function out=fnn(varargin) ...@@ -31,7 +34,7 @@ function out=fnn(varargin)
% below). % below).
% %
% Examples: x = sin(0:.2:8*pi)' + .1*randn(126,1); % Examples: x = sin(0:.2:8*pi)' + .1*randn(126,1);
% fnn(x,10,5) % fnn(x,10,[],5)
% %
% See also PHASESPACE, PSS, MI. % See also PHASESPACE, PSS, MI.
% %
...@@ -48,6 +51,9 @@ function out=fnn(varargin) ...@@ -48,6 +51,9 @@ function out=fnn(varargin)
% $Revision$ % $Revision$
% %
% $Log$ % $Log$
% Revision 5.2 2007/05/15 17:33:13 marwan
% new neighbourhood criterion: fixed RR
%
% Revision 5.1 2006/10/24 14:17:47 marwan % Revision 5.1 2006/10/24 14:17:47 marwan
% *** empty log message *** % *** empty log message ***
% %
...@@ -74,7 +80,7 @@ if nargout>2, error('Too many output arguments'), end ...@@ -74,7 +80,7 @@ if nargout>2, error('Too many output arguments'), end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% splash the GPL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% splash the GPL
splash_gpl('fnn'); splash_gpl('crp');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% error control %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% error control
try try
...@@ -86,6 +92,7 @@ set(0,'ShowHidden','on') ...@@ -86,6 +92,7 @@ set(0,'ShowHidden','on')
delete(findobj('Tag','msgbox')) delete(findobj('Tag','msgbox'))
nogui=0; nogui=0;
maxM_init = 10; maxM_init = 10;
t = 1;
maxM=maxM_init; % maximal dimension maxM=maxM_init; % maximal dimension
r_init = 10; r_init = 10;
r=r_init; % r-criterion for neighbours distance r=r_init; % r-criterion for neighbours distance
...@@ -109,16 +116,22 @@ if nargin & isnumeric(varargin{1}) ...@@ -109,16 +116,22 @@ if nargin & isnumeric(varargin{1})
maxM = varargin{i_x}; maxM = varargin{i_x};
case 2 case 2
maxM = varargin{i_x(1)}; maxM = varargin{i_x(1)};
r = varargin{i_x(2)}; t = varargin{i_x(2)};
case 3 case 3
maxM = varargin{i_x(1)}; maxM = varargin{i_x(1)};
r = varargin{i_x(2)}; t = varargin{i_x(2)};
s = varargin{i_x(3)}; r = varargin{i_x(3)};
case 4 case 4
maxM = varargin{i_x(1)}; maxM = varargin{i_x(1)};
r = varargin{i_x(2)}; r = varargin{i_x(2)};
s = varargin{i_x(3)}; t = varargin{i_x(3)};
maxN = varargin{i_x(4)}; s = varargin{i_x(4)};
case 5
maxM = varargin{i_x(1)};
r = varargin{i_x(2)};
t = varargin{i_x(3)};
s = varargin{i_x(4)};
maxN = varargin{i_x(5)};
end end
% check the char input % check the char input
...@@ -159,6 +172,8 @@ elseif nargin & ischar(varargin{1}) & ~isempty(varargin{1}) ...@@ -159,6 +172,8 @@ elseif nargin & ischar(varargin{1}) & ~isempty(varargin{1})
N=size(x,2); N=size(x,2);
h=findobj('Tag','maxM'); h=findobj('Tag','maxM');
maxM=str2num(get(h(1),'String')); maxM=str2num(get(h(1),'String'));
h=findobj('Tag','delay');
t=str2num(get(h(1),'String'));
h=findobj('Tag','r'); h=findobj('Tag','r');
r=str2num(get(h(1),'String')); r=str2num(get(h(1),'String'));
h=findobj('Tag','s'); h=findobj('Tag','s');
...@@ -174,7 +189,7 @@ end ...@@ -174,7 +189,7 @@ end
if ~nargin if ~nargin
x=sin(0:.2:8*pi)'+.1*randn(126,1); x=sin(0:.2:8*pi)'+.1*randn(126,1);
maxM=10; maxM=10; t = 1;
r=5; s = Inf; r=5; s = Inf;
nogui=0; nogui=0;
else else
...@@ -228,7 +243,7 @@ case 'init' ...@@ -228,7 +243,7 @@ case 'init'
end end
h=axes(props.axes,... h=axes(props.axes,...
'Position',[89 24.8 6.8 3.5]); 'Position',[89 24.8+.5 6.8 3.5]);
logo=load('logo'); logo=load('logo');
h2=imagesc([logo.logo fliplr(logo.logo)]); h2=imagesc([logo.logo fliplr(logo.logo)]);
set(h2,'Tag','uniLogo') set(h2,'Tag','uniLogo')
...@@ -236,7 +251,7 @@ case 'init' ...@@ -236,7 +251,7 @@ case 'init'
h=uicontrol(props.text,... h=uicontrol(props.text,...
'Tag','text_logo',... 'Tag','text_logo',...
'String','Uni Potsdam',... 'String','Uni Potsdam',...
'Position',[97 24.2143 23 3.5714]); 'Position',[97 24.2143+.5 23 3.5714]);
h2=textwrap(h,{[char(169),' AGNLD'],'University of Potsdam','2006'}); h2=textwrap(h,{[char(169),' AGNLD'],'University of Potsdam','2006'});
set(h,'String',h2) set(h,'String',h2)
...@@ -248,68 +263,80 @@ case 'init' ...@@ -248,68 +263,80 @@ case 'init'
% frame around parameter settings % frame around parameter settings
h=uicontrol(props.frame,... h=uicontrol(props.frame,...
'Tag','frame',... 'Tag','frame',...
'Position',[91.5000 1.3571 23.5000 21.5]); 'Position',[91.5000 1.3571 23.5000 22.8]);
% dimension % dimension
h=uicontrol(props.text,... h=uicontrol(props.text,...
'Tag','text',... 'Tag','text',...
'String','Max. Dim.',... 'String','Max. Dim.',...
'Position',[93.8333 20.3 14 1.5000]); 'Position',[93.8333 22.3-.6 14 1.5000]);
h=uicontrol(props.edit,... h=uicontrol(props.edit,...
'Tag','maxM',... 'Tag','maxM',...
'String',num2str(maxM),... 'String',num2str(maxM),...
'ToolTip','False nearest neighbours will be computed up to this dimension.',... 'ToolTip','False nearest neighbours will be computed up to this dimension.',...
'Position',[105.1666 20.55 6.5 1.5000]); 'Position',[105.1666 22.55-.6 6.5 1.5000]);
% delay
h=uicontrol(props.text,...
'Tag','text',...
'String','Delay',...
'Position',[93.8333 20.3-.6 14 1.5000]);
h=uicontrol(props.edit,...
'Tag','delay',...
'String',num2str(t),...
'ToolTip','Delay for embedding.',...
'Position',[105.1666 20.55-.6 6.5 1.5000]);
% falseness criterion % falseness criterion
h=uicontrol(props.text,... h=uicontrol(props.text,...
'Tag','text',... 'Tag','text',...
'String','Falseness',... 'String','Falseness',...
'Position',[93.8333 18.3 20.5 1.5000]); 'Position',[93.8333 18.3-.6 20.5 1.5000]);
h=uicontrol(props.edit,... h=uicontrol(props.edit,...
'Tag','r',... 'Tag','r',...
'String',num2str(r),... 'String',num2str(r),...
'ToolTip','Criterion value (suggested: >1).',... 'ToolTip','Criterion value (suggested: >1).',...
'Position',[105.1666 18.55 6.5 1.5000]); 'Position',[105.1666 18.55-.6 6.5 1.5000]);
% neigbourhood range % neigbourhood range
h=uicontrol(props.text,... h=uicontrol(props.text,...
'Tag','text',... 'Tag','text',...
'String','Neigbourh.',... 'String','Neigbourh.',...
'Position',[93.8333 16.3 20.5 1.5000]); 'Position',[93.8333 16.3-.6 20.5 1.5000]);
h=uicontrol(props.edit,... h=uicontrol(props.edit,...
'Tag','s',... 'Tag','s',...
'String',num2str(s),... 'String',num2str(s),...
'ToolTip','Maximal distance between neighbours (in multiples of standard deviation).',... 'ToolTip','Maximal distance between neighbours (in multiples of standard deviation).',...
'Position',[105.1666 16.55 6.5 1.5000]); 'Position',[105.1666 16.55-.6 6.5 1.5000]);
% norm % norm
h=uicontrol(props.text,... h=uicontrol(props.text,...
'Tag','text',... 'Tag','text',...
'String','Norm',... 'String','Norm',...
'Position',[93.8333 14.1 15 1.5000]); 'Position',[93.8333 13.7 15 1.5000]);
h=uicontrol(props.popup,... h=uicontrol(props.popup,...
'Tag','method',... 'Tag','method',...
'String','Max|Euc|Min',... 'String','Max|Euc|Min',...
'Value',method,... 'Value',method,...
'ToolTip','Norm used for the computation of the distance.',... 'ToolTip','Norm used for the computation of the distance.',...
'Position',[101.1666 14.35 10.5 1.5000]); 'Position',[101.1666 13.95 10.5 1.5000]);
% number of samples % number of samples
h=uicontrol(props.text,... h=uicontrol(props.text,...
'Tag','text',... 'Tag','text',...
'String','Number of samples',... 'String','Number of samples',...
'Position',[93.8333 11.75+.4 19 1.5000]); 'Position',[93.8333 11.75+.2 19 1.5000]);
h=uicontrol(props.edit,... h=uicontrol(props.edit,...
'Tag','maxN',... 'Tag','maxN',...
'String',num2str(maxN),... 'String',num2str(maxN),...
'ToolTip','Number of randomly chosen samples.',... 'ToolTip','Number of randomly chosen samples.',...
'Position',[93.8333 10.5+.4 17.8333 1.5000]); 'Position',[93.8333 10.5+.2 17.8333 1.5000]);
% buttons % buttons
...@@ -441,7 +468,6 @@ case 'compute' ...@@ -441,7 +468,6 @@ case 'compute'
end end
FNN(m,1) = 0; FNN(m,1) = 0;
t=1;
NX=N-t*(m-1); NX=N-t*(m-1);
% create phase space vectors % create phase space vectors
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment