% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot.bdeb_fit}
\alias{plot.bdeb_fit}
\title{Plot a BDEB Fit}
\usage{
\method{plot}{bdeb_fit}(
  x,
  type = c("trace", "posterior", "pairs", "trajectory", "prior_posterior"),
  pars = NULL,
  n_draws = 100,
  seed = NULL,
  ...
)
}
\arguments{
\item{x}{A \code{\link[=bdeb_fit]{bdeb_fit()}} object.}

\item{type}{Type of plot. One of:
\itemize{
\item \code{"trace"}: MCMC trace plots
\item \code{"posterior"}: marginal posterior densities
\item \code{"pairs"}: bivariate posterior scatter plots
\item \code{"trajectory"}: predicted trajectories with data overlay
\item \code{"prior_posterior"}: prior (red) vs posterior (blue) densities
}}

\item{pars}{Character vector of parameters to plot. Default: core DEB
parameters.}

\item{n_draws}{Number of posterior draws for trajectory plots. Default 100.}

\item{seed}{Integer seed for reproducible draw selection in trajectory
plots.  Default \code{NULL} (no seed).}

\item{...}{Additional arguments passed to bayesplot functions.}
}
\value{
A ggplot2 object.
}
\description{
Plot a BDEB Fit
}
\examples{
\donttest{
if (requireNamespace("cmdstanr", quietly = TRUE) &&
    nzchar(tryCatch(cmdstanr::cmdstan_path(), error = function(e) ""))) {
  data(eisenia_growth)
  dat <- bdeb_data(growth = eisenia_growth[eisenia_growth$id == 1, ])
  fit <- bdeb_fit(bdeb_model(dat, type = "individual"),
                  chains = 2, iter_warmup = 200, iter_sampling = 200,
                  refresh = 0)
  plot(fit, type = "trace")
  plot(fit, type = "trajectory", n_draws = 50)
}
}
}
