
% testing file for lambda computation...
% from Readme file
% 
% input parameters:
%   x: input data
%   m: embedding dimension 
%   L: delay time
%   k: number of iterations
%   w: minimum interval, related to the decorrelation time. Please refer to pages 245, 249-250 of 
%      the book "Multiscale analysis of complex time series --- Integration of Chaos and Random 
%      Fractal Theory, and Beyond" for more details 
%   max_shell: maximum shell 2^(-max_shell)       
%   num_of_shell: number of shells
% 
% output results stored in the variale named "output_result", it has the following format:
%   the first row stores the number of pairs of vectors within each shell
%   the rest rows store the information of Lambda(k) curves
%   each column corresponds to one shell used for computing Time Depedent Exponent (TDE) curves.
% 

% from lambda.m:
%function output_result = lambda(x, m, L, k, w, max_shell, num_of_shell);
%
% input parameters:
%x: input data
%m: embedding dimension 
%L: delay time
%k: number of iterations
%w: minimum interval, related to the decorrelation time. Please refer to

%x=dlmread('cadusd_close.txt');
x=dlmread('dax_1993.txt');
%x=x(1:1000);
m=3; %embedding dimension 
L=1; %delay time
k=100; %number of iterations
w=(m-1)*L; 
% w - minimum interval, related to the decorrelation time. Please refer topages 245, 249-250 of 
%      the book "Multiscale analysis of complex time series --- Integration of Chaos and Random 
%      Fractal Theory, and Beyond" for more details 
max_shell=13; %max_shell: maximum shell 2^(-max_shell)      
num_of_shell=1;%25; %number of shells

output_result = lambda(x, m, L, k, w, max_shell, num_of_shell);
figure;
plot_psic(output_result);
max_orig_scale=max_shell;%???
%figure;
plot_sdle(output_result,max_orig_scale,1);

