Appendix A. An adaptive Metropolis-Hastings scheme.

The adaptive Metropolis-Hastings (MH) scheme was divided into three parts, (i) an adaptive random-walk MH phase for initial exploration of the posterior distribution, (ii) an adaptive independence MH phase for fine tuning proposals and (iii) a fixed proposal independence MH whose output was used for analysis. The two first phases are a modified version of the scheme given by Pitt et al. (2010). Below we will assume that the dimension of the parameter space is
**Random-walk phase**

For the random-walk phase we used multivariate random-walk proposals, θ_{(i)}^{*} = θ_{(i-1)} + ε_{i} where ε_{i} is drawn from a zero mean multivariate normal mixture distribution. From iteration 1 and until 2*d* Metropolis Hastings proposals had been accepted, ε_{i} was drawn from the normal distribution *N*(0, 0.1*I*_{d}) where *I*_{d} is the identity matrix. Thereafter a proposal was constructed at each iteration from the sample covariance matrix *S*_{i} of the history of the MCMC chain, from i.e. the vectors θ_{(1)}, θ_{(2)},…, θ_{(i-1)}. Specifically, the proposal at iteration *i* was drawn from the mixture ε_{i} ~ 0.4 *N*(0, 0.1*I*_{d}) + 0.5 *N*(0, 2.38^{2} / *d* *S*_{i}) + 0.1 *N*(0, 5·2.38^{2} / *d* *S*_{i}). The first component allows component-wise independent and un-scaled moves. The second component adapts its variance according to the variance of the chain using the scaling 2.38^{2} / *d* as suggested by Roberts and Rosenthal (2009). The third component is an inflated version of component 2 allowing for larger jumps in parameter space.

**Adaptive independence phase**

After 4000 iterations the random-walk proposals were abandoned and replaced by independence proposals θ_{(i)}^{*} = θ_{i} where θ_{i} is drawn from multivariate normal mixture. The underlying idea is that after the random-walk phase a sufficiently good picture of the posterior should have been obtained in order to construct a normal mixture that at least crudely covers and approximates the high density regions of the posterior. The approximation is built from the history of the chain using the *k*-means clustering algorithm. This is a heuristic algorithm that given a sequence of multivariate data points and a fixed number of clusters, *k*, partitions the data points into *k* classes in order to minimize the within cluster sum of squares. We first linearly transformed the MCMC chain to obtain equal sample variances for all components. For *k* = 1, …, 6, we applied the *k*-means algorithm to the transformed sample (using the R function kmeans). Using the resulting classifications for each *k*, a multivariate normal distribution was fitted to the original MCMC values within each of the *k* clusters (using the sample mean and sample covariance matrix). The BIC of the multivariate normal mixture with the fitted components and weights equal to the proportion of points within each of the classes (as computed by *k*-means) was then computed for each *k*. Finally, the mixture proposal was constructed by combining the mixture with the lowest BIC selected from the above with another mixture having the same weights, means and number of components but with the component variances inflated by a factor 5. The inflated components serve as a safe guard in case the high density regions of the posterior have not yet been explored by the chain.

**Non-adaptive independence phase**

After in total 20000 iterations the adaptations of the independence proposals were stopped and the last proposal mixture was used for 30000 iterations.

FIG. A1. Trace plots of the particle MCMC for the logistic diffusion model. The first 4000 iterations constitute an adaptive random-walk Metropolis-Hastings phase (dark shading), the next 16000 iterations an adaptive independence Metropolis-Hastings phase (light shading) and the final 30000 iterations an independence Metropolis-Hastings phase with a fixed proposal distribution.

LITERATURE CITED

Pitt, M. Silva, R., Giordani, P. and R. Kohn. 2010. Auxiliary particle filtering within adaptive Metropolis Hastings sampling. Preprint arXiv:1006.1914v1.

Roberts, G. O., and J. S. Rosenthal. 2009. Examples of Adaptive MCMC. Journal of Computational and Graphical Statistics 18:349–367.