Skip to content

4. MCMC convergence

Catalina Vallejos edited this page Jun 7, 2020 · 4 revisions

‼️ THIS WIKI IS NO LONGER MAINTAINED - PLEASE REFER TO THE VIGNETTE INSTEAD ‼️

The following code generates a synthetic example to illustrate BASiCS:

Data <- makeExampleBASiCS_Data()
Chain <- BASiCS_MCMC(Data = Data, N = 20000, Thin = 20, Burn = 10000, 
                     PrintProgress = FALSE)

As with any MCMC sampler, it is important to assess the convergence of the generated chain before running downstream analyses. For this purpose, the convergence diagnostics provided by the package coda R package can be used. Additionally, the chains can be visually inspected using

plot(Chain, Param = "mu", Gene = 1, log = "y")
plot(Chain, Param = "phi", Cell = 1)

In the figures above:

  • Left panels show traceplots for the chains. This shows the parameters values sampled throughout the algorithm, across iterations (after burn-in and thinning).

  • Right panels show the autocorrelation function (in R, see help(acf))

See here for more details about the interpretation of these plots.

Clone this wiki locally