Learn R Programming

fcirt (version 0.2.1)

bayesplot: bayesian convergence diagnosis plotting function

Description

This function provides plots including density plots, trace plots, and auto-correlation plots to aid model convergence diagnosis.

Usage

bayesplot(x, pars, plot, inc_warmup = FALSE)

Value

Selected plots for selected parameters

Arguments

x

returned object

pars

Names of plotted parameters. They can be "theta", "alpha", "delta", "tau", or a subset of parameters. See vignette for fcirt for more details.

plot

Types of plots.They can be "density", "trace", or "autocorrelation".

inc_warmup

Whether to include warmup iterations or not when plotting. The default is FALSE.

Examples

Run this code
# \donttest{
# long running time
Data <- c(1,2,2,1,1,1,1,1,NA,1,2,1,1,2,1,1,2,2,NA,2,2,2,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,2,1,1)
Data <- matrix(Data,nrow = 10)
pairmap <- c(1,3,5,7,2,4,6,8)
pairmap <- matrix(pairmap,ncol = 2)
ind <- c(1,2,1,2,1,2,2,1)
ParInits <- c(1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1)
ParInits <- matrix(ParInits, ncol = 3)
mod <- fcirt(fcirt.Data=Data,pairmap=pairmap,ind=ind,
ParInits=ParInits,iter=1000,warmup=500,chains=2)
bayesplot(mod, 'alpha', 'density', inc_warmup=FALSE)# }

Run the code above in your browser using DataLab