about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/KPMstats/chisquared_histo.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/KPMstats/chisquared_histo.m')
-rw-r--r--sourcecodes/bnt-master/KPMstats/chisquared_histo.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/KPMstats/chisquared_histo.m b/sourcecodes/bnt-master/KPMstats/chisquared_histo.m
new file mode 100644
index 00000000..1b649335
--- /dev/null
+++ b/sourcecodes/bnt-master/KPMstats/chisquared_histo.m
@@ -0,0 +1,5 @@
+function s = chisquared_histo(h1, h2)
+% Measure distance between 2 histograms (small numbers means more similar)
+denom = h1 + h2;
+denom = denom + (denom==0);
+s = sum(((h1 - h2) .^ 2) ./ denom);