<s>
In	O
statistics	O
,	O
deviance	B-General_Concept
is	O
a	O
goodness-of-fit	O
statistic	O
for	O
a	O
statistical	O
model	O
;	O
it	O
is	O
often	O
used	O
for	O
statistical	O
hypothesis	O
testing	O
.	O
</s>
<s>
It	O
is	O
a	O
generalization	O
of	O
the	O
idea	O
of	O
using	O
the	O
sum	B-Algorithm
of	I-Algorithm
squares	I-Algorithm
of	I-Algorithm
residuals	I-Algorithm
(	O
SSR	O
)	O
in	O
ordinary	B-General_Concept
least	I-General_Concept
squares	I-General_Concept
to	O
cases	O
where	O
model-fitting	O
is	O
achieved	O
by	O
maximum	O
likelihood	O
.	O
</s>
<s>
The	O
unit	O
deviance	B-General_Concept
is	O
a	O
bivariate	O
function	O
that	O
satisfies	O
the	O
following	O
conditions	O
:	O
</s>
<s>
The	O
total	O
deviance	B-General_Concept
of	O
a	O
model	O
with	O
predictions	O
of	O
the	O
observation	O
is	O
the	O
sum	O
of	O
its	O
unit	O
deviances	B-General_Concept
:	O
.	O
</s>
<s>
The	O
(	O
total	O
)	O
deviance	B-General_Concept
for	O
a	O
model	O
M0	O
with	O
estimates	O
,	O
based	O
on	O
a	O
dataset	O
y	O
,	O
may	O
be	O
constructed	O
by	O
its	O
likelihood	O
as	O
:	O
</s>
<s>
The	O
deviance	B-General_Concept
is	O
used	O
to	O
compare	O
two	O
models	O
in	O
particular	O
in	O
the	O
case	O
of	O
generalized	O
linear	O
models	O
(	O
GLM	O
)	O
where	O
it	O
has	O
a	O
similar	O
role	O
to	O
residual	B-Algorithm
sum	I-Algorithm
of	I-Algorithm
squares	I-Algorithm
from	O
ANOVA	B-General_Concept
in	O
linear	O
models	O
(	O
RSS	B-Algorithm
)	O
.	O
</s>
<s>
Then	O
,	O
under	O
the	O
null	O
hypothesis	O
that	O
M2	O
is	O
the	O
true	O
model	O
,	O
the	O
difference	O
between	O
the	O
deviances	B-General_Concept
for	O
the	O
two	O
models	O
follows	O
,	O
based	O
on	O
Wilks	B-General_Concept
 '	I-General_Concept
theorem	I-General_Concept
,	O
an	O
approximate	O
chi-squared	O
distribution	O
with	O
k-degrees	O
of	O
freedom	O
.	O
</s>
<s>
This	O
can	O
be	O
used	O
for	O
hypothesis	O
testing	O
on	O
the	O
deviance	B-General_Concept
.	O
</s>
<s>
Some	O
usage	O
of	O
the	O
term	O
"	O
deviance	B-General_Concept
"	O
can	O
be	O
confusing	O
.	O
</s>
<s>
"	O
the	O
quantity	O
is	O
sometimes	O
referred	O
to	O
as	O
a	O
deviance	B-General_Concept
.	O
</s>
<s>
This	O
is	O
 [ ... ] 	O
inappropriate	O
,	O
since	O
unlike	O
the	O
deviance	B-General_Concept
used	O
in	O
the	O
context	O
of	O
generalized	O
linear	O
modelling	O
,	O
does	O
not	O
measure	O
deviation	O
from	O
a	O
model	O
that	O
is	O
a	O
perfect	O
fit	O
to	O
the	O
data.	O
"	O
</s>
<s>
However	O
,	O
since	O
the	O
principal	O
use	O
is	O
in	O
the	O
form	O
of	O
the	O
difference	O
of	O
the	O
deviances	B-General_Concept
of	O
two	O
models	O
,	O
this	O
confusion	O
in	O
definition	O
is	O
unimportant	O
.	O
</s>
<s>
The	O
unit	O
deviance	B-General_Concept
for	O
the	O
Poisson	O
distribution	O
is	O
,	O
the	O
unit	O
deviance	B-General_Concept
for	O
the	O
Normal	O
distribution	O
is	O
given	O
by	O
.	O
</s>
