Skip to content

Commit ee34125

Browse files
author
Florence Bockting
committed
docs,refactor: update function documentation and outsource common arguments into single docs file
1 parent 8c2a6bd commit ee34125

5 files changed

Lines changed: 186 additions & 142 deletions

File tree

R/mcmc-traces.R

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#' @template args-regex_pars
1111
#' @template args-transformations
1212
#' @template args-facet_args
13-
#' @template args-pit-ecdf
1413
#' @param ... Currently ignored.
1514
#' @param size An optional value to override the default line size
1615
#' for `mcmc_trace()` or the default point size for `mcmc_trace_highlight()`.
@@ -458,12 +457,27 @@ mcmc_rank_hist <- function(x,
458457
}
459458

460459
#' @rdname MCMC-traces
460+
#' @param K An optional integer defining the number of equally spaced evaluation
461+
#' points for the PIT-ECDF. Reducing K when using `interpolate_adj = FALSE`
462+
#' makes computing the confidence bands faster. For `ppc_pit_ecdf()` and
463+
#' `ppc_pit_ecdf_grouped()` when `method = 'independent'`. If `pit` is
464+
#' supplied, defaults to `length(pit)`, otherwise `yrep` determines the
465+
#' maximum accuracy of the estimated PIT values and `K` is set to
466+
#' `min(nrow(yrep) + 1, 1000)`. For `mcmc_rank_ecdf()`, defaults to the number
467+
#' of iterations per chain in `x`.
461468
#' @param prob For `mcmc_rank_ecdf()`, a value between 0 and 1
462-
#' specifying the desired simultaneous confidence of the confidence bands to be
463-
#' drawn for the rank ECDF plots.
469+
#' specifying the desired simultaneous confidence of the confidence bands to be
470+
#' drawn for the rank ECDF plots.
464471
#' @param plot_diff For `mcmc_rank_ecdf()`, a boolean specifying if the
465-
#' difference between the observed rank ECDFs and the theoretical expectation
466-
#' should be drawn instead of the unmodified rank ECDF plots.
472+
#' difference between the observed rank ECDFs and the theoretical expectation
473+
#' should be drawn instead of the unmodified rank ECDF plots.
474+
#' @param interpolate_adj A boolean defining if the simultaneous confidence
475+
#' bands should be interpolated based on precomputed values rather than
476+
#' computed exactly. Computing the bands may be computationally intensive and
477+
#' the approximation gives a fast method for assessing the ECDF trajectory.
478+
#' For `ppc_pit_ecdf()` and `ppc_pit_ecdf_grouped()` when
479+
#' `method = 'independent'` and for `mcmc_rank_ecdf()`. The default is to use
480+
#' interpolation if `K` is greater than 200.
467481
#' @export
468482
mcmc_rank_ecdf <-
469483
function(x,

man-roxygen/args-pit-ecdf.R

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1-
#' @param K An optional integer defining the number of equally spaced evaluation
2-
#' points for the PIT-ECDF. Reducing K when using `interpolate_adj = FALSE`
3-
#' makes computing the confidence bands faster. For `ppc_pit_ecdf` and
4-
#' `ppc_pit_ecdf_grouped`, if PIT values are supplied, defaults to
5-
#' `length(pit)`, otherwise yrep determines the maximum accuracy of the
6-
#' estimated PIT values and `K` is set to `min(nrow(yrep) + 1, 1000)`. For
7-
#' `mcmc_rank_ecdf`, defaults to the number of iterations per chain in `x`.
8-
#' @param prob The desired simultaneous coverage level of the bands around the
9-
#' ECDF. A value in (0,1).
10-
#' @param plot_diff A boolean defining whether to plot the difference between
11-
#' the observed PIT- ECDF and the theoretical expectation for uniform PIT
12-
#' values rather than plotting the regular ECDF. The default is `FALSE`, but
13-
#' for large samples we recommend setting `plot_diff=TRUE` as the difference
14-
#' plot will visually show a more dynamic range.
15-
#' @param interpolate_adj A boolean defining if the simultaneous confidence
16-
#' bands should be interpolated based on precomputed values rather than
17-
#' computed exactly. Computing the bands may be computationally intensive and
18-
#' the approximation gives a fast method for assessing the ECDF trajectory.
19-
#' The default is to use interpolation if `K` is greater than 200.
1+
#' @param method The method used to calculate the uniformity test:
2+
#' * `"independent"`: assumes independent PIT values (Säilynoja et al., 2022).
3+
#' * `"correlated"`: accounts for correlated PIT values (Tesso & Vehtari, 2026).
4+
#' @param test When `method = "correlated"`, which dependence-aware test to use:
5+
#' `"POT"`, `"PRIT"`, or `"PIET"`. Defaults to `"POT"`.
6+
#' @param gamma When `method = "correlated"`, tolerance threshold controlling
7+
#' how strongly suspicious points are flagged. Larger values (`gamma > 0`)
8+
#' emphasize points with larger deviations. If `NULL`, defaults to `0` and
9+
#' thus all suspicious points are flagged.
10+
#' @param linewidth When `method = "correlated"`, the line width of the ECDF.
11+
#' Defaults to `0.3`.
12+
#' @param color When `method = "correlated"`, a vector with base color and
13+
#' highlight color for the ECDF plot. Defaults to
14+
#' `c(ecdf = "grey60", highlight = "red")`. The first element is used for
15+
#' the main ECDF line, the second for highlighted suspicious regions.
16+
#' @param help_text When `method = "correlated"`, a boolean defining whether
17+
#' to add information about p-value to the plot. Defaults to `TRUE`.
18+
#' @param help_text_shrinkage When `method = "correlated"`, a numeric value
19+
#' between 0 and 1 defining the factor by which the help-text (p-value
20+
#' information) is scaled. The default is `0.8`.
21+
#' @param pareto_pit A boolean defining whether to compute PIT values using
22+
#' Pareto-PIT method. Defaults to `TRUE` if `test` is either `"POT"` or
23+
#' `"PIET"` and no `pit` values are provided otherwise `FALSE`. This argument
24+
#' should normally not be modified by the user, except for development
25+
#' purposes. If `pit` is non-`NULL`, `pareto_pit` cannot be simultaneously
26+
#' `TRUE`.

man/MCMC-traces.Rd

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/PPC-distributions.Rd

Lines changed: 66 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)