1% sd = EmpiricalSquaredDifference(f1, f2, intBounds)
3% Returns the squared difference of two continuous
4% functions given by samples and the bounds of the
5% corresponding intervalls.
7% This function can be used to characterize the distance
8% between two density functions, distribution functions,
13% f1 : vector, length M
14% Samples of the first continuous function
15% f2 : vector, length M
16% Samples of the second continuous function
17% intBounds : vector, length M+1
18% The bounds of the intervals. The ith sample
19% corresponds to the interval
20% (intbounds(i),intbounds(i+1))
25% The squared difference
27function sd = EmpiricalSquaredDifference (f1, f2, intBounds)
29 intlens = intBounds(2:end) - intBounds(1:end-1);
30 intlens = reshape(intlens, size(f1));
33 sd = SquaredDifference (p1, p2);