How to assess the similarity of two histograms? Given two histograms, how do we assess whether they are similar or not?
Is it sufficient to simply look at the two histograms?
The simple one to one mapping has the problem that if a histogram is slightly different and slightly shifted then we'll not get the desired result.
Any suggestions?
 A: As David's answer points out, the chi-squared test is necessary for binned data as the KS test assumes continuous distributions. Regarding why the KS test is inappropriate (naught101's comment), there has been some discussion of the issue in the applied statistics literature that is worth raising here. 
An amusing exchange began with the claim (García-Berthou and Alcaraz, 2004) that one third of Nature papers contain statistical errors. However, a subsequent paper (Jeng, 2006, "Error in statistical tests of error in statistical tests" -- perhaps my all-time favorite paper title) showed that Garcia-Berthou and Alcaraz (2005) used KS tests on discrete data, leading to their reporting inaccurate p-values in their meta-study. The Jeng (2006) paper provides a nice discussion of the issue, even showing that one can modify the KS test to work for discrete data. In this specific case, the distinction boils down to the difference between a uniform distribution of the trailing digit on [0,9],
$$
P(x) = \frac{1}{9},\ (0 \leq x \leq 9)
$$
 (in the incorrect KS test) and a comb distribution of delta functions,
$$
P(x) = \frac{1}{10}\sum_{j=0}^9 \delta(x-j)
$$
(in the correct, modified form). As a result of the original error, Garcia-Berthou and Alcaraz (2004) incorrectly rejected the null, while the chi-squared and modified KS test do not. In any case, the chi-squared test is the standard choice in this scenario, even if KS can be modified to work here.
A: There are plenty of distance measures between two histograms. You can read a good categorization of these measures in:

K. Meshgi, and S. Ishii, “Expanding Histogram of Colors with Gridding
to Improve Tracking Accuracy,” in Proc. of MVA’15, Tokyo, Japan, May
2015.

The most popular distance functions are listed here for your convenience:

*

*$L_0$　or Hellinger Distance
$D_{L0} = \sum\limits_{i} h_1(i) \neq h_2(i) $


*$L_1$, Manhattan, or City Block Distance
$D_{L1} = \sum_{i}\lvert h_1(i) - h_2(i) \rvert  $


*$L=2$ or Euclidean Distance
$D_{L2} = \sqrt{\sum_{i}\left( h_1(i) - h_2(i) \right) ^2 }$


*L$_{\infty}$ or Chybyshev Distance
$D_{L\infty} = \max_{i}\lvert h_1(i) - h_2(i) \rvert  $


*L$_p$ or Fractional Distance (part of Minkowski distance family)
$D_{Lp} = \left(\sum\limits_{i}\lvert h_1(i) - h_2(i) \rvert ^p \right)^{1/p}$ and $0<p<1$


*Histogram Intersection
$D_{\cap} = 1 - \frac{\sum_{i} \left(\min(h_1(i),h_2(i) \right)}{\min\left(\vert h_1(i)\vert,\vert h_2(i) \vert \right)}$


*Cosine Distance
$D_{CO} = 1 - \sum_i h_1(i)h2_(i)$


*Canberra Distance
$D_{CB} = \sum_i \frac{\lvert h_1(i)-h_2(i) \rvert}{\min\left( \lvert h_1(i)\rvert,\lvert h_2(i)\rvert  \right)}$


*Pearson's Correlation Coefficient
$ D_{CR} = \frac{\sum_i \left(h_1(i)- \frac{1}{n} \right)\left(h_2(i)- \frac{1}{n} \right)}{\sqrt{\sum_i \left(h_1(i)- \frac{1}{n} \right)^2\sum_i \left(h_2(i)- \frac{1}{n} \right)^2}} $


*Kolmogorov-Smirnov Divergance
$ D_{KS} = \max_{i}\lvert h_1(i) - h_2(i) \rvert  $


*Match Distance
$D_{MA} = \sum\limits_{i}\lvert h_1(i) - h_2(i) \rvert  $


*Cramer-von Mises Distance
$D_{CM} = \sum\limits_{i}\left( h_1(i) - h_2(i) \right)^2$


*$\chi^2$ Statistics
$D_{\chi^2} = \sum_i \frac{\left(h_1(i) - h_2(i)\right)^2}{h_1(i) + h_2(i)}$


*Bhattacharyya Distance
$ D_{BH} = \sqrt{1-\sum_i \sqrt{h_1(i)h_2(i)}} $ & hellinger


*Squared Chord
$ D_{SC} = \sum_i\left(\sqrt{h_1(i)}-\sqrt{h_2(i)}\right)^2 $


*Kullback-Liebler Divergance
$D_{KL} = \sum_i h_1(i)\log\frac{h_1(i)}{m(i)}$


*Jefferey Divergence
$D_{JD} = \sum_i \left(h_1(i)\log\frac{h_1(i)}{m(i)}+h_2(i)\log\frac{h_2(i)}{m(i)}\right)$


*Earth Mover's Distance (this is the first member of Transportation distances that embed binning information $A$ into the distance, for more information please refer to the above mentioned paper or Wikipedia entry.
$ D_{EM} = \frac{\min_{f_{ij}}\sum_{i,j}f_{ij}A_{ij}}{sum_{i,j}f_{ij}}$
$ \sum_j f_{ij} \leq h_1(i) , \sum_j f_{ij} \leq h_2(j) , \sum_{i,j} f_{ij} = \min\left( \sum_i h_1(i) \sum_j h_2(j) \right) $ and $f_{ij}$ represents the flow from $i$ to $j$


*Quadratic Distance
$D_{QU} = \sqrt{\sum_{i,j} A_{ij}\left(h_1(i) - h_2(j)\right)^2}$


*Quadratic-Chi Distance
$D_{QC} = \sqrt{\sum_{i,j} A_{ij}\left(\frac{h_1(i) - h_2(i)}{\left(\sum_c A_{ci}\left(h_1(c)+h_2(c)\right)\right)^m}\right)\left(\frac{h_1(j) - h_2(j)}{\left(\sum_c A_{cj}\left(h_1(c)+h_2(c)\right)\right)^m}\right)}$ and $\frac{0}{0} \equiv 0$
A Matlab implementation of some of these distances is available from my GitHub repository. Also, you can search for people like Yossi Rubner, Ofir Pele, Marco Cuturi, and Haibin Ling for more state-of-the-art distances.
Update: Alternative explanation for the distances appears here and there in the literature, so I list them here for sake of completeness.

*

*Canberra distance (another version)
$D_{CB}=\sum_i \frac{|h_1(i)-h_2(i)|}{|h_1(i)|+|h_2(i)|}$


*Bray-Curtis Dissimilarity, Sorensen Distance (since the sum of histograms are equal to one, it equals to $D_{L0}$)
$D_{BC} = 1 - \frac{2 \sum_i h_1(i) = h_2(i)}{\sum_i h_1(i) + \sum_i h_2(i)}$


*Jaccard Distance (i.e. intersection over union, another version)
$D_{IOU} = 1 - \frac{\sum_i \min(h_1(i),h_2(i))}{\sum_i \max(h_1(i),h_2(i))}$
A: The standard answer to this question is the chi-squared test. The KS test is for unbinned data, not binned data. (If you have the unbinned data, then by all means use a KS-style test, but if you only have the histogram, the KS test is not appropriate.)
A: You're looking for the Kolmogorov-Smirnov test. Don't forget to divide the bar heights by the sum of all observations of each histogram.
Note that the KS-test is also reporting a difference if e.g. the means of the distributions are shifted relative to one another. If translation of the histogram along the x-axis is not meaningful in your application, you may want to subtract the mean from each histogram first. 
A: A recent paper that may be worth reading is:
Cao, Y. Petzold, L. Accuracy limitations and the measurement of errors in the stochastic simulation of chemically reacting systems, 2006.
Although this paper's focus is on comparing stochastic simulation algorithms, essentially the main idea is how to compare two histogram. 
You can access the pdf from the author's webpage.
