Please enable JavaScript to view this site.

IBM® SPSS® Amos™ 28

This section describes Amos's implementation of the Metropolis algorithm, a type of Markov chain Monte Carlo (MCMC) algorithm.

Notation

Let matrix thetacontain the model parameters. To be concrete, take the following model for the attg_yng.sav data, in which age is used to predict memory performance after training (recall2).

7602

The model has five parameters: one mean (a), two variances (b and e), a regression weight (c) and an intercept (d), so matrix theta has five elements,

theta with symbols .

The maximum likelihood estimates can be displayed on the path diagram, as shown here,

7604

or as the vector,

theta with ML estimates.

The "hat" over matrix theta means that 7652 contains estimates of the parameters and not the true parameter values.

Sampling from the posterior distribution of the parameters

An MCMC algorithm (such as a Metropolis algorithm) generates a sequence of parameter vectors 7606drawn from the posterior distribution of matrix theta. Here is a portion of the sequence generated by Amos's MCMC algorithm when fitting the above model.

theta sequence numerical

It is typical to run the MCMC algorithm until the sequence contains many thousands of vectors. To get an idea of how such a sequence can be used to make inferences about matrix theta, notice that in the short sequence shown above, sampled values for the mean of age are all close to 20. If this pattern holds up over a lengthy sequence you can conclude that the true mean of age in the population is close to 20. To be more precise, pick an age interval, say from 20 years to 22 years. The probability that the mean age in the population is between 20 and 22 is the same as the probability that an MCMC-generated matrix theta will have a number between 20 and 22 as its first element. You can estimate that probability by generating a long sequence of matrix thetavectors and calculating the proportion of those vectors that contain a number between 20 and 22 as the first element.

MCMC algorithms

Several MCMC algorithms have been proposed for generating the sequence, 7606. An MCMC algorithm begins with an initial parameter vector, theta1. Amos sets 7648. (But see the later section called Pre-burn-in.) The algorithm consists of a rule for moving from one member of the sequence to the next. Using theta1 as a starting point, the algorithm generates 7609, using 7609 it generates theta3, and so on.

Metropolis algorithms

Amos implements a type of MCMC algorithm known as a Metropolis algorithm. In a Metropolis algorithm, generating 7612 from 7611 is a two stage process. In the first stage, a candidate vector, theta candidateis generated. In Amos, the candidate vector is generated as 7614, where

7615 is a normally distributed random vector with mean 7616 and covariance matrix equal to the estimated parameter covariance matrix obtained from the information matrix after using maximum likelihood to fit the model.

7617 is the "tuning parameter" whose value you can specify on the MCMC tab in the Bayesian SEM Options window. Large values of 7617 tend to result in larger moves from 7611 to theta candidate. The default value for 7617 is .7.

In the second stage of a Metropolis algorithm, the candidate vector is either accepted, in which case 7612 is set equal to theta candidate, or it is rejected, in which case 7612 is set equal to 7611. In the sequence shown earlier, it appears that 7618was accepted because 7621 is different from 7619. On the other hand, it appears that 7622 and 7623 were rejected because 7624 and 7625are each equal to 7621. Whether a candidate vector is accepted depends on its posterior probability. Letting 7626 stand for the posterior distribution of matrix theta, theta candidateis accepted or rejected according to the rule

Reject theta candidate if 7642=0. In other words, always reject a matrix theta that has a posterior probability density of zero.

Accept theta candidate if 7642>7644. In other words, always accept a move to any new matrix theta that has higher posterior probability density than the current matrix theta.

If 0 < 7642 < 7644, accept theta candidate with probability 7647.

Burn-in

Because theta1 is not drawn from the posterior distribution of matrix theta, it is customary to discard the early part of the sequence, 7606. By default, Amos discards 7649, called the burn-in sample, and uses 7650(the analysis sample) to draw inferences about the posterior distribution of matrix theta. You can change the number of burn-in samples on the MCMC tab of the Bayesian SEM Options window.

Pre-burn-in

It can happen that 7651=0, and that the Metropolis algorithm starts out by rejecting a very large number of candidates before eventually accepting one. This can happen, for example, if the maximum likelihood estimate, 7652, is inadmissible and there is a check mark next to Admissibility test on the Prior tab of the Bayesian SEM Options window. Because of the possibility of a long run of rejected candidates at the beginning, Amos discards every sample until it first accepts a candidate. At that point, the samples are renumbered so that the first accepted candidate becomes theta1. During the pre-burn-in period, the message Waiting to accept a transition before beginning burn-in is displayed in the lower-right corner of the screen.

© 2021 Amos Development Corporation