<s>
A	O
histogram	B-Algorithm
is	O
an	O
approximate	O
representation	O
of	O
the	O
distribution	O
of	O
numerical	O
data	O
.	O
</s>
<s>
To	O
construct	O
a	O
histogram	B-Algorithm
,	O
the	O
first	O
step	O
is	O
to	O
"	O
bin	B-General_Concept
"	O
(	O
or	O
"	O
bucket	B-General_Concept
"	O
)	O
the	O
range	O
of	O
values	O
—	O
that	O
is	O
,	O
divide	O
the	O
entire	O
range	O
of	O
values	O
into	O
a	O
series	O
of	O
intervals	O
—	O
and	O
then	O
count	O
how	O
many	O
values	O
fall	O
into	O
each	O
interval	O
.	O
</s>
<s>
If	O
the	O
bins	O
are	O
of	O
equal	O
size	O
,	O
a	O
bar	O
is	O
drawn	O
over	O
the	O
bin	B-General_Concept
with	O
height	O
proportional	O
to	O
the	O
frequency	O
—	O
the	O
number	O
of	O
cases	O
in	O
each	O
bin	B-General_Concept
.	O
</s>
<s>
A	O
histogram	B-Algorithm
may	O
also	O
be	O
normalized	O
to	O
display	O
"	O
relative	O
"	O
frequencies	O
showing	O
the	O
proportion	O
of	O
cases	O
that	O
fall	O
into	O
each	O
of	O
several	O
categories	O
,	O
with	O
the	O
sum	O
of	O
the	O
heights	O
equaling	O
1	O
.	O
</s>
<s>
However	O
,	O
bins	O
need	O
not	O
be	O
of	O
equal	O
width	O
;	O
in	O
that	O
case	O
,	O
the	O
erected	O
rectangle	O
is	O
defined	O
to	O
have	O
its	O
area	O
proportional	O
to	O
the	O
frequency	O
of	O
cases	O
in	O
the	O
bin	B-General_Concept
.	O
</s>
<s>
Examples	O
of	O
variable	O
bin	B-General_Concept
width	O
are	O
displayed	O
on	O
Census	O
bureau	O
data	O
below	O
.	O
</s>
<s>
As	O
the	O
adjacent	O
bins	O
leave	O
no	O
gaps	O
,	O
the	O
rectangles	O
of	O
a	O
histogram	B-Algorithm
touch	O
each	O
other	O
to	O
indicate	O
that	O
the	O
original	O
variable	O
is	O
continuous	O
.	O
</s>
<s>
Histograms	B-Algorithm
give	O
a	O
rough	O
sense	O
of	O
the	O
density	O
of	O
the	O
underlying	O
distribution	O
of	O
the	O
data	O
,	O
and	O
often	O
for	O
density	B-General_Concept
estimation	I-General_Concept
:	O
estimating	O
the	O
probability	O
density	B-General_Concept
function	I-General_Concept
of	O
the	O
underlying	O
variable	O
.	O
</s>
<s>
The	O
total	O
area	O
of	O
a	O
histogram	B-Algorithm
used	O
for	O
probability	O
density	O
is	O
always	O
normalized	O
to	O
1	O
.	O
</s>
<s>
If	O
the	O
length	O
of	O
the	O
intervals	O
on	O
the	O
x-axis	O
are	O
all	O
1	O
,	O
then	O
a	O
histogram	B-Algorithm
is	O
identical	O
to	O
a	O
relative	O
frequency	O
plot	O
.	O
</s>
<s>
The	O
histogram	B-Algorithm
is	O
one	O
of	O
the	O
seven	O
basic	O
tools	O
of	O
quality	O
control	O
.	O
</s>
<s>
Histograms	B-Algorithm
are	O
sometimes	O
confused	O
with	O
bar	B-Application
charts	I-Application
.	O
</s>
<s>
A	O
histogram	B-Algorithm
is	O
used	O
for	O
continuous	O
data	O
,	O
where	O
the	O
bins	O
represent	O
ranges	O
of	O
data	O
,	O
while	O
a	O
bar	B-Application
chart	I-Application
is	O
a	O
plot	O
of	O
categorical	O
variables	O
.	O
</s>
<s>
Some	O
authors	O
recommend	O
that	O
bar	B-Application
charts	I-Application
have	O
gaps	O
between	O
the	O
rectangles	O
to	O
clarify	O
the	O
distinction	O
.	O
</s>
<s>
A	O
bar	B-Application
graph	I-Application
and	O
a	O
histogram	B-Algorithm
are	O
two	O
common	O
types	O
of	O
graphical	O
representations	O
of	O
data	O
.	O
</s>
<s>
A	O
bar	B-Application
graph	I-Application
is	O
a	O
chart	O
that	O
uses	O
bars	O
to	O
represent	O
the	O
frequency	O
or	O
quantity	O
of	O
different	O
categories	O
of	O
data	O
.	O
</s>
<s>
Bar	B-Application
graphs	I-Application
are	O
useful	O
for	O
displaying	O
data	O
that	O
can	O
be	O
divided	O
into	O
discrete	O
categories	O
,	O
such	O
as	O
the	O
number	O
of	O
students	O
in	O
different	O
grade	O
levels	O
at	O
a	O
school	O
.	O
</s>
<s>
A	O
histogram	B-Algorithm
,	O
on	O
the	O
other	O
hand	O
,	O
is	O
a	O
graph	O
that	O
shows	O
the	O
distribution	O
of	O
numerical	O
data	O
.	O
</s>
<s>
It	O
is	O
a	O
type	O
of	O
bar	B-Application
chart	I-Application
that	O
shows	O
the	O
frequency	O
or	O
number	O
of	O
observations	O
within	O
different	O
numerical	O
ranges	O
,	O
called	O
bins	O
.	O
</s>
<s>
The	O
histogram	B-Algorithm
provides	O
a	O
visual	O
representation	O
of	O
the	O
distribution	O
of	O
the	O
data	O
,	O
showing	O
the	O
number	O
of	O
observations	O
that	O
fall	O
within	O
each	O
bin	B-General_Concept
.	O
</s>
<s>
This	O
is	O
the	O
data	O
for	O
the	O
histogram	B-Algorithm
to	O
the	O
right	O
,	O
using	O
500	O
items	O
:	O
</s>
<s>
The	O
words	O
used	O
to	O
describe	O
the	O
patterns	O
in	O
a	O
histogram	B-Algorithm
are	O
:	O
"	O
symmetric	O
"	O
,	O
"	O
skewed	B-General_Concept
left	O
"	O
or	O
"	O
right	O
"	O
,	O
"	O
unimodal	O
"	O
,	O
"	O
bimodal	O
"	O
or	O
"	O
multimodal	O
"	O
.	O
</s>
<s>
It	O
is	O
a	O
good	O
idea	O
to	O
plot	O
the	O
data	O
using	O
several	O
different	O
bin	B-General_Concept
widths	O
to	O
learn	O
more	O
about	O
it	O
.	O
</s>
<s>
This	O
is	O
likely	O
due	O
to	O
people	O
rounding	B-Algorithm
their	O
reported	O
journey	O
time	O
.	O
</s>
<s>
The	O
problem	O
of	O
reporting	O
values	O
as	O
somewhat	O
arbitrarily	O
rounded	B-Algorithm
numbers	I-Algorithm
is	O
a	O
common	O
phenomenon	O
when	O
collecting	O
data	O
from	O
people	O
.	O
</s>
<s>
This	O
histogram	B-Algorithm
shows	O
the	O
number	O
of	O
cases	O
per	O
unit	O
interval	O
as	O
the	O
height	O
of	O
each	O
block	O
,	O
so	O
that	O
the	O
area	O
of	O
each	O
block	O
is	O
equal	O
to	O
the	O
number	O
of	O
people	O
in	O
the	O
survey	O
who	O
fall	O
into	O
its	O
category	O
.	O
</s>
<s>
This	O
type	O
of	O
histogram	B-Algorithm
shows	O
absolute	O
numbers	O
,	O
with	O
Q	O
in	O
thousands	O
.	O
</s>
<s>
This	O
histogram	B-Algorithm
differs	O
from	O
the	O
first	O
only	O
in	O
the	O
vertical	O
scale	O
.	O
</s>
<s>
The	O
curve	O
displayed	O
is	O
a	O
simple	O
density	B-General_Concept
estimate	I-General_Concept
.	O
</s>
<s>
This	O
version	O
shows	O
proportions	O
,	O
and	O
is	O
also	O
known	O
as	O
a	O
unit	O
area	O
histogram	B-Algorithm
.	O
</s>
<s>
In	O
other	O
words	O
,	O
a	O
histogram	B-Algorithm
represents	O
a	O
frequency	O
distribution	O
by	O
means	O
of	O
rectangles	O
whose	O
widths	O
represent	O
class	O
intervals	O
and	O
whose	O
areas	O
are	O
proportional	O
to	O
the	O
corresponding	O
frequencies	O
:	O
the	O
height	O
of	O
each	O
is	O
the	O
average	O
frequency	O
density	O
for	O
the	O
interval	O
.	O
</s>
<s>
The	O
intervals	O
are	O
placed	O
together	O
in	O
order	O
to	O
show	O
that	O
the	O
data	O
represented	O
by	O
the	O
histogram	B-Algorithm
,	O
while	O
exclusive	O
,	O
is	O
also	O
contiguous	O
.	O
</s>
<s>
(	O
E.g.	O
,	O
in	O
a	O
histogram	B-Algorithm
it	O
is	O
possible	O
to	O
have	O
two	O
connecting	O
intervals	O
of	O
10.5	O
–	O
20.5	O
and	O
20.5	O
–	O
33.5	O
,	O
but	O
not	O
two	O
connecting	O
intervals	O
of	O
10.5	O
–	O
20.5	O
and	O
22.5	O
–	O
32.5	O
.	O
</s>
<s>
The	O
data	O
used	O
to	O
construct	O
a	O
histogram	B-Algorithm
are	O
generated	O
via	O
a	O
function	O
mi	O
that	O
counts	O
the	O
number	O
of	O
observations	O
that	O
fall	O
into	O
each	O
of	O
the	O
disjoint	O
categories	O
(	O
known	O
as	O
bins	O
)	O
.	O
</s>
<s>
Thus	O
,	O
if	O
we	O
let	O
n	O
be	O
the	O
total	O
number	O
of	O
observations	O
and	O
k	O
be	O
the	O
total	O
number	O
of	O
bins	O
,	O
the	O
histogram	B-Algorithm
data	O
mi	O
meet	O
the	O
following	O
conditions	O
:	O
</s>
<s>
A	O
histogram	B-Algorithm
can	O
be	O
thought	O
of	O
as	O
a	O
simplistic	O
kernel	B-General_Concept
density	I-General_Concept
estimation	I-General_Concept
,	O
which	O
uses	O
a	O
kernel	O
to	O
smooth	O
frequencies	O
over	O
the	O
bins	O
.	O
</s>
<s>
This	O
yields	O
a	O
smoother	O
probability	O
density	B-General_Concept
function	I-General_Concept
,	O
which	O
will	O
in	O
general	O
more	O
accurately	O
reflect	O
distribution	O
of	O
the	O
underlying	O
variable	O
.	O
</s>
<s>
The	O
density	B-General_Concept
estimate	I-General_Concept
could	O
be	O
plotted	O
as	O
an	O
alternative	O
to	O
the	O
histogram	B-Algorithm
,	O
and	O
is	O
usually	O
drawn	O
as	O
a	O
curve	O
rather	O
than	O
a	O
set	O
of	O
boxes	O
.	O
</s>
<s>
Histograms	B-Algorithm
are	O
nevertheless	O
preferred	O
in	O
applications	O
,	O
when	O
their	O
statistical	O
properties	O
need	O
to	O
be	O
modeled	O
.	O
</s>
<s>
The	O
correlated	O
variation	O
of	O
a	O
kernel	B-General_Concept
density	I-General_Concept
estimate	I-General_Concept
is	O
very	O
difficult	O
to	O
describe	O
mathematically	O
,	O
while	O
it	O
is	O
simple	O
for	O
a	O
histogram	B-Algorithm
where	O
each	O
bin	B-General_Concept
varies	O
independently	O
.	O
</s>
<s>
An	O
alternative	O
to	O
kernel	B-General_Concept
density	I-General_Concept
estimation	I-General_Concept
is	O
the	O
average	O
shifted	O
histogram	B-Algorithm
,	O
</s>
<s>
A	O
cumulative	O
histogram	B-Algorithm
is	O
a	O
mapping	O
that	O
counts	O
the	O
cumulative	O
number	O
of	O
observations	O
in	O
all	O
of	O
the	O
bins	O
up	O
to	O
the	O
specified	O
bin	B-General_Concept
.	O
</s>
<s>
That	O
is	O
,	O
the	O
cumulative	O
histogram	B-Algorithm
Mi	O
of	O
a	O
histogram	B-Algorithm
mj	O
is	O
defined	O
as	O
:	O
</s>
<s>
There	O
is	O
no	O
"	O
best	O
"	O
number	O
of	O
bins	O
,	O
and	O
different	O
bin	B-General_Concept
sizes	I-General_Concept
can	O
reveal	O
different	O
features	O
of	O
the	O
data	O
.	O
</s>
<s>
Using	O
wider	O
bins	O
where	O
the	O
density	O
of	O
the	O
underlying	O
data	O
points	O
is	O
low	O
reduces	O
noise	O
due	O
to	O
sampling	O
randomness	O
;	O
using	O
narrower	O
bins	O
where	O
the	O
density	O
is	O
high	O
(	O
so	O
the	O
signal	O
drowns	O
the	O
noise	O
)	O
gives	O
greater	O
precision	O
to	O
the	O
density	B-General_Concept
estimation	I-General_Concept
.	O
</s>
<s>
Thus	O
varying	O
the	O
bin-width	O
within	O
a	O
histogram	B-Algorithm
can	O
be	O
beneficial	O
.	O
</s>
<s>
Depending	O
on	O
the	O
actual	O
data	O
distribution	O
and	O
the	O
goals	O
of	O
the	O
analysis	O
,	O
different	O
bin	B-General_Concept
widths	O
may	O
be	O
appropriate	O
,	O
so	O
experimentation	O
is	O
usually	O
needed	O
to	O
determine	O
an	O
appropriate	O
width	O
.	O
</s>
<s>
The	O
number	O
of	O
bins	O
k	O
can	O
be	O
assigned	O
directly	O
or	O
can	O
be	O
calculated	O
from	O
a	O
suggested	O
bin	B-General_Concept
widthh	O
as	O
:	O
</s>
<s>
which	O
takes	O
the	O
square	O
root	O
of	O
the	O
number	O
of	O
data	O
points	O
in	O
the	O
sample	O
(	O
used	O
by	O
Excel	O
's	O
Analysis	O
Toolpak	O
histograms	B-Algorithm
and	O
many	O
other	O
)	O
and	O
rounds	O
to	O
the	O
next	O
integer	O
.	O
</s>
<s>
Sturges	O
 '	O
formula	O
implicitly	O
bases	O
bin	B-General_Concept
sizes	I-General_Concept
on	O
the	O
range	O
of	O
the	O
data	O
,	O
and	O
can	O
perform	O
poorly	O
if	O
,	O
because	O
the	O
number	O
of	O
bins	O
will	O
be	O
small	O
—	O
less	O
than	O
seven	O
—	O
and	O
unlikely	O
to	O
show	O
trends	O
in	O
the	O
data	O
well	O
.	O
</s>
<s>
On	O
the	O
other	O
extreme	O
,	O
Sturges	O
 '	O
formula	O
may	O
overestimate	O
bin	B-General_Concept
width	O
for	O
very	O
large	O
datasets	O
,	O
resulting	O
in	O
oversmoothed	O
histograms	B-Algorithm
.	O
</s>
<s>
When	O
compared	O
to	O
Scott	O
's	O
rule	O
and	O
the	O
Terrell-Scott	O
rule	O
,	O
two	O
other	O
widely	O
accepted	O
formulas	O
for	O
histogram	B-Algorithm
bins	O
,	O
the	O
output	O
of	O
Sturges	O
 '	O
formula	O
is	O
closest	O
when	O
.	O
</s>
<s>
where	O
is	O
the	O
sample	O
standard	B-General_Concept
deviation	I-General_Concept
.	O
</s>
<s>
Scott	O
's	O
normal	O
reference	O
rule	O
is	O
optimal	O
for	O
random	O
samples	O
of	O
normally	O
distributed	O
data	O
,	O
in	O
the	O
sense	O
that	O
it	O
minimizes	O
the	O
integrated	O
mean	O
squared	O
error	O
of	O
the	O
density	B-General_Concept
estimate	I-General_Concept
.	O
</s>
<s>
The	O
Freedman	B-Application
–	I-Application
Diaconis	I-Application
rule	I-Application
gives	O
bin	B-General_Concept
width	O
as	O
:	O
</s>
<s>
which	O
is	O
based	O
on	O
the	O
interquartile	B-General_Concept
range	I-General_Concept
,	O
denoted	O
by	O
IQR	B-General_Concept
.	O
</s>
<s>
It	O
replaces	O
3.5σ	O
of	O
Scott	O
's	O
rule	O
with	O
2	O
IQR	B-General_Concept
,	O
which	O
is	O
less	O
sensitive	O
than	O
the	O
standard	B-General_Concept
deviation	I-General_Concept
to	O
outliers	O
in	O
data	O
.	O
</s>
<s>
Here	O
,	O
is	O
the	O
number	O
of	O
datapoints	O
in	O
the	O
kth	O
bin	B-General_Concept
,	O
and	O
choosing	O
the	O
value	O
of	O
h	O
that	O
minimizes	O
J	O
will	O
minimize	O
integrated	O
mean	O
squared	O
error	O
.	O
</s>
<s>
where	O
and	O
are	O
mean	O
and	O
biased	O
variance	O
of	O
a	O
histogram	B-Algorithm
with	O
bin-width	O
,	O
and	O
.	O
</s>
<s>
Rather	O
than	O
choosing	O
evenly	O
spaced	O
bins	O
,	O
for	O
some	O
applications	O
it	O
is	O
preferable	O
to	O
vary	O
the	O
bin	B-General_Concept
width	O
.	O
</s>
<s>
A	O
common	O
case	O
is	O
to	O
choose	O
equiprobable	O
bins	O
,	O
where	O
the	O
number	O
of	O
samples	O
in	O
each	O
bin	B-General_Concept
is	O
expected	O
to	O
be	O
approximately	O
equal	O
.	O
</s>
<s>
The	O
bins	O
may	O
be	O
chosen	O
according	O
to	O
some	O
known	O
distribution	O
or	O
may	O
be	O
chosen	O
based	O
on	O
the	O
data	O
so	O
that	O
each	O
bin	B-General_Concept
has	O
samples	O
.	O
</s>
<s>
When	O
plotting	O
the	O
histogram	B-Algorithm
,	O
the	O
frequency	O
density	O
is	O
used	O
for	O
the	O
dependent	O
axis	O
.	O
</s>
<s>
While	O
all	O
bins	O
have	O
approximately	O
equal	O
area	O
,	O
the	O
heights	O
of	O
the	O
histogram	B-Algorithm
approximate	O
the	O
density	O
distribution	O
.	O
</s>
<s>
This	O
choice	O
of	O
bins	O
is	O
motivated	O
by	O
maximizing	O
the	O
power	O
of	O
a	O
Pearson	B-General_Concept
chi-squared	I-General_Concept
test	I-General_Concept
testing	O
whether	O
the	O
bins	O
do	O
contain	O
equal	O
numbers	O
of	O
samples	O
.	O
</s>
<s>
Then	O
the	O
histogram	B-Algorithm
remains	O
equally	O
"	O
rugged	O
"	O
as	O
tends	O
to	O
infinity	O
.	O
</s>
<s>
If	O
is	O
the	O
"	O
width	O
"	O
of	O
the	O
distribution	O
(	O
e	O
.	O
g.	O
,	O
the	O
standard	B-General_Concept
deviation	I-General_Concept
or	O
the	O
inter-quartile	B-General_Concept
range	I-General_Concept
)	O
,	O
then	O
the	O
number	O
of	O
units	O
in	O
a	O
bin	B-General_Concept
(	O
the	O
frequency	O
)	O
is	O
of	O
order	O
and	O
the	O
relative	O
standard	O
error	O
is	O
of	O
order	O
.	O
</s>
<s>
Compared	O
to	O
the	O
next	O
bin	B-General_Concept
,	O
the	O
relative	O
change	O
of	O
the	O
frequency	O
is	O
of	O
order	O
provided	O
that	O
the	O
derivative	O
of	O
the	O
density	O
is	O
non-zero	O
.	O
</s>
<s>
In	O
hydrology	O
the	O
histogram	B-Algorithm
and	O
estimated	O
density	B-General_Concept
function	I-General_Concept
of	O
rainfall	O
and	O
river	O
discharge	O
data	O
,	O
analysed	O
with	O
a	O
probability	O
distribution	O
,	O
are	O
used	O
to	O
gain	O
insight	O
in	O
their	O
behaviour	O
and	O
frequency	O
of	O
occurrence	O
.	O
</s>
<s>
In	O
many	O
Digital	B-Algorithm
image	I-Algorithm
processing	I-Algorithm
programs	O
there	O
is	O
an	O
histogram	B-Algorithm
tool	O
,	O
which	O
show	O
you	O
the	O
distribution	O
of	O
the	O
contrast	O
/	O
brightness	O
of	O
the	O
pixels	B-Algorithm
.	O
</s>
