Zoltan Szabo avatar Zoltan Szabo committed d50e55c

Upper tail dependence via conditional Spearman's rho, multivariate conditional version of Spearman's rho weighting the lower tail: added; see 'ASpearman_U_initialization.m', 'ASpearman_U_estimation.m', 'ASpearman_ut_initialization.m', 'ASpearman_ut_estimation.m'.

Comments (0)

Files changed (18)

+v0.30 (Jan 25, 2012):
+-Upper tail dependence via conditional Spearman's rho: added; see 'ASpearman_U_initialization.m', 'ASpearman_U_estimation.m'.
+-Multivariate conditional version of Spearman's rho weighting the lower tail: added; see 'ASpearman_ut_initialization.m', 'ASpearman_ut_estimation.m'.
+
 v0.29 (Jan 13, 2012):
 -Lower tail dependence via conditional Spearman's rho: added; see 'ASpearman_L_initialization.m', 'ASpearman_L_estimation.m'.
 -Multivariate conditional version of Spearman's rho weighting the lower tail: added; see 'ASpearman_lt_initialization.m', 'ASpearman_lt_estimation.m'.
 - `entropy (H)`: Shannon entropy, Rényi entropy, Tsallis entropy (Havrda and Charvát entropy), complex entropy,
 - `mutual information (I)`: generalized variance, kernel canonical correlation analysis, kernel generalized variance, Hilbert-Schmidt independence criterion, Shannon mutual information, L2 mutual information, Rényi mutual information, Tsallis mutual information, copula-based kernel dependency, multivariate version of Hoeffding's Phi, Schweizer-Wolff's sigma and kappa, complex mutual information, Cauchy-Schwartz quadratic mutual information, Euclidean distance based quadratic mutual information, distance covariance, distance correlation, approximate correntropy independence measure,
 - `divergence (D)`: Kullback-Leibler divergence (relative entropy), L2 divergence, Rényi divergence, Tsallis divergence, Hellinger distance, Bhattacharyya distance, maximum mean discrepancy (kernel distance, an integral probability metric), J-distance (symmetrised Kullback-Leibler divergence), Cauchy-Schwartz divergence, Euclidean distance based divergence, energy distance (specially the Cramer-Von Mises distance),
-- `association measures (A)`, including `measures of concordance`: multivariate extensions of Spearman's rho (Spearman's rank correlation coefficient, grade correlation coefficient), correntropy, centered correntropy, correntropy coefficient, correntropy induced metric, centered correntropy induced metric, multivariate extension of Blomqvist's beta (medial correlation coefficient), multivariate conditional version of Spearman's rho, lower tail dependence via conditional Spearman's rho,
+- `association measures (A)`, including `measures of concordance`: multivariate extensions of Spearman's rho (Spearman's rank correlation coefficient, grade correlation coefficient), correntropy, centered correntropy, correntropy coefficient, correntropy induced metric, centered correntropy induced metric, multivariate extension of Blomqvist's beta (medial correlation coefficient), multivariate conditional version of Spearman's rho, lower/upper tail dependence via conditional Spearman's rho,
 - `cross quantities (C)`: cross-entropy.
 
 ITE offers solution methods for 
 
 **Download** the latest release: 
 
-- code: [zip](https://bitbucket.org/szzoli/ite/downloads/ITE-0.29_code.zip), [tar.bz2](https://bitbucket.org/szzoli/ite/downloads/ITE-0.29_code.tar.bz2), 
-- [documentation (pdf)](https://bitbucket.org/szzoli/ite/downloads/ITE-0.29_documentation.pdf).
+- code: [zip](https://bitbucket.org/szzoli/ite/downloads/ITE-0.30_code.zip), [tar.bz2](https://bitbucket.org/szzoli/ite/downloads/ITE-0.30_code.tar.bz2), 
+- [documentation (pdf)](https://bitbucket.org/szzoli/ite/downloads/ITE-0.30_documentation.pdf).
 
 

code/H_I_D_A_C/base_estimators/ASpearman_ut_estimation.m

+function [A] = ASpearman_ut_estimation(Y,ds,co)
+%Estimates the multivariate conditional version of Spearman's rho; the measure weights the upper tail of the copula. The estimation is based on the empirical copula.
+%
+%We use the naming convention 'A<name>_estimation' to ease embedding new association measure estimator methods.
+%
+%INPUT:
+%   Y: Y(:,t) is the t^th sample.
+%  ds: subspace dimensions.
+%  co: association measure estimator object.
+%
+%REFERENCE:
+%   Friedrich Schmid and Rafael Schmidt. Multivariate conditional versions of Spearman's rho and related measures of tail dependence. Journal of Multivariate Analysis, 98:1123-1140, 2007.
+%   C. Spearman. The proof and measurement of association between two things. The American Journal of Psychology, 15:72-101, 1904.
+%
+%Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
+%
+%This file is part of the ITE (Information Theoretical Estimators) Matlab/Octave toolbox.
+%
+%ITE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+%the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+%
+%This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+%
+%You should have received a copy of the GNU General Public License along with ITE. If not, see <http://www.gnu.org/licenses/>.
+
+%co.mult:OK.
+
+%verification:
+    if sum(ds) ~= size(Y,1);
+        error('The subspace dimensions are not compatible with Y.');
+    end
+    if ~one_dimensional_problem(ds)
+        error('The subspaces must be one-dimensional for this estimator.');
+    end
+    
+[d,num_of_samples] = size(Y); %dimension, number of samples
+U = copula_transformation(Y);
+
+p = co.p;
+
+c = mean(prod(1 - max(U,1-p)));
+c1 = (p*(2-p)/2)^d;
+c2 = p^d * (d+1-p*d) / (d+1);
+
+A = (c-c1) / (c2-c1);
+

code/H_I_D_A_C/base_estimators/ASpearman_ut_initialization.m

+function [co] = ASpearman_ut_initialization(mult)
+%Initialization of the multivariate conditional version of Spearman's rho estimator; the measure weights the upper tail of the copula.
+%
+%Note:
+%   1)The estimator is treated as a cost object (co).
+%   2)We use the naming convention 'A<name>_initialization' to ease embedding new association measure estimator methods.
+%
+%INPUT:
+%   mult: is a multiplicative constant relevant (needed) in the estimation; '=1' means yes, '=0' no.
+%OUTPUT:
+%   co: cost object (structure).
+%
+%Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
+%
+%This file is part of the ITE (Information Theoretical Estimators) Matlab/Octave toolbox.
+%
+%ITE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+%the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+%
+%This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+%
+%You should have received a copy of the GNU General Public License along with ITE. If not, see <http://www.gnu.org/licenses/>.
+
+%mandatory fields:
+    co.name = 'Spearman_ut';
+    co.mult = mult;
+    
+%other fields:
+    co.p = 1/2; %0<p<=1
+    
+   

code/H_I_D_A_C/base_estimators/HRenyi_spacing_E_estimation.m

 
 %verification:
     if d~=1
-        disp('Error: samples must be one-dimensional for this estimator.');
+        error('The samples must be one-dimensional for this estimator.');
     end
     
 m = floor(sqrt(num_of_samples));%m/num_of_samples->0, m,num_of_samples->infty; m<num_of_samples/2

code/H_I_D_A_C/meta_estimators/ASpearman_U_estimation.m

+function [A] = ASpearman_U_estimation(Y,ds,co)
+%Estimates upper tail dependence based on the conditional Spearman's rho.
+%
+%INPUT:
+%   Y: Y(:,t) is the t^th sample.
+%  ds: subspace dimensions.
+%  co: association measure estimator object.
+%
+%Note:
+%   1)We use the naming convention 'A<name>_estimation' to ease embedding new association measure estimator methods.
+%   2)This is a meta method: the conditional Spearman's rho estimator (of upper tail) can be arbitrary.
+%
+%REFERENCE:
+%   Friedrich Schmid and Rafael Schmidt. Multivariate conditional versions of Spearman's rho and related measures of tail dependence. Journal of Multivariate Analysis, 98:1123-1140, 2007.
+%   C. Spearman. The proof and measurement of association between two things. The American Journal of Psychology, 15:72-101, 1904.
+%
+%Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
+%
+%This file is part of the ITE (Information Theoretical Estimators) Matlab/Octave toolbox.
+%
+%ITE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+%the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+%
+%This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+%
+%You should have received a copy of the GNU General Public License along with ITE. If not, see <http://www.gnu.org/licenses/>.
+
+%co.mult:OK.
+
+%verification:
+    if sum(ds) ~= size(Y,1);
+        error('The subspace dimensions are not compatible with Y.');
+    end
+    if ~one_dimensional_problem(ds)
+        error('The subspaces must be one-dimensional for this estimator.');
+    end
+
+%p:    
+    num_of_samples = size(Y,2);
+    k = floor(sqrt(num_of_samples));
+    co.member_co.p = k/num_of_samples; %set p
+
+A = A_estimation(Y,ds,co.member_co);
+

code/H_I_D_A_C/meta_estimators/ASpearman_U_initialization.m

+function [co] = ASpearman_U_initialization(mult)
+%Initialization of the upper tail dependence estimator based on the conditional Spearman's rho.
+%
+%Note:
+%   1)The estimator is treated as a cost object (co).
+%   2)We use the naming convention 'A<name>_initialization' to ease embedding new association measure estimator methods.
+%
+%INPUT:
+%   mult: is a multiplicative constant relevant (needed) in the estimation; '=1' means yes, '=0' no.
+%OUTPUT:
+%   co: cost object (structure).
+%
+%Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
+%
+%This file is part of the ITE (Information Theoretical Estimators) Matlab/Octave toolbox.
+%
+%ITE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+%the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+%
+%This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+%
+%You should have received a copy of the GNU General Public License along with ITE. If not, see <http://www.gnu.org/licenses/>.
+
+%mandatory fields:
+    co.name = 'Spearman_U';
+    co.mult = mult;
+    
+%other fields:
+    co.member_name = 'Spearman_ut'; %you can change it to any conditional Spearman's rho (of upper tail) estimator
+    co.member_co = A_initialization(co.member_name,mult);
+   

code/IPA/data_generation/datasets/sample_subspaces.m

                   %'multi3-geom','multi2-3-geom', 'multi6-spherical', 'multi3-4-spherical'
             k = k_separate_all_k_independent(data_type); %test for 'all-k-independent'
             if ~isempty(k) %found a k value, which is supposed to be >=2.
-                disp('all-k-independent');
+                %disp('all-k-independent');
                 [e,de] = sample_subspaces_all_k_independent(num_of_comps,num_of_samples,k);
             else
                 de = de_separate_multiD_geom(data_type);%test for 'multiD-geom' and 'multiD1-D2-...-DM-geom'
         st_temp = st_d(I_minus(k-1)+1:I_minus(k)-1);
         de(k-1) = str2num(st_d(I_minus(k-1)+1:I_minus(k)-1));
     end
-end
+end

code/IPA/data_generation/datasets/sample_subspaces_3D_geom.m

 max_num_of_comps = 6;
 
 if num_of_comps > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     e = zeros(3*num_of_comps,num_of_samples);%preallocation
     for k = 1 : num_of_comps

code/IPA/data_generation/datasets/sample_subspaces_IFS.m

 max_num_of_comps = 9;
 
 if num_of_comps > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     e = zeros(2*num_of_comps,num_of_samples);%preallocation
     for k = 1 : num_of_comps

code/IPA/data_generation/datasets/sample_subspaces_alphabet.m

 max_num_of_comps = length(symbols);
 
 if num_of_comps > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     e = zeros(2*num_of_comps,num_of_samples);
     for k = 1 : num_of_comps %actual symbol we are generating (x,y) samples from
             e(2*k-1:2*k,:) = e_temp;
     end
     de = 2 * ones(num_of_comps,1);
-end
+end

code/IPA/data_generation/datasets/sample_subspaces_lorenz.m

 max_num_of_comps = 3;
 
 if num_of_comps > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     %query for the current working environment:
         environment_Matlab = working_environment_Matlab;

code/IPA/data_generation/datasets/sample_subspaces_mosaic.m

 max_num_of_comps = 4;
 
 if num_of_comps > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     e = zeros(2*num_of_comps,num_of_samples);%preallocation
     S = 100; %the images are of size SxS    
 %---------------------
 function [P] = image2density(I)
 P = I - min(min(I));
-P = P / sum(sum(P));
+P = P / sum(sum(P));

code/IPA/data_generation/datasets/sample_subspaces_multiD_geom.m

 max_num_of_comps = 4;
 
 if length(de) > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     e = zeros(sum(de),num_of_samples);%preallocation
     start_idx = 1;

code/IPA/data_generation/datasets/sample_subspaces_multiD_spherical.m

 max_num_of_comps = 3; 
 
 if length(de) > max_num_of_comps 
-    disp(strcat('Error: number of components must be <=',num2str(max_num_of_comps),'.'));
+    error(strcat('The number of components must be <=',num2str(max_num_of_comps),'.'));
 else
     e = zeros(sum(de),num_of_samples); %preallocation    
     start_idx = 1;    

code/IPA/optimization/clustering_UD0_CE_general.m

 %INPUT:
 % s_ICA: s_ICA(:,t) is the t^th estimated realization of the ICA sources.
 %    ds: subspace dimensions.
-%    co: is the initialized cost object (entropy/mutual informator).
+%    co: is the initialized cost object (entropy/mutual information).
 %OUTPUT:
 %   perm_ICA: permutation of the ICA elements.
 %
 %REFERENCE:
 %   Zoltan Szabo, Barnabas Poczos, Andras Lorincz: Cross-Entropy Optimization for Independent Process Analysis. ICA 2006, pages 909-916. (adaptation to the ISA problem)
-%   Reuven Y. Rubinstein, Dirk P. Kroese. The Cross-Entropy Method. Springer, 2004. (TSP problem; TSP=travelling salesman problem)
+%   Reuven Y. Rubinstein, Dirk P. Kroese. The Cross-Entropy Method. Springer, 2004. (approximation of TSP (travelling salesman problem) via CE)
 %
 %Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
 %

code/IPA/optimization/clustering_UD0_greedy_additive_wrt_subspaces.m

 %INPUT:
 % s_ICA: s_ICA(:,t) is the t^th estimated realization of the ICA sources.
 %    ds: subspace dimensions.
-%    co: is the initialized cost object (entropy/mutual informator).
+%    co: is the initialized cost object (entropy/mutual information).
 %OUTPUT:
 %   per: permutation of the ICA elements.
 %

code/IPA/optimization/clustering_UD0_greedy_general.m

 %INPUT:
 % s_ICA: s_ICA(:,t) is the t^th estimated realization of the ICA sources.
 %    ds: subspace dimensions.
-%    co: is the initialized cost object (entropy/mutual informator).
+%    co: is the initialized cost object (entropy/mutual information).
 %OUTPUT:
 %   per: permutation of the ICA elements.
 %
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.