1. Zoltán Szabó
  2. ITE

Source

ITE / code / H_I_D_A_C / utilities / estimate_Dtemp1.m

Diff from to

File code/H_I_D_A_C/utilities/estimate_Dtemp1.m

  • Ignore whitespace
 function [Dtemp1] = estimate_Dtemp1(X,Y,co)
-%Estimates Dtemp1 = \int p^{\alpha}(x)q^{1-\alpha}(x)dx, the Renyi and the Tsallis divergences are simple functions of this quantity.
+%Estimates Dtemp1 = \int p^{\alpha}(u)q^{1-\alpha}(u)du, the Renyi and the Tsallis divergences are simple functions of this quantity.
 %
 %INPUT:
-%   X: X(:,t) is the t^th sample from the first distribution.
-%   Y: Y(:,t) is the t^th sample from the second distribution.
+%   X: X(:,t) is the t^th sample from the first distribution (X~p).
+%   Y: Y(:,t) is the t^th sample from the second distribution (Y~q).
 %  co: cost object (structure).
 %
 %Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
 %
 %You should have received a copy of the GNU General Public License along with ITE. If not, see <http://www.gnu.org/licenses/>.
 
-[d,num_of_samplesY] = size(Y);
-[d,num_of_samplesX] = size(X);
+%initialization:
+    [dY,num_of_samplesY] = size(Y);
+    [dX,num_of_samplesX] = size(X);
+
+%verification:
+    if dX~=dY
+        error('The dimension of the samples in X and Y must be equal.');
+    end
+
+%initialization - continued:
+    d = dX; %=dY
 
 squared_distancesXX = kNN_squared_distances(X,X,co,1);
 squared_distancesYX = kNN_squared_distances(Y,X,co,0);