plot_hamstr: Plot an hamstr_fit object

View source: R/plot_stan_hamstr.R

plot_hamstrR Documentation

Plot an hamstr_fit object

Description

Plots the HAMStR modelled age ~ depth relationship together with the depths, ages, and age uncertainties in the observed data. A random sample of size n.iter of the iterations of the posterior distribution are plotted as grey lines. The observed data are plotted as points with +- 2*se error bars.

Usage

plot_hamstr(
  hamstr_fit,
  summarise = TRUE,
  n.iter = 1000,
  plot_diagnostics = TRUE
)

Arguments

hamstr_fit

the object returned from stan_hamstr.

summarise

logical TRUE or FALSE. Plot the realisations as a summarised "ribbon" showing 50% and 95% intervals (faster), or as a spaghetti plot showing individual realisations. Defaults to TRUE (ribbon).

n.iter

the number of iterations of the model to plot, defaults to 1000.

plot_diagnostics

logical, include diagnostic plots: traceplot of log-posterior, hierarchical accumulations rates, memory parameter. Defaults to TRUE.

Value

A ggplot2 object

Examples

## Not run: 
fit <- hamstr(
  depth = MSB2K$depth,
  obs_age = MSB2K$age,
  obs_err = MSB2K$error)

# With age models summarised as a ribbon. Faster than spaghetti plots.
plot_hamstr(fit)

# With age models as spaghetti plots. Can see individual realisations, but slower to plot.
plot_hamstr(fit, summarise = FALSE)

## End(Not run)

EarthSystemDiagnostics/baconr documentation built on Dec. 10, 2023, 4:35 a.m.