279 Hidden Markov Models for Discrete-Valued Time Series
Here, ln L is the log-likelihood of the tted model and p denotes the number of parameters
of the model. The rst term measures the lack of t, and the second term is a penalty which
increases with the number of parameters. The criterion BIC differs from AIC in the penalty
term only:
BIC =−2 ln L + p ln T.
The penalty term of BIC is greater than that of AIC if T > e
2
,thatis,for T ≥ 8. Thus, the
BIC generally tends to select models with fewer parameters than does the AIC.
12.6.2 Model Checking by Pseudo-Residuals
There are simple informal checks that can be made on the adequacy of an HMM. One can
(assuming stationarity) compare sample and model quantities such as the mean, variance,
ACF, and the distribution of the observations. If, for example, the data were to display
marked overdispersion but the model did not, we would discard or modify the model.
But there are additional systematic checks that can be performed. We describe here the
use of “pseudo-residuals.” For t = 1, 2, …, T, dene
u
−
= Pr(X
t
< x
t
| X
(−t)
= x
(−t)
), z
−
=
−1
(u
−
t t t
)
and
+
(−t)
+
−1
+
u
= Pr(X
t
≤ x
t
| X
(−t)
= x ), z = (u
t
),
t t
with denoting the standard normal distribution function. The interval [u
− +
] (on a
t
, u
t
probability scale) or [z
− +
] (on a “normal” scale) gives an indication of how extreme
t
, z
t
x
t
is relative to its conditional distribution given the other observations. The conditional
distribution of one observation given the others is therefore needed, but it is a ratio of like-
lihoods and can be found in very much the same way as were the conditional distributions
in Section 12.5.1.
− +
There are several ways in which such pseudo-residual “segments” [z
t
, z ] can be used.
t
We give one here. If the observations were continuous there would be a single quantity z
t
and not an interval, which would have a standard normal distribution if the model were
correct, and so a quantile–quantile (QQ) plot could be used to assess the adequacy of the
model. For discrete-valued series, we use the “mid-pseudo-residual” z
m
t
=
−1
((u
−
t
+
+
u
t
)/2) to sort the pseudo-residuals in order to produce the QQ plot. Although we can
claim no more than approximate normality for mid-pseudo-residuals, they are neverthe-
less useful for identifying poor ts. An example of their application is given in Section 12.7;
see Figure 12.5.
12.7 An Example: Weekly Sales of a Soap Product
We describe here the tting of HMMs to a series of counts and demonstrate briey the
use of the forecasting, decoding, model selection, and checking techniques introduced in
Sections 12.5 and 12.6. Consider the series of weekly sales (in integer units, 242 weeks) of a