traceplot {SANple} | R Documentation |
Traceplot: plot MCMC chains
Description
Check the convergence of the MCMC through visual inspection of the chains.
Usage
traceplot(object, params,
show_density = TRUE,
show_burnin = TRUE,
length_burnin = NULL,
show_convergence = TRUE,
trunc_plot = 10)
Arguments
object |
object of class |
params |
vector of strings with the names of the parameters to check. |
show_density |
logical (default |
show_burnin |
logical (default |
length_burnin |
if |
show_convergence |
logical (default |
trunc_plot |
integer (default = 10). For multidimensional parameters, the maximum number of components to be plotted. |
Value
The function displays the traceplots of the MCMC algorithm.
Note
The function is not available for the observational weights \omega
.
Examples
set.seed(123)
y <- c(rnorm(40,0,0.3), rnorm(20,5,0.3))
g <- c(rep(1,30), rep(2, 30))
out <- sample_fiSAN(nrep = 500, burn = 200,
y = y, group = g,
nclus_start = 2,
maxK = 20, maxL = 20,
beta = 1)
traceplot(out, params = c("mu", "sigma2"), trunc_plot = 2)