% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{fitted.mixgpd_fit}
\alias{fitted.mixgpd_fit}
\title{Fitted values on the training design}
\usage{
\method{fitted}{mixgpd_fit}(
  object,
  type = c("mean", "median", "quantile"),
  p = 0.5,
  level = 0.95,
  interval = "credible",
  seed = 1,
  ...
)
}
\arguments{
\item{object}{A fitted object of class \code{"mixgpd_fit"} (must have covariates).}

\item{type}{Which fitted functional to return:
\itemize{
\item \code{"mean"}: posterior predictive mean
\item \code{"median"}: posterior predictive median
\item \code{"quantile"}: posterior predictive quantile
at level \code{p}
}}

\item{p}{Quantile level used when \code{type = "quantile"}.}

\item{level}{Credible level for confidence intervals (default 0.95 for 95 percent credible intervals).}

\item{interval}{Character or NULL; type of credible interval:
\itemize{
\item \code{NULL}: no interval
\item \code{"credible"} (default): equal-tailed quantile
intervals
\item \code{"hpd"}: highest posterior density intervals
}}

\item{seed}{Random seed used for deterministic fitted values.}

\item{...}{Unused.}
}
\value{
A data frame with columns for fitted values, optional intervals, and
residuals computed on the training sample.
}
\description{
\code{fitted.mixgpd_fit()} is a thin training-data wrapper around
\code{\link{predict.mixgpd_fit}} for conditional models.
}
\details{
The method returns posterior predictive fitted values on the observed design
matrix. It is available only when the fitted model stored covariates.
}
\examples{
\donttest{
# Conditional model (with covariates X)
y <- abs(stats::rnorm(25)) + 0.1
X <- data.frame(x1 = stats::rnorm(25), x2 = stats::runif(25))
bundle <- build_nimble_bundle(y = y, X = X, backend = "sb", kernel = "normal",
                             GPD = TRUE, components = 3,
                             mcmc = list(niter = 100, nburnin = 50, thin = 1, nchains = 1))
fit <- run_mcmc_bundle_manual(bundle)
fitted(fit)
fitted(fit, level = 0.90)
fitted(fit, interval = "hpd")  # HPD intervals
fitted(fit, interval = NULL)   # No intervals
}
}
\seealso{
\code{\link{predict.mixgpd_fit}}, \code{\link{residuals.mixgpd_fit}},
\code{\link{plot.mixgpd_fitted}}.
}
