|
1 |
| -#' Traceplot (time series plot) of MCMC draws |
| 1 | +#' Trace plot (time series plot) of MCMC draws |
2 | 2 | #'
|
3 |
| -#' Traceplot of MCMC draws. See the \strong{Plot Descriptions} section, below, |
4 |
| -#' for details. |
| 3 | +#' Trace plot (or traceplot) of MCMC draws. See the \strong{Plot Descriptions} |
| 4 | +#' section, below, for details. |
5 | 5 | #'
|
6 | 6 | #' @name MCMC-traces
|
7 | 7 | #' @family MCMC
|
|
29 | 29 | #' integrator}), an optional data frame providing NUTS diagnostic
|
30 | 30 | #' information. The data frame should be the object returned by
|
31 | 31 | #' \code{\link{nuts_params}} or one with the same structure. If \code{np} is
|
32 |
| -#' specified then tick marks are added to the bottom of the traceplot |
| 32 | +#' specified then tick marks are added to the bottom of the trace plot |
33 | 33 | #' indicating within which iterations there was a divergence (if there were any).
|
34 | 34 | #' See the end of the \strong{Examples} section, below.
|
35 | 35 | #' @param np_style A call to the \code{trace_style_np} helper function to
|
|
42 | 42 | #' @section Plot Descriptions:
|
43 | 43 | #' \describe{
|
44 | 44 | #' \item{\code{mcmc_trace}}{
|
45 |
| -#' Standard traceplots of MCMC draws. For models fit using \code{\link{NUTS}}, |
46 |
| -#' the \code{np} argument can be used to also show divergences on the traceplot. |
| 45 | +#' Standard trace plots of MCMC draws. For models fit using \code{\link{NUTS}}, |
| 46 | +#' the \code{np} argument can be used to also show divergences on the trace plot. |
47 | 47 | #' }
|
48 | 48 | #' \item{\code{mcmc_trace_highlight}}{
|
49 | 49 | #' Traces are plotted using points rather than lines and the opacity of all
|
|
57 | 57 | #' dim(x)
|
58 | 58 | #' dimnames(x)
|
59 | 59 | #'
|
60 |
| -#' # traceplots of the betas |
| 60 | +#' # trace plots of the betas |
61 | 61 | #' color_scheme_set("viridis")
|
62 | 62 | #' mcmc_trace(x, regex_pars = "beta")
|
63 | 63 | #' \donttest{
|
|
100 | 100 | #' color_scheme_set("brightblue")
|
101 | 101 | #' mcmc_trace_highlight(x, pars = "sigma", highlight = 2, size = 2)
|
102 | 102 | #'
|
103 |
| -#' # for models fit using HMC/NUTS divergences can be displayed in the traceplot |
| 103 | +#' # for models fit using HMC/NUTS divergences can be displayed in the trace plot |
104 | 104 | #' library("rstanarm")
|
105 | 105 | #' fit <- stan_glm(mpg ~ ., data = mtcars,
|
106 | 106 | #' # next line to keep example fast and also ensure we get some divergences
|
107 | 107 | #' prior = hs(), iter = 400, adapt_delta = 0.8)
|
108 | 108 | #'
|
109 | 109 | #' # extract draws using as.array (instead of as.matrix) to keep
|
110 |
| -#' # chains separate for traceplot |
| 110 | +#' # chains separate for trace plot |
111 | 111 | #' posterior <- as.array(fit)
|
112 | 112 | #'
|
113 | 113 | #' # for stanfit and stanreg objects use nuts_params() to get the divergences
|
@@ -375,7 +375,7 @@ chain_colors <- function(n) {
|
375 | 375 | }
|
376 | 376 |
|
377 | 377 |
|
378 |
| -# Add divergences to traceplot using geom_rug |
| 378 | +# Add divergences to trace plot using geom_rug |
379 | 379 | #
|
380 | 380 | # @param np User's 'np' argument, if specified.
|
381 | 381 | # @param np_style User's 'np_style' argument, if specified.
|
|
0 commit comments