% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{as.mcmc.list.ShrinkageTrees}
\alias{as.mcmc.list.ShrinkageTrees}
\title{Convert MCMC output to a coda mcmc.list}
\usage{
\method{as.mcmc.list}{ShrinkageTrees}(x, ...)
}
\arguments{
\item{x}{A fitted \code{ShrinkageTrees} object.}

\item{...}{Currently unused.}
}
\value{
A \code{\link[coda]{mcmc.list}} object.
Each chain is an \code{\link[coda]{mcmc}} object whose columns include:
\describe{
\item{sigma}{Posterior draws of the residual standard deviation
(continuous and survival outcomes only).}
}
}
\description{
Converts the posterior draws stored in a \code{ShrinkageTrees} object into
a \code{\link[coda]{mcmc.list}} for use with the \pkg{coda} package's
convergence diagnostics (Gelman--Rubin \eqn{\hat{R}}, effective sample
size, Geweke test, etc.).
}
\details{
Requires the suggested package \pkg{coda}.
For single-chain fits the returned object contains one chain.
}
\examples{
\donttest{
fit <- HorseTrees(y = rnorm(50), X_train = matrix(rnorm(250), 50, 5),
                  N_post = 200, N_burn = 100, n_chains = 2)
if (requireNamespace("coda", quietly = TRUE)) {
  mcmc_obj <- coda::as.mcmc.list(fit)
  coda::gelman.diag(mcmc_obj)
  coda::effectiveSize(mcmc_obj)
}
}
}
\seealso{
\code{\link{summary.ShrinkageTrees}} which reports R-hat and ESS
automatically when coda is available.
}
