10 1 1 314 2260 PDF
10 1 1 314 2260 PDF
10 1 1 314 2260 PDF
Sam Roweis∗
Computation and Neural Systems, California Institute of Technology, Pasadena, CA
91125, U.S.A.
Zoubin Ghahramani∗
Department of Computer Science, University of Toronto, Toronto, Canada
1 A Unifying Review
science Unit, University College London, 17 Queen Square, London WCIN 3AR U.K.
The basic models we work with are discrete time linear dynamical systems
with gaussian noise. In such models we assume that the state of the process
in question can be summarized at any time by a k-vector of state variables or
causes x that we cannot observe directly. However, the system also produces
at each time step an output or observable p-vector y to which we do have
access.
The state x is assumed to evolve according to simple first-order Markov
dynamics; each output vector y is generated from the current state by a sim-
ple linear observation process. Both the state evolution and the observation
processes are corrupted by additive gaussian noise, which is also hidden.
If we work with a continuous valued state variable x, the basic generative
model can be written1 as:
1 All vectors are column vectors. To denote the transpose of a vector or matrix, we use
the notation xT . The determinant of a matrix is denoted by |A| and matrix inversion by
A−1 . The symbol ∼ means “distributed according to.” A multivariate ¡normal ¢ (gaussian)
distribution with mean µ and covariance matrix Σ is written as N µ, Σ . The same
¡ ¢
gaussian evaluated at the point z is denoted N µ, Σ |z .
A Unifying Review of Linear Gaussian Models 307
of each other and of the values of x and y. Both of these noise sources are
temporally white (uncorrelated from time step to time step) and spatially
gaussian distributed2 with zero mean and covariance matrices, which we
denote Q and R, respectively. We have written w• and v• in place of wt
and vt to emphasize that the noise processes do not have any knowledge
of the time index. The restriction to zero-mean noise sources is not a loss of
generality.3 Since the state evolution noise is gaussian and its dynamics are
linear, xt is a first-order Gauss-Markov random process. The noise processes
are essential elements of the model. Without the process noise w• , the state xt
would always either shrink exponentially to zero or blow up exponentially
in the direction of the leading eigenvector of A; similarly in the absence
of the observation noise v• the state would no longer be hidden. Figure 1
illustrates this basic model using both the engineering system block form
and the network form more common in machine learning.
Notice that there is degeneracy in the model. All of the structure in the
matrix Q can be moved into the matrices A and C. This means that we
can, without loss of generality, work with models in which Q is the identity
matrix.4 Of course, R cannot be restricted in the same way since the values yt
are observed, and hence we are not free to whiten or otherwise rescale them.
Finally, the components of the state vector can be arbitrarily reordered; this
corresponds to swapping the columns of C and A. Typically we choose
an ordering based on the norms of the columns of C, which resolves this
degeneracy.
The network diagram of Figure 1 can be unfolded in time to give separate
units for each time step. Such diagrams are the standard method of illustrat-
ing graphical models, also known as probabilistic independence networks,
a category of models that includes Markov networks, Bayesian (or belief)
networks, and other formalisms (Pearl, 1988; Lauritzen & Spiegelhalter,
1988; Whittaker, 1990; Smyth et al., 1997). A graphical model is a repre-
sentation of the dependency structure between variables in a multivariate
probability distribution. Each node corresponds to a random variable, and
the absence of an arc between two variables corresponds to a particular
conditional independence relation. Although graphical models are beyond
2 An assumption that is weakly motivated by the central limit theorem but more
strongly by analytic tractability.
3 Specifically we could always add a k + 1st dimension to the state vector, which is
fixed at unity. Then augmenting A with an extra column holding the noise mean and an
extra row of zeros (except unity in the bottom right corner) takes care of a nonzero mean
for w• . Similarly, adding an extra column to C takes care of a nonzero mean for v• .
4 In particular, since it is a covariance matrix, Q is symmetric positive semidefinite and
thus can be diagonalized to the form EΛET (where E is a rotation matrix of eigenvectors
and Λ is a diagonal matrix of eigenvalues). Thus, for any model in which Q is not the
identity matrix, we can generate an exactly equivalent model using a new state vector
−1/2 T −1/2 T 1/2 1/2
x0 = Λ E x with A0 = (Λ E )A(EΛ ) and C0 = C(EΛ ) such that the new
0
covariance of x is the identity matrix: Q = I.0
308 Sam Roweis and Zoubin Ghahramani
x t
C + y t
z ,1 A v
+
w
v
y t
C
x t
w
A
z ,1
Figure 1: Linear dynamical system generative model. The z−1 block is a unit
delay. The covariance matrix of the input noise w is Q and the covariance matrix
of the output noise v is R. In the network model below, the smaller circles
represent noise sources and all units are linear. Outgoing weights have only
been drawn from one hidden unit. This model is equivalent to a Kalman filter
model (linear dynamical system).
the scope of this review, it is important to point out that they provide a very
general framework for working with the models we consider here. In this
review, we unify and extend some well-known statistical models and signal
processing algorithms by focusing on variations of linear graphical models
with gaussian noise.
The main idea of the models in equations 2.1 is that the hidden state
sequence xt should be an informative lower dimensional projection or ex-
planation of the complicated observation sequence yt . With the aid of the
dynamical and noise models, the states should summarize the underlying
causes of the data much more succinctly than the observations themselves.
For this reason, we often work with state dimensions much smaller than
the number of observables—in other words, k ¿ p.5 We assume that both
5 More precisely, in a model where all the matrices are full rank, the problem of inferring
A Unifying Review of Linear Gaussian Models 309
A and C are of rank k and that Q, R, and Q1 (introduced below) are always
full rank.
3 Probability Computations
The popularity of linear gaussian models comes from two fortunate analyt-
ical properties of gaussian processes: the sum of two independent gaussian
distributed quantities is also gaussian distributed,6 and the output of a linear
system whose input is gaussian distributed is again gaussian distributed.
This means that if we assume the initial state x1 of the system to be gaussian
distributed,
¡ ¢
x1 ∼ N µ1 , Q1 , (3.1)
then all future states xt and observations yt will also be gaussian distributed.
In fact, we can write explicit formulas for the conditional expectations of
the states and observables:
Furthermore, because of the Markov properties of the model and the gaus-
sian assumptions about the noise and initial distributions, it is easy to write
an expression for the joint probability of a sequence of τ states and outputs:
¡ ¢ τY
−1 Y
τ ¡ ¢
P {x1 , . . . , xτ }, {y1 . . . yτ } = P (x1 ) P (xt+1 |xt ) P yt |xt . (3.3)
t=1 t=1
The negative log probability (cost) is just the sum of matrix quadratic forms:
¡ ¢
−2 log P {x1 , . . . , xτ }, {y1 , . . . , yτ }
Xτ
= [(yt − Cxt )T R−1 (yt − Cxt ) + log |R|]
t=1
X
τ −1
+ [(xt+1 − Axt )T Q−1 (xt+1 − Axt ) + log |Q|]
t=1
+ (x1 − µ1 )T Q−1
1 (x1 − µ1 ) + log |Q1 | + τ (p + k) log 2π. (3.4)
P({y1 , . . . , yτ })
Z
= P({x1 , . . . , xτ }, {y1 , . . . , yτ }) d{x1 , . . . , xτ }. (4.1)
all possible {x1 ,...,xτ }
given the entire sequence of observations. (It is also possible to ask for the
conditional state expectation given observations that extend only a few time
steps into the future—partial smoothing—or that end a few time steps be-
fore the current time—partial prediction.) These conditional calculations are
closely related to the computation of equation 4.1 and often the intermedi-
ate values of a recursive method used to compute that equation give the
desired distributions of equations 4.3 or 4.4. Filtering and smoothing have
been extensively studied for continuous state models in the signal process-
ing community, starting with the seminal works of Kalman (1960; Kalman
& Bucy, 1961) and Rauch (1963; Rauch, Tung, & Striebel, 1965), although
this literature is often not well known in the machine learning commu-
nity. For the discrete state models, much of the literature stems from the
work of Baum and colleagues (Baum & Petrie, 1966; Baum & Eagon, 1967;
Baum, Petrie, Soules, & Weiss, 1970; Baum, 1972) on HMMs and of Viterbi
(1967) and others on optimal decoding. The recent book by Elliott and col-
leagues (1995) contains a thorough mathematical treatment of filtering and
smoothing for many general models.
(Ljung & Söderström, 1983), but to clarify the relationship between these
models and the others we review in this article, we focus on system identifi-
cation methods based on the expectation-maximization (EM) algorithm. The
EM algorithm for linear gaussian dynamical systems was originally derived
by Shumway and Stoffer (1982) and recently reintroduced (and extended)
in the neural computation field by Ghahramani and Hinton (1996a,b). Di-
galakis et al. (1993) made a similar reintroduction and extension in the
speech processing community. Once again we mention the book by Elliott
et al. (1995), which also covers learning in this context.
The basis of all the learning algorithms presented by these authors is
the powerful EM algorithm (Baum & Petrie, 1966; Dempster, Laird, & Ru-
bin, 1977). The objective of the algorithm is to maximize the likelihood of
the observed data (equation 4.1) in the presence of hidden variables. Let
us denote the observed data by Y = {y1 , . . . , yτ }, the hidden variables by
X = {x1 , . . . , xτ }, and the parameters of the model by θ. Maximizing the
likelihood as a function of θ is equivalent to maximizing the log-likelihood:
Z
L(θ) = log P(Y|θ) = log P(X, Y|θ ) dX. (4.5)
X
Using any distribution Q over the hidden variables, we can obtain a lower
bound on L:
Z Z
P(X, Y|θ )
log P(Y, X|θ) dX = log Q(X) dX (4.6a)
X X Q(X)
Z
P(X, Y|θ )
≥ Q(X) log dX (4.6b)
Q(X)
ZX Z
= Q(X) log P(X, Y|θ ) dX− Q(X) log Q(X) dX (4.6c)
X X
= F (Q, θ), (4.6d)
It is easy to show that the maximum in the E-step results when Q is exactly
the conditional distribution of X: Qk+1 (X) = P(X|Y, θk ), at which point the
bound becomes an equality: F (Qk+1 , θk ) = L(θk ). The maximum in the
M-step is obtained by maximizing the first term in equation 4.6c, since the
entropy of Q does not depend on θ :
Z
M-step: θk+1 ← arg max P(X|Y, θk ) log P(X, Y|θ ) dX. (4.8)
θ X
This is the expression most often associated with the EM algorithm, but it
obscures the elegant interpretation of EM as coordinate ascent in F (Neal
& Hinton, 1998). Since F = L at the beginning of each M-step and since the
E-step does not change θ, we are guaranteed not to decrease the likelihood
after each combined EM-step.
Therefore, at the heart of the EM learning procedure is the following
idea: use the solutions to the filtering and smoothing problem to estimate
the unknown hidden states given the observations and the current model
parameters. Then use this fictitious complete data to solve for new model
parameters. Given the estimated states obtained from the inference algo-
rithm, it is usually easy to solve for new parameters. For linear gaussian
models, this typically involves minimizing quadratic forms such as equa-
tion 3.4, which can be done with linear regression. This process is repeated
using these new model parameters to infer the hidden states again, and so
on. We shall review the details of particular algorithms as we present the
various cases; however, we now touch on one general point that often causes
confusion. Our goal is to maximize the total likelihood (see equation 4.1) (or
equivalently maximize the total log likelihood) of the observed data with
respect to the model parameters. This means integrating (or summing) over
all ways in which the generative model could have produced the data. As
a consequence of using the EM algorithm to do this maximization, we find
ourselves needing to compute (and maximize) the expected log-likelihood
of the joint data, where the expectation is taken over the distribution of
hidden values predicted by the current model parameters and the observa-
tions. Thus, it appears that we are maximizing the incorrect quantity, but
doing so is in fact guaranteed to increase (or keep the same) the quantity of
interest at each iteration of the algorithm.
Having described the basic model and learning procedure, we now focus
on specific linear instances of the model in which the hidden state variable
x is continuous and the noise processes are gaussian. This will allow us to
314 Sam Roweis and Zoubin Ghahramani
elucidate the relationship among factor analysis, PCA, and Kalman filter
models. We divide our discussion into models that generate static data and
those that generate dynamic data. Static data have no temporal dependence;
no information would be lost by permuting the ordering of the data points
yt ; whereas for dynamic data, the time ordering of the data points is crucial.
5.1 Static Data Modeling: Factor Analysis, SPCA, and PCA. In many
situations we have reason to believe (or at least to assume) that each point in
our data set was generated independently and identically. In other words,
there is no natural (temporal) ordering to the data points; they merely form
a collection. In such cases, we assume that the underlying state vector x has
no dynamics; the matrix A is the zero matrix, and therefore x is simply a
constant (which we take without loss of generality to be the zero vector)
corrupted by noise. The new generative model then becomes:
Notice that since xt is driven only by the noise w• and since yt depends only
on xt , all temporal dependence has disappeared. This is the motivation for
the term static and for the notations x• and y• above. We also no longer use
a separate distribution for the initial state: x1 ∼ x• ∼ w• ∼ N (0, Q).
This model is illustrated in Figure 2. We can analytically integrate equa-
tion 4.1 to obtain the marginal distribution of y• , which is the gaussian,
³ ´
y• ∼ N 0, CQCT + R . (5.2)
7 If we
³ diagonalize Q and rewrite the
´ covariance of y• , the degeneracy becomes clear:
1/2 1/2 T
y• ∼ N 0, (CEΛ )(CEΛ ) + R . To make Q diagonal, we simply replace C with
CE.
A Unifying Review of Linear Gaussian Models 315
x
0 + C + y
w v
v
y
C
x
w
structure in the data as noise. (Remember that since the model has reduced
to a single gaussian distribution for y• , we can do no better than having
the covariance of our model equal the sample covariance of our data.) Note
that restricting R, unlike making Q diagonal, does constitute some loss of
generality from the original model of equations 5.1.
There is an intuitive spatial way to think about this static generative
model. We use white noise to generate a spherical ball (since Q = I) of
density in k-dimensional state-space. This ball is then stretched and rotated
into p-dimensional observation space by the matrix C, where it looks like a
k-dimensional pancake. The pancake is then convolved with the covariance
density of v• (described by R) to get the final covariance model for y• .
We want the resulting ellipsoidal density to be as close as possible to the
ellipsoid given by the sample covariance of our data. If we restrict the shape
of the v• covariance by constraining R, we can force interesting information
to appear in both R and C as a result.
Finally, observe that all varieties of filtering and smoothing reduce to the
same problem in this static model because there ¡ is
¢ no time dependence. We
are seeking only the posterior probability P x• |y• over a single hidden state
given the corresponding single observation. This inference is easily done by
316 Sam Roweis and Zoubin Ghahramani
from which we obtain not only the expected value β y• of the unknown
state but also an estimate of the uncertainty in this value in the form of the
covariance I − β C. Computing the likelihood of a data point y• is merely
an evaluation under the gaussian in equation 5.2. The learning problem
now consists of identifying the matrices C and R. There is a family of EM
algorithms to do this for the various cases discussed below, which are given
in detail at the end of this review.
row in C and achieve a new model that assigns the rescaled data identical
likelihood. On the other hand, if we rotate the axes in which we measure
the data, we could not easily fix things since the noise v is constrained to
have axis aligned covariance (R is diagonal).
EM for factor analysis has been criticized as being quite slow (Rubin
& Thayer, 1982). Indeed, the standard method for fitting a factor analysis
model (Jöreskog, 1967) is based on a quasi-Newton optimization algorithm
(Fletcher & Powell, 1963), which has been found empirically to converge
faster than EM. We present the EM algorithm here not because it is the
most efficient way of fitting a factor analysis model, but because we wish to
emphasize that for factor analysis and all the other latent variable models
reviewed here, EM provides a unified approach to learning. Finally, recent
work in online learning has shown that it is possible to derive a family
of EM-like algorithms with faster convergence rates than the standard EM
algorithm (Kivinen & Warmuth, 1997; Bauer, Koller, & Singer, 1997).
9 Since isotropic scaling of the data space is arbitrary, we could just as easily take the
limit as the diagonal elements of Q became infinite while holding R finite or take both
limits at once. The idea is that the noise variance becomes infinitesimal compared to the
scale of the data.
318 Sam Roweis and Zoubin Ghahramani
¡ ¢
P(x• |y• ) = N β y• , I − β C |x• , β = lim CT (CCT + ²I)−1 (5.4a)
²→0
³ ´
−1 T
P(x• |y• ) = N (C C) C y• , 0 |x•
T
Since the noise has become infinitesimal, the posterior over states collapses
to a single point, and the covariance becomes zero. There is still an EM
algorithm for learning (Roweis, 1997), although it can learn only C. For
PCA, we could just diagonalize the sample covariance of the data and take
the leading k eigenvectors multiplied by their eigenvalues to be the columns
of C. This approach would give us C in one step but has many problems.11
The EM learning algorithm amounts to an iterative procedure for finding
these leading eigenvectors without explicit diagonalization.
An important final comment is that (regular) PCA does not define a
proper density model in the observation space, so we cannot ask directly
about the likelihood assigned by the model to some data. We can, however,
examine a quantity that is proportional to the negative log-likelihood in the
limit of zero noise. This is the sum squared deviation of each data point
from its projection. It is this “cost” that the learning algorithm ends up
minimizing and is the only available evaluation of how well a PCA model
fits new data. This is one of the most critical failings of PCA: translating
points by arbitrary amounts inside the principal subspace has no effect on
the model error.
10 Recall that if C is p×k with p > k and is rank k, then left multiplication by CT (CCT )−1
(which appears not to be well defined because CCT is not invertible) is exactly equivalent
to left multiplication by (CT C)−1 CT . This is the same as the singular value decomposition
idea of defining the “inverse” of the diagonal singular value matrix as the inverse of an
element unless it is zero, in which case it remains zero. The intuition is that although CCT
truly is not invertible, the directions along which it is not invertible are exactly those that
CT is about to project out.
11 It is computationally very hard to diagonalize or invert large matrices. It also requires
an enormous amount of data to make a large sample covariance matrix full rank. If we
are working with patterns in a large (thousands) number of dimensions and want to
extract only a few (tens) principal components, we cannot naively try to diagonalize
the sample covariance of our data. Techniques like the snapshot method (Sirovich, 1987)
attempt to address this but still require the diagonalization of an N × N matrix where N
is the number of data points. The EM algorithm approach solves all of these problems,
requiring no explicit diagonalization whatsoever and the inversion of only a k×k matrix. It
is guaranteed to converge to the true principal subspace (the same subspace spanned by the
principal components). Empirical experiments (Roweis, 1997) indicate that it converges
in a few iterations, unless the ratio of the leading eigenvalues is near unity.
A Unifying Review of Linear Gaussian Models 319
5.4 Time-Series Modeling: Kalman Filter Models. We use the term dy-
namic data to refer to observation sequences in which the temporal ordering
is important. For such data, we do not want to ignore the state evolution
dynamics, which provides the only aspect of the model capable of capturing
temporal structure. Systems described by the original dynamic generative
model, shown in equations 2.1a and 2.2b, are known as linear dynamical
systems or Kalman filter models and have been extensively investigated by
the engineering and control communities for decades. The emphasis has
traditionally been on inference problems: the famous discrete Kalman filter
(Kalman, 1960; Kalman & Bucy, 1961) gives an efficient recursive solution to
the optimal filtering and likelihood computation problems, while the RTS
recursions (Rauch, 1963; Rauch et al., 1965) solve the optimal smoothing
problem. Learning of unknown model parameters was studied by Shum-
way and Stoffer (1982) (C known) and by Ghahramani and Hinton (1996a)
and Digalakis et al. (1993) (all parameters unknown). Figure 1 illustrates
this model, and the appendix gives pseudocode for its implementation.
We can extend our spatial intuition of the static case to this dynamic
model. As before, any point in state-space is surrounded by a ball (or ovoid)
of density (described by Q), which is stretched (by C) into a pancake in
observation space and then convolved with the observation noise covari-
ance (described by R). However, unlike the static case, in which we always
centered our ball of density on the origin in state-space, the center of the
state-space ball now “flows” from time step to time step. The flow is accord-
ing to the field described by the eigenvalues and eigenvectors of the matrix
A. We move to a new point according to this flow field; then we center our
ball on that point and pick a new state. From this new state, we again flow
to a new point and then apply noise. If A is the identity matrix (not the
zero matrix), then the “flow” does not move us anywhere, and the state just
evolves according to a random walk of the noise set by Q.
6 Discrete-State Linear Gaussian Models
x t
C + y t
z ,1 A v
WTA[ ] +
w
v
y t
C
x t
w
A
z ,1
Figure 3: Discrete state generative model for dynamic data. The WTA[·] block
implements the winner-take-all nonlinearity. The z−1 block is a unit delay. The
covariance matrix of the input noise w is Q and the covariance matrix of the
output noise v is R. In the network model below, the smaller circles represent
noise sources and the hidden units x have a winner take all behaviour (indicated
by dashed lines). Outgoing weights have only been drawn from one hidden
unit. This model is equivalent to a hidden Markov model with tied output
covariances.
(though we will soon see that without loss of generality Q1 can be restricted
to be the identity matrix). This discrete state generative model is illustrated
in Figure 3.
which there is no natural ordering to our data, and so set the matrix A to be
the zero matrix. In this discrete-state case, the generative model becomes:
¡ ¢ X k ¡ ¢ Xk
P y• = P x• = ej , y• = N (Ci , R) |y• P (x• = ei )
i=1 i=1
X
k
= N (Ci , R) |y• π i , (6.5)
i=1
where Ci denotes the ith column of C. Again, all varieties of inference and
filtering
¡ are the same,
¢ and we are simply seeking the set of discrete probabil-
ities P x• = ej |y• j = 1, . . . , k. In other words, we need to do probabilistic
classification. The problem is easily solved by computing the responsibilities
x̂• that each cluster has for the data point y• :
¡ ¢ ¡ ¢
¡ ¢ P x• = ej , y• P x• = ej , y•
(x̂• )j = P x• = ej |y• = ¡ ¢ = Pk ¡ ¢ (6.6a)
i=1 P x• = ei , y•
P y•
¡ ¢ ¡ ¢
N Cj , R |y• P x• = ej
(x̂• )j = Pk
i=1 N (Ci , R) |y• P (x• = ei )
12 As in the continuous static case, we again dispense with any special treatment of
0 + WTA[ ] x C + y
w v
v
y
C
x
w
Figure 4: Static generative model (discrete state). The WTA[·] block implements
the winner-take-all nonlinearity. The covariance matrix of the input noise w is
Q and the covariance matrix of the output noise v is R. In the network model
below, the smaller circles represent noise sources and the hidden units x have a
winner take all behaviour (indicated by dashed lines). Outgoing weights have
only been drawn from one hidden unit. This model is equivalent to a mixture of
Gaussian clusters with tied covariances R or to vector quantization (VQ) when
R = lim²→0 ²I.
¡ ¢
N Cj , R |y• πj
= Pk . (6.6b)
i=1 N (Ci , R) |y• π i
The mean x̂• of the state vector given a data point is exactly the vector of
responsibilities for that data point. This quantity defines the entire posterior
distribution of the discrete hidden state given the data point. As a measure
of the randomness or uncertainty in the hidden state, one could evaluate the
entropy or normalized entropy13 of the discrete distribution corresponding
to x̂• . Although this may seem related to the variance of the posterior in
factor analysis, this analogy is deceptive. Since x̂• defines the entire distri-
bution, no other “variance” measure is needed. Learning consists of finding
the cluster means (columns of C), the covariance R, and the mixing coeffi-
cients πj . This is easily done with EM and corresponds exactly to maximum
likelihood competitive learning (Duda & Hart, 1973; Nowlan, 1991), except
13 The entropy of the distribution divided by the logarithm of k so that it always lies
that all the clusters share the same covariance. Later we introduce extensions
to the model that remove this restriction.
As in the continuous-state case, we can consider the limit as the ob-
servation noise becomes infinitesimal compared to the scale of the data.
What results is the standard vector quantization model. The inference (clas-
sification) problem is now solved by the one-nearest-neighbor rule, using
Euclidean distance if R is a multiple of the identity matrix, or Mahalanobis
distance in the unscaled matrix R otherwise. Similarly to PCA, since the
observation noise has disappeared, the posterior collapses to have all of
its mass on one cluster (the closest), and the corresponding uncertainty
(entropy) becomes zero. Learning with EM is equivalent to using a batch
version of the k-means algorithm such as that proposed by Lloyd (1982).
As with PCA, vector quantization does not define a proper density in the
observation space. Once again, we examine the sum squared deviation of
each point from its closest cluster center as a quantity proportional to the
likelihood in the limit of zero noise. Batch k-means algorithms minimize
this cost in lieu of maximizing a proper likelihood.
14 Although harder to see. Sketch of proof: Without loss of generality, always set the
covariance to the identity matrix. Next, set the dot product of the mean vector with the
k-vector having unity in all positions to be zero since moving along this direction does not
change the probabilities. Now there are (k − 1) degrees of freedom in the mean and also
in the probability model. Set the mean randomly at first (except that it has no projection
along the all-unity direction). Move the mean along a line defined by the constraint that
all probabilities but two should remain constant until one of those two probabilities has
the desired value. Repeat this until all have been set correctly.
324 Sam Roweis and Zoubin Ghahramani
There has been a great deal of recent interest in the blind source separation
problem that attempts to recover a number of “source” signals from obser-
vations resulting from those signals, using only the knowledge that the orig-
inal sources are independent. In the “square-linear” version of the problem,
the observation process is characterized entirely by a square and invertible
matrix C. In other words, there are as many observation streams as sources,
and there is no delay, echo, or convolutional distortion. Recent experience
has shown the surprising result that for nongaussian distributed sources,
this problem can often be solved even with no prior knowledge about the
sources or about C. It is widely believed (and beginning to be proved theo-
A Unifying Review of Linear Gaussian Models 325
retically; see MacKay, 1996) that high kurtosis source distributions are most
easily separated.
We will focus on a modified, but by now classic, version due to Bell and
Sejnowski (1995) and Baram and Roth (1994) of the original independent
component analysis algorithm (Comon, 1994). Although Bell and Sejnowski
derived it from an information-maximization perspective, this modified
algorithm can also be obtained by defining a particular prior distribution
over the components of the vector xt of sources and then deriving a gradient
learning rule that maximizes the likelihood of the data yt in the limit of zero
output noise (Amari, Cichocki, & Yang, 1996; Pearlmutter & Parra, 1997;
MacKay, 1996). The algorithm, originally derived for unordered data, has
also been extended to modeling time series (Pearlmutter & Parra, 1997).
We now show that the generative model underlying ICA can be obtained
by modifying slightly the basic model we have considered thus far. The
modification is to replace the WTA[·] nonlinearity introduced above with
a general nonlinearity g(·) that operates componentwise on its input. Our
generative model (for static data) then becomes:
where the learning rule nonlinearity f (·) is the derivative of the implicit
d log px (x)
log prior: f (x) = dx (MacKay, 1996). Therefore, any generative non-
linearity g(·) results in a nongaussian prior px (·), which in turn results in a
nonlinearity f (·) in the maximum likelihood learning rule. Somewhat frus-
tratingly from the generative models perspective, ICA is often discussed in
terms of the learning rule nonlinearity without any reference to the implicit
prior over the sources.
A popular choice for the ICA learning rule nonlinearity f (·) is the
tanh(·) function, which corresponds to a heavy tailed prior over the sources
(MacKay, 1996):
1
px (x) = . (7.4)
π cosh(x)
1 1 √
cdfx (g(w)) = cdfw (w) = + erf(w/ 2), (7.5)
2 2
√ Rz
for monotonic g, where erf(z) is the error function 2/ π 0 e−u du. This
2
where i indexes the data points and h·ii denotes expectation with respect to
the posterior distribution of x given yi , P(x|yi , C, R). The first term does not
A Unifying Review of Linear Gaussian Models 327
15
10
g(w)
0
−5
−10
−15
−5 −4 −3 −2 −1 0 1 2 3 4 5
w
Figure 5: The nonlinearity g(·) from equation 7.6 which converts a gaussian dis-
tributed source w ∼ N (0, 1) into one distributed as x = g(w) ∼ 1/(π cosh(x)).
A similar M-step can be derived for R. Since, given x• , the generative model
is linear, the M-step requires only evaluating the first and second moments
of the posterior distribution of x: hxii and hxxT ii . It is not necessary to know
anything else about the posterior if its first two moments can be computed.
These may be computed using Gibbs sampling or, for certain source priors,
using table lookup or closed-form computation.15 In particular, Moulines
et al. (1997) and Attias and Schreiner (1998) have independently proposed
using a gaussian mixture to model the prior for each component of the
source, x. The posterior distribution over x is then also a gaussian mixture,
which can be evaluated analytically and used to derive an EM algorithm
for both the mixing matrix and the source densities. The only caveat is that
the number of gaussian components in the posterior grows exponentially
in the number of sources,16 which limits the applicability of this method to
models with only a few sources.
15 In the limit of zero noise, R = 0, the EM updates derived in this manner degenerate
to C ← C and R ← R. Since this does not decrease the likelihood, it does not contradict the
convergence proof for the EM algorithm. However, it also does not increase the likelihood,
which might explain why no one uses EM to fit the standard zero-noise ICA model.
16 If each source is modeled as a mixture of k gaussians and there are m sources, then
X
N
P(w• ) = N (0, I) ≈ P̃(w• ) = δ(w• − wj ), (7.9)
j=1
where the wj ’s are a finite sample from N (0, I). The generative model then
takes these N points, maps them through a fixed nonlinearity g, an adaptable
linear mapping C, and adds gaussian noise with covariance R to produce
y• . The generative model is therefore a constrained mixture of N gaussians,
where the constraint comes from the fact that the only way the centers can
move is by varying C. Then, computing the posterior over w• amounts to
computing the responsibility under each of the N gaussians for the data
point. Given these responsibilities, the problem is again linear in C, which
means that it can be solved using equation 7.8. For the traditional zero-noise
limit of ICA, the responsibilities will select the center closest to the data point
in exactly the same manner as standard vector quantization. Therefore, ICA
could potentially be implemented using EM for GTMs in the limit of zero
output noise.
Early in the modern history of neural networks, it was realized that PCA
could be implemented using a linear autoencoder network (Baldi & Hornik,
1989). The data are fed as both the input and target of the network, and the
network parameters are learned using the squared error cost function. In
this section, we show how factor analysis and mixture of gaussian clusters
can also be implemented in this manner, albeit with a different cost function.
To understand how a probabilistic model can be learned using an au-
toencoder it is very useful to make a recognition-generation decomposition
of the autoencoder (Hinton & Zemel, 1994; Hinton, Dayan, & Revow, 1997).
An autoencoder takes an input y• , produces some internal representation
in the hidden layer x̂• , and generates at its output a reconstruction of the
input ŷ• in Figure 6. We call the mapping from hidden to output layers the
generative part of the network since it generates the data from a (usually
more compact) representation under some noise model. Conversely, we call
the mapping from input to hidden units the recognition part of the network
A Unifying Review of Linear Gaussian Models 329
y^
generative
weights C
x^
recognition
weights
y
Figure 6: A network for state inference and for learning parameters of a static
data model. The input y• is clamped to the input units (bottom), and the mean
x̂• of the posterior of the estimated state appears on the hidden units above. The
covariance of the state posterior is constant at I − βC which is easily computed if
the weights β are known. The inference computation is a trivial linear projection,
but learning the weights of the inference network is difficult. The input to hidden
weights are always constrained to be a function of the hidden to output weights,
and the network is trained as an autoencoder using self-supervised learning.
Outgoing weights have only been drawn from one input unit and one hidden
unit.
since it produces some representation in the hidden variables given the in-
put. Because autoencoders are usually assumed to be deterministic, we will
think of the recognition network as computing the posterior mean of the
hidden variables given the input.
The generative model for factor analysis assumes that both the hidden
states and the observables are normally distributed, from which we get the
posterior probabilities for the hidden states in equation 5.3b. If we assume
that the generative weight matrix from the hidden units to the outputs is C
and the noise model at the output is gaussian with covariance R, then the
posterior mean of the hidden variables is x̂• = β y• , where β = CT (CCT +
R)−1 . Therefore, the hidden units can compute the posterior mean exactly
if they are linear and the weight matrix from input to hidden units is β .
Notice that β is tied to C and R, so we only need to estimate C and R during
learning. We denote expectations under the posterior state distribution by
h·i, for example,
Z
hx• i = x• P(x• |y• ) dx• = x̂• .
From the theory of the EM algorithm (see section 4.2), we know that one
way to maximize the likelihood is to maximize the expected value of the
log of the joint probability under the posterior distribution of the hidden
variables:
and in the last step we have reorganized terms and made use of the fact that
hxT• CT R−1 Cx• i = trace[CT R−1 Chx• xT• i].
The first two terms of cost function in equation 8.1c are just a squared
error cost function evaluated with respect to a gaussian noise model with
covariance R. They are exactly the terms minimized when fitting a standard
neural network with this gaussian noise model. The last term is a regular-
ization term that accounts for the posterior variance in the hidden states
given the inputs.17 When we take derivatives of this cost function, we do
not differentiate x̂ and Σ with respect to C and R. As is usual for the EM
algorithm, we differentiate the cost given the posterior distribution of the
hidden variables. Taking derivatives with respect to C and premultiplying
by R, we obtain a weight change rule,
The first term is the usual delta rule. The second term is simply a weight-
decay term decaying the columns of C with respect to the posterior co-
variance of the hidden variables. Intuitively, the higher the uncertainty in a
hidden unit, the more its outgoing weight vector is shrunk toward zero. To
summarize, factor analysis can be implemented in an autoassociator by ty-
ing the recognition weights to the generative weights and using a particular
regularizer in addition to squared reconstruction error during learning.
We now analyze the mixture of gaussians model in the same manner. The
recognition network is meant to produce the mean of the hidden variable
given the inputs. Since we assume that the discrete hidden variable is repre-
sented as a unit vector, its mean is just the vector of probabilities of being in
each of its k settings given the inputs, that is, the responsibilities. Assuming
equal mixing coefficients, P(x• = ej ) = P(x• = ei ) ∀ij, the responsibilities
17 PCA assumes infinitesimal noise, and therefore the posterior “distribution” over the
hidden states has zero variance (Σ → 0) and the regularizer vanishes (CT R−1 CΣ → I).
A Unifying Review of Linear Gaussian Models 331
exp{βj y• − αj }
= Pk , (8.3b)
i=1 exp{β i y• − αi }
−2 log P(y• |x• , C, R) = (y• − Cx• )T R−1 (y• − Cx• ) + log |R| + const.
Using this and the previous derivation, we obtain the cost function,
C = (y• − Cx̂• )T R−1 (y• − Cx̂• ) + log |R| + trace[CT R−1 CΣ], (8.4)
where Σ = hx• xT• i − hx• ihx• iT . The second-order term, hx• xT• i, evaluates to
a matrix with x̂• along its diagonal and zero elsewhere. Unlike in factor
analysis, Σ now depends on the input.
To summarize, the mixture of gaussians model can also be implemented
using an autoassociator. The recognition part of the network is linear, fol-
lowed by a softmax nonlinearity. The cost function is the usual squared er-
ror penalized by a regularizer of exactly the same form as in factor analysis.
Similar network interpretations can be obtained for the other probabilistic
models.
18 Our derivation assumes tied covariance and equal mixing coefficients. Slightly more
tics in different parts of (state or observation) space rather than being de-
scribed by a single matrix R. For discrete-mixture models, this idea is well
known, and it is achieved by giving each mixture component a private noise
model. However, for continuous-state models, this idea is relatively unex-
plored and is an interesting area for further investigation. The crux of the
problem is how to parameterize a positive definite matrix over some space.
We propose some simple ways to achieve this. One possibility is replacing
the single covariance shape Q for the observation noise with a conic19 lin-
ear blending of k “basis” covariance shapes. In the case of linear dynamical
systems or factor analysis, this amounts to a novel type of model in which
the local covariance matrix R is computed as a conic linear combination of
several “canonical” covariance matrices through a tensor product between
the current state vector x (or equivalently the “noiseless” observation Cx)
and a master noise tensor R.20 Another approach would be to drop the conic
restriction (allow general linear combinations) and then add a multiple of
the identity matrix to the resulting noise matrix in order to make it positive
definite. A third approach is to represent the covariance shape as the com-
pression of an elastic sphere due to a spatially varying force field. This rep-
resentation is easier to work with because the parameterization of the field
is unconstrained, but it is hard to learn the local field from measurements
of the effective covariance shape. Bishop (1995, sec. 6.3) and others have
considered simple nonparametric methods for estimating input-dependent
noise levels in regression problems. Goldberg, Williams, and Bishop (1998)
have explored this idea in the context of gaussian processes.
It is also interesting to consider what happens to the dynamic models
when the output noise tends to zero. In other words, what are the dynamic
analogs of PCA and vector quantization? For both linear dynamical systems
and HMMs, this causes the state to no longer be hidden. In linear dynamical
systems, the optimal observation matrix is then found by performing PCA
on the data and using the principal components as the columns of C; for
HMMs, C is found by vector quantization of the data (using the codebook
vectors as the columns of C). Given these observation matrices, the state is no
longer hidden. All that remains is to identify a first-order Markov dynamics
in state-space: this is a simple AR(1) model in the continuous case or a first-
order Markov chain in the discrete case. Such zero-noise limits are not only
interesting models in their own right, but are also valuable as good choices
for initialization of learning in linear dynamical systems and HMMs.
19A conic linear combination is one in which all the coefficients are positive.
20For mixtures of gaussians or hidden Markov models, this kind of linear “blend-
ing” merely selects the jth submatrix of the tensor if the discrete state is ej . This is yet
another way to recover the conventional “full” or unconstrained mixture of gaussians or
hidden Markov model emission density in which each cluster or state has its own private
covariance shape for observation noise.
334 Sam Roweis and Zoubin Ghahramani
Appendix
A.1.1 Inference. For factor analysis and related models, the posterior
probability of the hidden state given the observations, P(x• |y• ), is gaus-
sian. The inference problem therefore consists of computing the mean and
covariance of this gaussian, x̂• and V = Cov[x• ]:
FactorAnalysisInference(y• ,C,R)
β ← C0 (CC0 + R)−1
x̂• ← β y•
V ← I − βC
return x̂• , V
FactorAnalysisLearn(Y,k,² )
initialize C, R
compute sample covariance S of Y
while change in log likelihood > ²
% E step
X̂, V ← FactorAnalysisInference(Y,C,R)
δ ← YX̂0
γ ← X̂X̂0 + nV
% M step
C ← δγ −1
set diagonal elements of R to Rii ← (S − Cδ 0 /n)ii
end
return C, R
PCALearn(Y,k,² )
initialize C
while change in squared reconstruction error > ²
% E step
X̂ ← PCAInference(Y,C)
δ ← YX̂0
γ ← X̂X̂0
% M step
C ← δγ −1
end
return C
336 Sam Roweis and Zoubin Ghahramani
Since PCA is not a probability model (it assumes zero noise), the likeli-
hood is undefined, so convergence is assessed by monitoring the squared
reconstruction error.
As before, ej is the unit vector along the jth coordinate direction. The squared
distances ∆i can be generalized to a Mahalanobis metric with respect to
some matrix R, and nonuniform priors π i can easily be incorporated. As
was the case with PCA, the posterior distribution has zero entropy.
We have assumed a common covariance matrix R for all the gaussians; the
extension to different covariances for each gaussian is straightforward.
The k-means vector quantization learning algorithm results when we
take the appropriate limit of the above algorithm:
VQLearn(Y,k,² ) % k-means
initialize C
while change in squared reconstruction error > ²
% E step
initialize δ ← 0, γ ← 0
for i = 1 to n
xi ← VQInference(yi ,C)
δ ← δ + yi x0i
γ ← γ + xi
338 Sam Roweis and Zoubin Ghahramani
end
% M step
for j = 1 to k
Cj ← δj /γ j
end
end
return C
end
return x̂t , V̂t , V̂t,t−1 for all t
LDSLearn(Y,k,² )
initialize A, C, Q, R, x01 , V01
P
set α ← t yt y0t
while change in log likelihood > ²
LDSInference(Y,A,C,Q,R,x01 ,V01 ) % E step
initialize δ ← 0, γ ← 0, β ← 0
for t = 1 to T
δ ← δ + yt x̂0t
γ ← γ + x̂t x̂0t + V̂t
β ← β + x̂t x̂0t−1 + V̂t,t−1 if t > 1
end
γ 1 ← γ − x̂T x̂0T − V̂T
γ 2 ← γ − x̂1 x̂01 − V̂1
% M step
C ← δγ −1
R ← (α − Cδ 0 )/T
A ← βγ −1 1
Q ← (γ 2 − Aβ 0 )/(T − 1)
x01 ← x̂1
V01 ← V̂1
end
return A, C, Q, R, x01 , V01
αt = P(xt , y1 , . . . , yt ) (A.1a)
where both α and β are vectors of the same length as x. We present the
case where the observations yt are real-valued p-dimensional vectors and
the probability density of an observation given the corresponding state (the
“output model”) is assumed to be a single gaussian with mean Cxt and
covariance R. The parameters of the model are therefore a k × k transition
matrix T, initial state prior probability vector π , an observation mean matrix
C, and an observation noise matrix R that is tied across states:
X
T
log P(y1 , . . . , yT ) = log ρt ,
t=1
HMMLearn(Y,k,² ) % Baum-Welch
initialize T, π , C, R
while change in log likelihood > ²
HMMInference(Y,T,π ,C,R) % E step
% M step
π ← γ1
P
T ← t ξt
P
Tij ← Tij / ` Ti` for all i, j
P P
Cj ← t γ t,j yt / t γ t,j for all j
P
R ← t,j γ t,j (yt − Cj )(yt − Cj )0 /T
return T, π , C, R
Acknowledgments
We thank Carlos Brody, Sanjoy Mahajan, and Erik Winfree for many fruitful
discussions in the early stages, the anonymous referees for helpful com-
ments, and Geoffrey Hinton and John Hopfield for providing outstanding
intellectual environments and guidance. S.R. was supported in part by the
Center for Neuromorphic Systems Engineering as a part of the National Sci-
ence Foundation Engineering Research Center Program under grant EEC-
9402726 and by the Natural Sciences and Engineering Research Council of
Canada under an NSERC 1967 Award. Z.G. was supported by the Ontario
Information Technology Research Centre.
References
Amari, S., Cichocki, A., & Yang, H. H. (1996). A new learning algorithm for blind
signal separation. In D. S. Touretzky, M. C. Mozer, & M. E. Hasselmo (Eds.),
Advances in neural information processing systems, 8 (pp. 757–763). Cambridge,
MA: MIT Press.
Attias, H., & Schreiner, C. (1998). Blind source separation and deconvolution:
The dynamic component analysis algorith. Neural Computation, 10, 1373–
1424.
Baldi, P., & Hornik, K. (1989). Neural networks and principal components analy-
sis: Learning from examples without local minima. Neural Networks, 2, 53–58.
Baram, Y., & Roth, Z. (1994). Density shaping by neural networks with application to
classification, estimation and forecasting (Tech. Rep. TR-CIS-94-20). Haifa, Israel:
Center for Intelligent Systems, Technion, Israel Institute for Technology.
Bauer, E., Koller, D., & Singer, Y. (1997). Update rules for parameter estimation in
Bayesian networks. In Proceedings of the Thirteenth Conference on Uncertainty
in Artificial Intelligence (UAI-97). San Mateo, CA: Morgan Kaufmann.
Baum, L. E. (1972). An inequality and associated maximization technique in sta-
342 Sam Roweis and Zoubin Ghahramani
York: Wiley.
Ljung, L., & Söderström, T. (1983). Theory and practice of recursive identification.
Cambridge, MA: MIT Press.
Lloyd, S. P. (1982). Least square quantization in PCM. IEEE Transactions on In-
formation Theory, 28, 128–137.
Lyttkens, E. (1966). On the fixpoint property of Wold’s iterative estimation
method for principal components. In P. Krishnaiah (Ed.), Paper in multivariate
analysis. New York: Academic Press.
MacKay, D. J. C. (1996). Maximum likelihood and covariant algorithms for independent
component analysis (Tech. Rep. Draft 3.7). Cambridge: Cavendish Laboratory,
University of Cambridge.
Moulines, E., & Cardoso, J.-F., & Gassiat, E. (1997). Maximum likelihood for
blind separation and deconvolution of noisy signals using mixture models.
In Proceedings of the International Conference on Acoustics, Speech and Signal
Processing (Vol. 5), pp. 3617–3620.
Neal, R. M. (1993). Probabilistic inference using Markov chain Monte Carlo meth-
ods (Tech. Rep. CRG-TR-93-1). Toronto: Department of Computer Science,
University of Toronto.
Neal, R. M., & Hinton, G. E. (1998). A view of the EM algorithm that justi-
fies incremental, sparse and other variants. In M. I. Jordan (Ed.), Learning in
graphical models (pp. 355–368). Dordrecht, MA: Kluwer.
Nowlan, S. J. (1991). Maximum likelihood competitive learning. In R. P. Lipp-
mann, J. E. Moody, & D. S. Touretzky (Eds.), Advances in neural information
processing systems, 3 (pp. 574–582). San Mateo, CA: Morgan Kaufmann.
Pearl, J. (1988). Probabilistic reasoning in intelligent systems: Networks of plausible
inference. San Mateo, CA: Morgan Kaufmann.
Pearlmutter, B. A., & Parra, L. C. (1997). Maximum likelihood blind source sep-
aration: A context-sensitive generalization of ICA. In M. Mozer, M. Jordan, &
T. Petsche (Eds.), Advances in neural information processing systems, 9 (pp. 613–
619). Cambridge, MA: MIT Press.
Rabiner, L. R., & Juang, B. H. (1986). An introduction to hidden Markov models.
IEEE ASSP Magazine, 3(1), 4–16.
Rauch, H. E. (1963). Solutions to the linear smoothing problem. IEEE Transactions
on Automatic Control, 8, 371–372.
Rauch, H. E., Tung, F., & Striebel, C. T. (1965). Maximum likelihood estimates of
linear dynamic systems. AIAA Journal, 3(8), 1445–1450.
Roweis, S. T. (1998). EM algorithms for PCA and SPCA. In M. Kearns, M. Jordan,
and S. Solla (Eds.), Advances in neural information processing systems, 10 (626–
632). Cambridge, MA: MIT Press. Also Tech Report CNS-TR-97-02, Compu-
tation and Neural Systems, Calif. Institute of Technology.
Rubin, D. B., & Thayer, D. T. (1982). EM algorithms for ML factor analysis.
Psychometrika, 47(1), 69–76.
Saul, L. and Rahim, M. (1998). Modeling acoustic correlations by factor analysis.
In M. Kearns, M. Jordan, & S. Solla (Eds.), Advances in neural information
processing systems, 10 (pp. 749–755). Cambridge, MA: MIT Press.
Shumway, R. H., & Stoffer, D. S. (1982). An approach to time series smoothing
and forecasting using the EM algorithm. Journal of Time Series Analysis, 3(4),
A Unifying Review of Linear Gaussian Models 345
253–264.
Shumway, R. H., & Stoffer, D. S. (1991). Dynamic linear models with switching.
Journal of the American Statistical Association, 86(415), 763–769.
Sirovich, L. (1987). Turbulence and the dynamics of coherent structures. Quar-
terly Applied Mathematics, 45(3), 561–590.
Smyth, P. (1997). Clustering sequences with hidden Markov models. In G.
Tesauro, D. Touretzky, & T. Leen (Eds.), Advances in neural information pro-
cessing systems, 9 (pp. 648–654). Cambridge, MA: MIT Press.
Smyth, P., Heckerman, D., & Jordan, M. (1997). Probabilistic independence net-
works for hidden Markov probability models. Neural Computation, 9, 227–269.
Tipping, M. E., & Bishop, C. M. (1999). Mixtures of probabilistic principal com-
ponent analyzers. Neural Computation, 11, 443–482. Also Tech. Report TR-
NCRG/97/003, Neural Computing Research Group, Aston University.
Tresp, V., Ahmad, S., & Neuneier, R. (1994). Training neural networks with de-
ficient data. In J. D. Cowan, G. Tesauro, & J. Alspector (Eds.), Advances in
neural information processing systems, 6 (pp. 128–135). San Mateo, CA: Morgan
Kaufmann.
Viterbi, A. J. (1967). Error bounds for convolutional codes and an asymptotically
optimal decoding algorithm. IEEE Transactions on Information Theory, IT-13,
260–269.
Whittaker, J. (1990). Graphical models in applied multivariate statistics. Chichester,
England: Wiley.