View source: R/plotMCMCtrrace.R
| plotMCMCtrace | R Documentation |
Show trace plot of the log-likelihood or estimates, of a "SPQR" class object fitted using the MCMC method
plotMCMCtrace(
object,
target = c("loglik", "PDF", "CDF", "QF"),
X = NULL,
Y = NULL,
tau = 0.5,
window = NULL
)
object |
An object of class |
target |
A character indicating the statistic/estimate for which traceplot should be plotted;
|
X |
If |
Y |
If |
tau |
If |
window |
A vector specifying the range of index of the MCMC samples for which the traceplot should be plotted. Default is |
A ggplot object.
set.seed(919)
n <- 200
X <- rbinom(n, 1, 0.5)
Y <- rnorm(n, X, 0.8)
control <- list(iter = 200, warmup = 150, thin = 1)
fit <- SPQR(X = X, Y = Y, method = "MCMC", control = control,
normalize = TRUE, verbose = FALSE)
## trace plot for log-likelihood
plotMCMCtrace(fit, target = "loglik")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.