plot_integration_error: Plot numerical integration error

View source: R/stan_nma-class.R

plot_integration_errorR Documentation

Plot numerical integration error

Description

For ML-NMR models, plot the estimated numerical integration error over the entire posterior distribution, as the number of integration points increases. See \insertCitemethods_paper,Phillippo_thesismultinma for details.

Usage

plot_integration_error(
  x,
  ...,
  stat = "violin",
  orientation = c("vertical", "horizontal", "x", "y"),
  show_expected_rate = TRUE
)

Arguments

x

An object of type stan_mlnmr

...

Additional arguments passed to the ggdist plot stat.

stat

Character string specifying the ggdist plot stat used to summarise the integration error over the posterior. Default is "violin", which is equivalent to "eye" with some cosmetic tweaks.

orientation

Whether the ggdist geom is drawn horizontally ("horizontal") or vertically ("vertical"), default "vertical"

show_expected_rate

Logical, show typical convergence rate 1/N? Default TRUE.

Details

The total number of integration points is set by the n_int argument to add_integration(), and the intervals at which integration error is estimated are set by the int_thin argument to nma(). The typical convergence rate of Quasi-Monte Carlo integration (as used here) is 1/N, which by default is displayed on the plot output.

The integration error at each thinning interval N_\mathrm{thin} is estimated for each point in the posterior distribution by subtracting the final estimate (using all n_int points) from the estimate using only the first N_\mathrm{thin} points.

Value

A ggplot object.

Examples

## Plaque psoriasis ML-NMR

# Run plaque psoriasis ML-NMR example if not already available
if (!exists("pso_fit")) example("example_pso_mlnmr", run.donttest = TRUE)


# Plot numerical integration error
plot_integration_error(pso_fit)


multinma documentation built on May 31, 2023, 5:46 p.m.