plot.mcmc: Animate the MCMC draws

View source: R/plot_mcmc.R

plot.mcmcR Documentation

Animate the MCMC draws

Description

plot.mcmc() takes your BART model and your landscape, and shows each individual sum-of-trees model's predictions on the landscape, next to the accumulating posterior mean. If you start with a low number of trees (n = 5 to 20) and drop the BART burn-in (include the first few samples), you can watch the model learn in realtime, which is often very interesting. This can be a little slow, and you might want to adjust some of the settings for that reason.

Usage

plot.mcmc(object, inputstack, iter = 100, wait = 0.1, quiet = FALSE)

Arguments

object

A BART model object generated by the dbarts package

inputstack

An object of class RasterStack

iter

How many of the first 1:n draws do you want to visualize?

wait

Adds a Sys.sleep after the plots; because the plots are two-panel they can be a little delayed sometimes, which isn't super visually smooth. However, if you want something that's particularly crisp, I'd suggest using the animation package (see below example).

quiet

Turns off progress bars if TRUE


cjcarlson/embarcadero documentation built on Sept. 9, 2023, 10:47 p.m.