Ladder paradox

From formulasearchengine
Jump to navigation Jump to search

28 year-old Painting Investments Worker Truman from Regina, usually spends time with pastimes for instance interior design, property developers in new launch ec Singapore and writing. Last month just traveled to City of the Renaissance.

Variational Bayesian methods are a family of techniques for approximating intractable integrals arising in Bayesian inference and machine learning. They are typically used in complex statistical models consisting of observed variables (usually termed "data") as well as unknown parameters and latent variables, with various sorts of relationships among the three types of random variables, as might be described by a graphical model. As is typical in Bayesian inference, the parameters and latent variables are grouped together as "unobserved variables". Variational Bayesian methods are primarily used for two purposes:

  1. To provide an analytical approximation to the posterior probability of the unobserved variables, in order to do statistical inference over these variables.
  2. To derive a lower bound for the marginal likelihood (sometimes called the "evidence") of the observed data (i.e. the marginal probability of the data given the model, with marginalization performed over unobserved variables). This is typically used for performing model selection, the general idea being that a higher marginal likelihood for a given model indicates a better fit of the data by that model and hence a greater probability that the model in question was the one that generated the data. (See also the Bayes factor article.)

In the former purpose (that of approximating a posterior probability), variational Bayes is an alternative to Monte Carlo sampling methods — particularly, Markov chain Monte Carlo methods such as Gibbs sampling — for taking a fully Bayesian approach to statistical inference over complex distributions that are difficult to directly evaluate or sample from. In particular, whereas Monte Carlo techniques provide a numerical approximation to the exact posterior using a set of samples, Variational Bayes provides a locally-optimal, exact analytical solution to an approximation of the posterior.

Variational Bayes can be seen as an extension of the EM (expectation-maximization) algorithm from maximum a posteriori estimation (MAP estimation) of the single most probable value of each parameter to fully Bayesian estimation which computes (an approximation to) the entire posterior distribution of the parameters and latent variables. As in EM, it finds a set of optimal parameter values, and it has the same alternating structure as does EM, based on a set of interlocked (mutually dependent) equations that cannot be solved analytically.

For many applications, variational Bayes produces solutions of comparable accuracy to Gibbs sampling at greater speed. However, deriving the set of equations used to iteratively update the parameters often requires a large amount of work compared with deriving the comparable Gibbs sampling equations. This is the case even for many models that are conceptually quite simple, as is demonstrated below in the case of a basic non-hierarchical model with only two parameters and no latent variables.

Mathematical derivation of the mean-field approximation

In variational inference, the posterior distribution over a set of unobserved variables Z={Z1Zn} given some data X is approximated by a variational distribution, Q(Z):

P(ZX)Q(Z).

The distribution Q(Z) is restricted to belong to a family of distributions of simpler form than P(ZX), selected with the intention of making Q(Z) similar to the true posterior, P(ZX). The lack of similarity is measured in terms of a dissimilarity function d(Q;P) and hence inference is performed by selecting the distribution Q(Z) that minimizes d(Q;P).

The most common type of variational Bayes, known as mean-field variational Bayes, uses the Kullback–Leibler divergence (KL-divergence) of P from Q as the choice of dissimilarity function. This choice makes this minimization tractable. The KL-divergence is defined as

DKL(Q||P)=ZQ(Z)logQ(Z)P(ZX).

Note that Q and P are reversed from what one might expect. This use of reversed KL-divergence is conceptually similar to the expectation-maximization algorithm. (Using the KL-divergence in the other way produces the expectation propagation algorithm.)

The KL-divergence can be written as

DKL(Q||P)=ZQ(Z)logQ(Z)P(Z,X)+logP(X),

or

logP(X)=DKL(Q||P)ZQ(Z)logQ(Z)P(Z,X)=DKL(Q||P)+(Q).

As the log evidence logP(X) is fixed with respect to Q, maximizing the final term (Q) minimizes the KL divergence of P from Q. By appropriate choice of Q, (Q) becomes tractable to compute and to maximize. Hence we have both an analytical approximation Q for the posterior P(ZX), and a lower bound (Q) for the evidence logP(X). The lower bound (Q) is known as the (negative) variational free energy because it can also be expressed as an "energy" EQ[logP(Z,X)] plus the entropy of Q.

In practice

The variational distribution Q(Z) is usually assumed to factorize over some partition of the latent variables, i.e. for some partition of the latent variables Z into Z1ZM,

Q(Z)=i=1Mqi(ZiX)

It can be shown using the calculus of variations (hence the name "variational Bayes") that the "best" distribution qj* for each of the factors qj (in terms of the distribution minimizing the KL divergence, as described above) can be expressed as:

qj*(ZjX)=eEij[lnp(Z,X)]eEij[lnp(Z,X)]dZj

where Eij[lnp(Z,X)] is the expectation of the logarithm of the joint probability of the data and latent variables, taken over all variables not in the partition.

In practice, we usually work in terms of logarithms, i.e.:

lnqj*(ZjX)=Eij[lnp(Z,X)]+constant

The constant in the above expression is related to the normalizing constant (the denominator in the expression above for qj*) and is usually reinstated by inspection, as the rest of the expression can usually be recognized as being a known type of distribution (e.g. Gaussian, gamma, etc.).

Using the properties of expectations, the expression Eij[lnp(Z,X)] can usually be simplified into a function of the fixed hyperparameters of the prior distributions over the latent variables and of expectations (and sometimes higher moments such as the variance) of latent variables not in the current partition (i.e. latent variables not included in Zj). This creates circular dependencies between the parameters of the distributions over variables in one partition and the expectations of variables in the other partitions. This naturally suggests an iterative algorithm, much like EM (the expectation-maximization algorithm), in which the expectations (and possibly higher moments) of the latent variables are initialized in some fashion (perhaps randomly), and then the parameters of each distribution are computed in turn using the current values of the expectations, after which the expectation of the newly computed distribution is set appropriately according to the computed parameters. An algorithm of this sort is guaranteed to converge.[1] Furthermore, if the distributions in question are part of the exponential family, which is usually the case, convergence will be to a global maximum, since the exponential family is convex.[2]

In other words, for each of the partitions of variables, by simplifying the expression for the distribution over the partition's variables and examining the distribution's functional dependency on the variables in question, the family of the distribution can usually be determined (which in turn determines the value of the constant). The formula for the distribution's parameters will be expressed in terms of the prior distributions' hyperparameters (which are known constants), but also in terms of expectations of functions of variables in other partitions. Usually these expectations can be simplified into functions of expectations of the variables themselves (i.e. the means); sometimes expectations of squared variables (which can be related to the variance of the variables), or expectations of higher powers (i.e. higher moments) also appear. In most cases, the other variables' distributions will be from known families, and the formulas for the relevant expectations can be looked up. However, those formulas depend on those distributions' parameters, which depend in turn on the expectations about other variables. The result is that the formulas for the parameters of each variable's distributions can be expressed as a series of equations with mutual, nonlinear dependencies among the variables. Usually, it is not possible to solve this system of equations directly. However, as described above, the dependencies suggest a simple iterative algorithm, which in most cases is guaranteed to converge. An example will make this process clearer.

A basic example

Consider a simple non-hierarchical Bayesian model consisting of a set of i.i.d. observations from a Gaussian distribution, with unknown mean and variance.[3] In the following, we work through this model in great detail to illustrate the workings of the variational Bayes method.

For mathematical convenience, in the following example we work in terms of the precision — i.e. the reciprocal of the variance — rather than the variance itself. (From a theoretical standpoint, precision and variance are equivalent since there is a one-to-one correspondence between the two.)

The mathematical model

We place conjugate prior distributions on the unknown mean and variance, i.e. the mean also follows a Gaussian distribution while the precision follows a gamma distribution. In other words:

μ𝒩(μ0,(λ0τ)1)τΓ(a0,b0){x1,,xN}𝒩(μ,τ1)N=number of data points

We are given N data points X={x1,,xN} and our goal is to infer the posterior distribution q(μ,τ)=p(μ,τx1,,xN) of the parameters μ and τ.

The hyperparameters μ0, λ0, a0 and b0 are fixed, given values. They can be set to small positive numbers to give broad prior distributions indicating ignorance about the prior distributions of μ and τ.

The joint probability

The joint probability of all variables can be rewritten as

p(X,μ,τ)=p(Xμ,τ)p(μτ)p(τ)

where the individual factors are

p(Xμ,τ)=n=1N𝒩(xnμ,τ1)p(μτ)=𝒩(μμ0,(λ0τ)1)p(τ)=Γ(τa0,b0)

where

𝒩(xμ,σ2)=12πσ2e(xμ)22σ2Γ(τa,b)=1Γ(a)baτa1ebτ

Factorized approximation

Assume that q(μ,τ)=q(μ)q(τ), i.e. that the posterior distribution factorizes into independent factors for μ and τ. This type of assumption underlies the variational Bayesian method. The true posterior distribution does not in fact factor this way (in fact, in this simple case, it is known to be a Gaussian-gamma distribution), and hence the result we obtain will be an approximation.

Derivation of q(μ)

Then

lnqμ*(μ)=Eτ[lnp(Xμ,τ)+lnp(μτ)+lnp(τ)]+C=Eτ[lnp(Xμ,τ)]+Eτ[lnp(μτ)]+Eτ[lnp(τ)]+C=Eτ[lnn=1N𝒩(xnμ,τ1)]+Eτ[ln𝒩(μμ0,(λ0τ)1)]+C2=Eτ[lnn=1Nτ2πe(xnμ)2τ2]+Eτ[lnλ0τ2πe(μμ0)2λ0τ2]+C2=Eτ[n=1N(12(lnτln2π)(xnμ)2τ2))]+Eτ[12(lnλ0+lnτln2π)(μμ0)2λ0τ2]+C2=Eτ[n=1N(xnμ)2τ2]+Eτ[(μμ0)2λ0τ2]+Eτ[n=1N12(lnτln2π)]+Eτ[12(lnλ0+lnτln2π)]+C2=Eτ[n=1N(xnμ)2τ2]+Eτ[(μμ0)2λ0τ2]+C3=Eτ[τ]2{n=1N(xnμ)2+λ0(μμ0)2}+C3

In the above derivation, C, C2 and C3 refer to values that are constant with respect to μ. Note that the term Eτ[lnp(τ)] is not a function of μ and will have the same value regardless of the value of μ. Hence in line 3 we can absorb it into the constant term at the end. We do the same thing in line 7.

The last line is simply a quadratic polynomial in μ. Since this is the logarithm of qμ*(μ), we can see that qμ*(μ) itself is a Gaussian distribution.

With a certain amount of tedious math (expanding the squares inside of the braces, separating out and grouping the terms involving μ and μ2 and completing the square over μ), we can derive the parameters of the Gaussian distribution:

lnqμ*(μ)=Eτ[τ]2{n=1N(xnμ)2+λ0(μμ0)2}+C3=Eτ[τ]2{n=1N(xn22xnμ+μ2)+λ0(μ22μ0μ+μ02)}+C3=Eτ[τ]2{(n=1Nxn2)2(n=1Nxn)μ+(n=1Nμ2)+λ0μ22λ0μ0μ+λ0μ02}+C3=Eτ[τ]2{(λ0+N)μ22(λ0μ0+n=1Nxn)μ+(n=1Nxn2)+λ0μ02}+C3=Eτ[τ]2{(λ0+N)μ22(λ0μ0+n=1Nxn)μ}+C4=Eτ[τ]2{(λ0+N)μ22λ0μ0+n=1Nxnλ0+N(λ0+N)μ}+C4=Eτ[τ]2{(λ0+N)(μ22λ0μ0+n=1Nxnλ0+Nμ)}+C4=Eτ[τ]2{(λ0+N)(μ22λ0μ0+n=1Nxnλ0+Nμ+(λ0μ0+n=1Nxnλ0+N)2(λ0μ0+n=1Nxnλ0+N)2)}+C4=Eτ[τ]2{(λ0+N)(μ22λ0μ0+n=1Nxnλ0+Nμ+(λ0μ0+n=1Nxnλ0+N)2)}+C5=Eτ[τ]2{(λ0+N)(μλ0μ0+n=1Nxnλ0+N)2}+C5=12{(λ0+N)Eτ[τ](μλ0μ0+n=1Nxnλ0+N)2}+C5

Note that all of the above steps can be shortened by using the formula for the sum of two quadratics.

In other words:

qμ*(μ)𝒩(μμN,λN1)μN=λ0μ0+Nx¯λ0+NλN=(λ0+N)E[τ]x¯=1Nn=1Nxn

Derivation of q(τ)

The derivation of qτ*(τ) is similar to above, although we omit some of the details for the sake of brevity.

lnqτ*(τ)=Eμ[lnp(Xμ,τ)+lnp(μτ)]+lnp(τ)+constant=(a01)lnτb0τ+12lnτ+N2lnττ2Eμ[n=1N(xnμ)2+λ0(μμ0)2]+constant

Exponentiating both sides, we can see that qτ*(τ) is a gamma distribution. Specifically:

qτ*(τ)Γ(τaN,bN)aN=a0+N+12bN=b0+12Eμ[n=1N(xnμ)2+λ0(μμ0)2]

Algorithm for computing the parameters

Let us recap the conclusions from the previous sections:

qμ*(μ)𝒩(μμN,λN1)μN=λ0μ0+Nx¯λ0+NλN=(λ0+N)E[τ]x¯=1Nn=1Nxn

and

qτ*(τ)Γ(τaN,bN)aN=a0+N+12bN=b0+12Eμ[n=1N(xnμ)2+λ0(μμ0)2]


In each case, the parameters for the distribution over one of the variables depend on expectations taken with respect to the other variable. We can expand the expectations, using the standard formulas for the expectations of moments of the Gaussian and gamma distributions:

E[τaN,bN]=aNbNE[μμN,λN1]=μNE[X2]=Var(X)+(E[X])2E[μ2μN,λN1]=λN1+μN2


Applying these formulas to the above equations is trivial in most cases, but the equation for bN takes more work:

bN=b0+12Eμ[n=1N(xnμ)2+λ0(μμ0)2]=b0+12Eμ[(λ0+N)μ22(λ0μ0+n=1Nxn)μ+(n=1Nxn2)+λ0μ02]=b0+12[(λ0+N)Eμ[μ2]2(λ0μ0+n=1Nxn)Eμ[μ]+(n=1Nxn2)+λ0μ02]=b0+12[(λ0+N)(λN1+μN2)2(λ0μ0+n=1Nxn)μN+(n=1Nxn2)+λ0μ02]


We can then write the parameter equations as follows, without any expectations:

μN=λ0μ0+Nx¯λ0+NλN=(λ0+N)aNbNx¯=1Nn=1NxnaN=a0+N+12bN=b0+12[(λ0+N)(λN1+μN2)2(λ0μ0+n=1Nxn)μN+(n=1Nxn2)+λ0μ02]


Note that there are circular dependencies among the formulas for μN, λN and bN. This naturally suggests an EM-like algorithm:

  1. Compute n=1Nxn and n=1Nxn2. Use these values to compute μN and aN.
  2. Initialize λN to some arbitrary value.
  3. Use the current value of λN, along with the known values of the other parameters, to compute bN.
  4. Use the current value of bN, along with the known values of the other parameters, to compute λN.
  5. Repeat the last two steps until convergence (i.e. until neither value has changed more than some small amount).

We then have values for the hyperparameters of the approximating distributions of the posterior parameters, which we can use to compute any properties we want of the posterior — e.g. its mean and variance, a 95% highest-density region (the smallest interval that includes 95% of the total probability), etc.

It can be shown that this algorithm is guaranteed to converge to a local maximum, and since both posterior distributions are in the exponential family, this local maximum will be a global maximum.

Note also that the posterior distributions have the same form as the corresponding prior distributions. We did not assume this; the only assumption we made was that the distributions factorize, and the form of the distributions followed naturally. It turns out (see below) that the fact that the posterior distributions have the same form as the prior distributions is not a coincidence, but a general result whenever the prior distributions are members of the exponential family, which is the case for most of the standard distributions.

Further discussion

Step-by-step recipe

The above example shows the method by which the variational-Bayesian approximation to a posterior probability density in a given Bayesian network is derived:

  1. Describe the network with a graphical model, identifying the observed variables (data) X and unobserved variables (parameters Θ and latent variables Z) and their conditional probability distributions. Variational Bayes will then construct an approximation to the posterior probability p(Z,ΘX). The approximation has the basic property that it is a factorized distribution, i.e. a product of two or more independent distributions over disjoint subsets of the unobserved variables.
  2. Partition the unobserved variables into two or more subsets, over which the independent factors will be derived. There is no universal procedure for doing this; creating too many subsets yields a poor approximation, while creating too few makes the entire variational Bayes procedure intractable. Typically, the first split is to separate the parameters and latent variables; often, this is enough by itself to produce a tractable result. Assume that the partitions are called Z1,,ZM.
  3. For a given partition Zj, write down the formula for the best approximating distribution qj*(ZjX) using the basic equation lnqj*(ZjX)=Eij[lnp(Z,X)]+constant .
  4. Fill in the formula for the joint probability distribution using the graphical model. Any component conditional distributions that don't involve any of the variables in Zj can be ignored; they will be folded into the constant term.
  5. Simplify the formula and apply the expectation operator, following the above example. Ideally, this should simplify into expectations of basic functions of variables not in Zj (e.g. first or second raw moments, expectation of a logarithm, etc.). In order for the variational Bayes procedure to work well, these expectations should generally be expressible analytically as functions of the parameters and/or hyperparameters of the distributions of these variables. In all cases, these expectation terms are constants with respect to the variables in the current partition.
  6. The functional form of the formula with respect to the variables in the current partition indicates the type of distribution. In particular, exponentiating the formula generates the probability density function (PDF) of the distribution (or at least, something proportional to it, with unknown normalization constant). In order for the overall method to be tractable, it should be possible to recognize the functional form as belonging to a known distribution. Significant mathematical manipulation may be required to convert the formula into a form that matches the PDF of a known distribution. When this can be done, the normalization constant can be reinstated by definition, and equations for the parameters of the known distribution can be derived by extracting the appropriate parts of the formula.
  7. When all expectations can be replaced analytically with functions of variables not in the current partition, and the PDF put into a form that allows identification with a known distribution, the result is a set of equations expressing the values of the optimum parameters as functions of the parameters of variables in other partitions.
  8. When this procedure can be applied to all partitions, the result is a set of mutually linked equations specifying the optimum values of all parameters.
  9. An expectation maximization (EM) type procedure is then applied, picking an initial value for each parameter and the iterating through a series of steps, where at each step we cycle through the equations, updating each parameter in turn. This is guaranteed to converge.

Most important points

Due to all of the mathematical manipulations involved, it is easy to lose track of the big picture. The important things are:

  1. The idea of variational Bayes is to construct an analytical approximation to the posterior probability of the set of unobserved variables (parameters and latent variables), given the data. This means that the form of the solution is similar to other Bayesian inference methods, such as Gibbs sampling — i.e. a distribution that seeks to describe everything that is known about the variables. As in other Bayesian methods — but unlike e.g. in expectation maximization (EM) or other maximum likelihood methods — both types of unobserved variables (i.e. parameters and latent variables) are treated the same, i.e. as random variables. Estimates for the variables can then be derived in the standard Bayesian ways, e.g. calculating the mean of the distribution to get a single point estimate or deriving a credible interval, highest density region, etc.
  2. "Analytical approximation" means that a formula can be written down for the posterior distribution. The formula generally consists of a product of well-known probability distributions, each of which factorizes over a set of unobserved variables (i.e. it is conditionally independent of the other variables, given the observed data). This formula is not the true posterior distribution, but an approximation to it; in particular, it will generally agree fairly closely in the lowest moments of the unobserved variables, e.g. the mean and variance.
  3. The result of all of the mathematical manipulations is (1) the identity of the probability distributions making up the factors, and (2) mutually dependent formulas for the parameters of these distributions. The actual values of these parameters are computed numerically, through an alternating iterative procedure much like EM.

Compared with expectation maximization (EM)

Variational Bayes (VB) is often compared with expectation maximization (EM). The actual numerical procedure is quite similar, in that both are alternating iterative procedures that successively converge on optimum parameter values. The initial steps to derive the respective procedures are also vaguely similar, both starting out with formulas for probability densities and both involving significant amounts of mathematical manipulations.

However, there are a number of differences. Most important is what is being computed.

  • EM computes point estimates of posterior distribution of those random variables that can be categorized as "parameters", but estimates of the actual posterior distributions of the latent variables (at least in "soft EM", and often only when the latent variables are discrete). The point estimates computed are the modes of these parameters; no other information is available.
  • VB, on the other hand, computes estimates of the actual posterior distribution of all variables, both parameters and latent variables. When point estimates need to be derived, generally the mean is used rather than the mode, as is normal in Bayesian inference. Concomitant with this, it should be noted that the parameters computed in VB do not have the same significance as those in EM. EM computes optimum values of the parameters of the Bayes network itself. VB computes optimum values of the parameters of the distributions used to approximate the parameters and latent variables of the Bayes network. For example, a typical Gaussian mixture model will have parameters for the mean and variance of each of the mixture components. EM would directly estimate optimum values for these parameters. VB, however, would first fit a distribution to these parameters — typically in the form of a prior distribution, e.g. a normal-scaled inverse gamma distribution — and would then compute values for the parameters of this prior distribution, i.e. essentially hyperparameters. In this case, VB would compute optimum estimates of the four parameters of the normal-scaled inverse gamma distribution that describes the joint distribution of the mean and variance of the component.


A more complex example

Bayesian Gaussian mixture model using plate notation. Smaller squares indicate fixed parameters; larger circles indicate random variables. Filled-in shapes indicate known values. The indication [K] means a vector of size K; [D,D] means a matrix of size D×D; K alone means a categorical variable with K outcomes. The squiggly line coming from z ending in a crossbar indicates a switch — the value of this variable selects, for the other incoming variables, which value to use out of the size-K array of possible values.

Imagine a Bayesian Gaussian mixture model described as follows:

πSymDir(K,α0)Λi=1K𝒲(W0,ν0)μi=1K𝒩(μ0,(β0Λi)1)z[i=1N]Mult(1,π)xi=1N𝒩(μzi,Λzi1)K=number of mixing componentsN=number of data points

Note:

The interpretation of the above variables is as follows:

  • X={x1,,xN} is the set of N data points, each of which is a K-dimensional vector distributed according to a multivariate Gaussian distribution.
  • Z={z1,,zN} is a set of latent variables, one per data point, specifying which mixture component the corresponding data point belongs to, using a "one-of-K" vector representation with components znk for k=1K, as described above.
  • π is the mixing proportions for the K mixture components.
  • μi=1K and Λi=1K specify the parameters (mean and precision) associated with each mixture component.

The joint probability of all variables can be rewritten as

p(X,Z,π,μ,Λ)=p(XZ,μ,Λ)p(Zπ)p(π)p(μΛ)p(Λ)

where the individual factors are

p(XZ,μ,Λ)=n=1Nk=1K𝒩(xnμk,Λk1)znkp(Zπ)=n=1Nk=1Kπkznkp(π)=Γ(Kα0)Γ(α0)Kk=1Kπkα01p(μΛ)=k=1K𝒩(μkμ0,(β0Λk)1)p(Λ)=k=1K𝒲(ΛkW0,ν0)

where

𝒩(xμ,Σ)=1(2π)D/21|Σ|1/2exp{12(xμ)TΣ1(xμ)}𝒲(ΛW,ν)=B(W,ν)|Λ|(νD1)/2exp(12Tr(W1Λ))B(W,ν)=|W|ν/2(2νD/2πD(D1)/4i=1DΓ(ν+1i2))1D=dimensionality of each data point

Assume that q(Z,π,μ,Λ)=q(Z)q(π,μ,Λ).

Then

lnq*(Z)=Eπ,μ,Λ[lnp(X,Z,π,μ,Λ)]+constant=Eπ[lnp(Zπ)]+Eμ,Λ[lnp(XZ,μ,Λ)]+constant=n=1Nk=1Kznklnρnk+constant

where we have defined

lnρnk=E[lnπk]+12E[ln|Λk|]D2ln(2π)12Eμk,Λk[(xnμk)TΛk(xnμk)]

Exponentiating both sides of the formula for lnq*(Z) yields

q*(Z)n=1Nk=1Kρnkznk

Requiring that this be normalized ends up requiring that the ρnk sum to 1 over all values of k, yielding

q*(Z)=n=1Nk=1Krnkznk

where

rnk=ρnkj=1Kρnj

In other words, q*(Z) is a product of single-observation multinomial distributions, and factors over each individual zn, which is distributed as a single-observation multinomial distribution with parameters rnk for k=1K.

Furthermore, we note that

E[znk]=rnk

which is a standard result for categorical distributions.

Now, considering the factor q(π,μ,Λ), note that it automatically factors into q(π)k=1Kq(μk,Λk) due to the structure of the graphical model defining our Gaussian mixture model, which is specified above.

Then,

lnq*(π)=lnp(π)+EZ[lnp(Zπ)]+constant=(α01)k=1Klnπk+n=1Nk=1Krnklnπk+constant

Taking the exponential of both sides, we recognize q*(π) as a Dirichlet distribution

q*(π)Dir(α)

where

αk=α0+Nk

where

Nk=n=1Nrnk

Finally

lnq*(μk,Λk)=lnp(μk,Λk)+n=1NE[znk]ln𝒩(xnμk,Λk1)+constant

Grouping and reading off terms involving μk and Λk, the result is a Gaussian-Wishart distribution given by

q*(μk,Λk)=𝒩(μkmk,(βkΛk)1)𝒲(ΛkWk,νk)

given the definitions

βk=β0+Nkmk=1βk(β0μ0+Nkx¯k)Wk1=W01+NkSk+β0Nkβ0+Nk(x¯kμ0)(x¯kμ0)Tνk=ν0+NkNk=n=1Nrnkx¯k=1Nkn=1NrnkxnSk=1Nkn=1N(xnx¯k)(xnx¯k)T

Finally, notice that these functions require the values of rnk, which make use of ρnk, which is defined in turn based on E[lnπk], E[ln|Λk|], and Eμk,Λk[(xnμk)TΛk(xnμk)]. Now that we have determined the distributions over which these expectations are taken, we can derive formulas for them:

Eμk,Λk[(xnμk)TΛk(xnμk)]=Dβk1+νk(xnmk)TWk(xnmk)lnΛ~kE[ln|Λk|]=i=1Dψ(νk+1i2)+Dln2+ln|Wk|lnπ~kE[ln|πk|]=ψ(αk)ψ(i=1Kαi)

These results lead to

rnkπ~kΛ~k1/2exp{D2βkνk2(xnmk)TWk(xnmk)}

These can be converted from proportional to absolute values by normalizing over k so that the corresponding values sum to 1.

Note that:

  1. The update equations for the parameters βk, mk, Wk and νk of the variables μk and Λk depend on the statistics Nk, x¯k, and Sk, and these statistics in turn depend on rnk.
  2. The update equations for the parameters α1K of the variable π depend on the statistic Nk, which depends in turn on rnk.
  3. The update equation for rnk has a direct circular dependence on βk, mk, Wk and νk as well as an indirect circular dependence on Wk, νk and α1K through π~k and Λ~k.

This suggests an iterative procedure that alternates between two steps:

  1. An E-step that computes the value of rnk using the current values of all the other parameters.
  2. An M-step that uses the new value of rnk to compute new values of all the other parameters.

Note that these steps correspond closely with the standard EM algorithm to derive a maximum likelihood or maximum a posteriori (MAP) solution for the parameters of a Gaussian mixture model. The responsibilities rnk in the E step correspond closely to the posterior probabilities of the latent variables given the data, i.e. p(ZX); the computation of the statistics Nk, x¯k, and Sk corresponds closely to the computation of corresponding "soft-count" statistics over the data; and the use of those statistics to compute new values of the parameters corresponds closely to the use of soft counts to compute new parameter values in normal EM over a Gaussian mixture model.

Exponential-family distributions

Note that in the previous example, once the distribution over unobserved variables was assumed to factorize into distributions over the "parameters" and distributions over the "latent data", the derived "best" distribution for each variable was in the same family as the corresponding prior distribution over the variable. This is a general result that holds true for all prior distributions derived from the exponential family.

See also

Template:More footnotes

Notes

43 year old Petroleum Engineer Harry from Deep River, usually spends time with hobbies and interests like renting movies, property developers in singapore new condominium and vehicle racing. Constantly enjoys going to destinations like Camino Real de Tierra Adentro.

References

  • 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534

External links

  1. 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534
  2. Christopher Bishop, Pattern Recognition and Machine Learning, 2006
  3. Based on Chapter 10 of Pattern Recognition and Machine Learning by Christopher M. Bishop