% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit.R
\name{fitted.bdeb_fit}
\alias{fitted.bdeb_fit}
\title{Fitted Values from a BDEB Fit}
\usage{
\method{fitted}{bdeb_fit}(object, type = c("median", "mean"), ...)
}
\arguments{
\item{object}{A \code{\link[=bdeb_fit]{bdeb_fit()}} object.}

\item{type}{One of \code{"median"} (default) or \code{"mean"}.}

\item{...}{Ignored.}
}
\value{
Named numeric vector of fitted values, one per observation.
}
\description{
Posterior point estimate (median or mean) of the latent length
\eqn{\hat{L}_i} at each observation.  Bayesian counterpart of
\code{\link[stats:fitted.values]{stats::fitted()}}.
}
\details{
Currently supported for \code{"individual"} and \code{"growth_repro"} models.
For \code{"hierarchical"} and \code{"debtox"} use \code{\link[=bdeb_predict]{bdeb_predict()}} instead.
}
\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)
  fitted(fit)
}
}
}
