traceplots_mplus | R Documentation |
The function exports all the available plots for each parameter and every chain. Therefore it can take a long time and the resulting pdf file can be large. Each page in pdf is for a specific parameter.
traceplots_mplus(
x,
is.file = F,
pdffile = NULL,
gg = T,
param.id = NULL,
raster = F,
niter = NULL,
chains = NULL,
PSR = TRUE,
PSR.version = "Rstan",
ESS = T
)
x |
Either a model read by |
is.file |
Logical, if x argument is file name. Default is FALSE, (i.e. it's an R object, a model read by |
pdffile |
File name of the pdf report to export all the plots. Defaults to an of x argument with a '.pdf' extension when is.file == TRUE, and extracts the original filename of the out file if x is a readModels object. |
gg |
Logical. Whether ggplot or base R graphics should be used. Default is ggplot which is slower but more flexible, e.g. with many chains. |
param.id |
Single interger or a vector. Single intterger shows 1:param.id parameters to plot, a vector shows parameters by their order id. If NULL (default), all the parameters are used. |
raster |
Logical. Currently not used. It was an option to convert vector plots to raster plots to save space and produce smaller pdfs. Currently not used. |
niter |
How many iterations should be shown on a traceplot. NULL (default) refers to all iterations. However, traceplots for long chains may result in highly overplotted graphics which are slow and take a lot of space on disk. A specified number will take a random sample of values from the iterations. |
PSR |
If PSR (R-hat) should be printed for each parameter. See |
PSR.version |
Version of PSR; default is "Rstan" - the most up-to-date, provided by the Rstan::Rhat function (Vehtari et al., 2019). Other possible values: "Gelman" (Gelman et al. (2004)); or "Mplus" (Asparouhov and Muthen, 2010), and "Naive" which is a raw ratio of sum of a between- and within-chain variances to a within-chain variance. |
ESS |
Logical. If effective sample size should be printed on the plots. See |
## Not run:
m <- MplusAutomation::readModels("mybayes.out")
convergencePlotsMplus(m, niter = 5000, PSR.version = "Mplus")
# or directly from gh5 file:
convergencePlotsMplus("mybayes.gh5", param.id = 1, PSR.version = "Rstan", gg=F)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.