% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ppc.R
\name{bdeb_prior_predictive}
\alias{bdeb_prior_predictive}
\title{Prior Predictive Check}
\usage{
bdeb_prior_predictive(model, n_draws = 500, dt = 0.5, seed = NULL)
}
\arguments{
\item{model}{A \code{\link[=bdeb_model]{bdeb_model()}} object.}

\item{n_draws}{Number of prior draws. Default 500.}

\item{dt}{Euler step size (days). Default 0.5.}

\item{seed}{Integer seed for reproducibility. Default \code{NULL}.}
}
\value{
A list with class \code{"bdeb_prior_predictive"} containing:
\describe{
\item{\code{t}}{Time vector.}
\item{\code{L}}{Matrix of simulated trajectories (draws x time points).}
\item{\code{L_inf}}{Vector of prior-predictive ultimate lengths.}
\item{\code{priors}}{Named list of prior objects used.}
}
}
\description{
Simulates growth trajectories by sampling parameters from the prior
distributions and forward-integrating the DEB ODE in R (Euler method).
This is the prior analogue of \code{\link[=bdeb_ppc]{bdeb_ppc()}} and answers: "what range
of data does the model predict \emph{before seeing any data}?"  Following
Gabry et al. (2019), if the prior predictive distribution covers
biologically implausible values, the priors should be tightened.
}
\details{
Does \strong{not} require CmdStan — all sampling and simulation is done
in R using Euler integration (step size \code{dt}).  This is an
\strong{approximate visualisation tool}, not exact Stan inference.  The
ODE trajectories may differ slightly from the BDF solver used during
fitting.
}
\examples{
dat <- bdeb_data(growth = data.frame(id = 1, time = 0:10,
  length = seq(0.1, 0.5, length.out = 11)))
mod <- bdeb_model(dat, type = "individual")
pp <- bdeb_prior_predictive(mod, n_draws = 100, seed = 1)
plot(pp, n_draws = 30)
}
\references{
Gabry, J., Simpson, D., Vehtari, A., Betancourt, M. and Gelman, A.
(2019). Visualization in Bayesian workflow. \emph{Journal of the Royal
Statistical Society: Series A}, 182(2), 389--402.
\doi{10.1111/rssa.12378}
}
