plot_runmean: Checking convergence: running means plot

Description Usage Arguments Author(s) See Also Examples

View source: R/mcmc_plots.R

Description

This function produces a running mean plot, that is, a plot of the iterations against the mean of the draws up to each iteration. If the plot is not a near constant line then convergence has not been achieved (e.g., label switching is present).

For examples see

http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#plot_runmean

Usage

1
plot_runmean(chain, open_new_window = FALSE)

Arguments

chain

An Lx1 vector containing the L posterior realizations.

open_new_window

Open a new window for the plot.

Author(s)

Sakis Micheas

See Also

est_mix_damcmc, rmixsurf, rsppmix

Examples

1
2
3
4
5
6
7
truemix_surf <- rmixsurf(m = 3, lambda=100, xlim = c(-3,3), ylim = c(-3,3))
plot(truemix_surf)
genPPP=rsppmix(intsurf = truemix_surf, truncate = FALSE)
fit <- est_mix_damcmc(pp = genPPP, m = 3)
plot_runmean(fit$genps[,1])
plot_runmean(fit$genps[,2])
plot_runmean(fit$genps[,3])

sppmix documentation built on Jan. 13, 2021, 10:04 p.m.