% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{predict.CausalShrinkageForest}
\alias{predict.CausalShrinkageForest}
\title{Posterior predictive inference for a CausalShrinkageForest model}
\usage{
\method{predict}{CausalShrinkageForest}(
  object,
  newdata_control,
  newdata_treat,
  level = 0.95,
  bayesian_bootstrap = TRUE,
  ...
)
}
\arguments{
\item{object}{A fitted \code{CausalShrinkageForest} model object.}

\item{newdata_control}{A matrix of new covariates for the control forest,
with the same number of columns as \code{X_train_control} at fit time.}

\item{newdata_treat}{A matrix of new covariates for the treatment forest,
with the same number of columns as \code{X_train_treat} at fit time.
Must have the same number of rows as \code{newdata_control}.}

\item{level}{Credible interval width. Default \code{0.95}.}

\item{bayesian_bootstrap}{Logical; if \code{TRUE} (default), the ATE over
\code{newdata} is computed by reweighting each iteration's CATE vector
with Dirichlet(1, ..., 1) weights (population ATE, PATE). If \code{FALSE},
equal \eqn{1/n} weights are used (mixed ATE, MATE).}

\item{...}{Currently unused.}
}
\value{
A \code{CausalShrinkageForestPrediction} object with elements:
\describe{
\item{prognostic}{List with \code{mean}, \code{lower}, \code{upper}:
posterior summaries of the prognostic function
\eqn{\mu(X_{\text{new}})}.}
\item{cate}{List with \code{mean}, \code{lower}, \code{upper}:
posterior summaries of the CATE \eqn{\tau(X_{\text{new}})}.}
\item{total}{List with \code{mean}, \code{lower}, \code{upper}:
posterior summaries of the total outcome
\eqn{\mu(X_{\text{new}}) + \tau(X_{\text{new}})}.}
\item{ate}{List with \code{mean}, \code{lower}, \code{upper}: posterior
summary of the average treatment effect over \code{newdata}. For
survival with \code{timescale = "time"}, reported as a multiplicative
time ratio on the original scale.}
\item{cate_samples}{\eqn{S \times n_{\text{new}}} matrix of posterior
CATE draws on the scale reported in \code{cate}.}
\item{bayesian_bootstrap}{Flag indicating whether the reported ATE CI
used Dirichlet reweighting.}
\item{n}{Number of test observations.}
\item{level}{Credible level used.}
\item{outcome_type}{Outcome type inherited from the fitted model.}
\item{timescale}{Timescale inherited from the fitted model.}
}
}
\description{
Re-runs the MCMC sampler on new covariate data using the stored training
data and hyperparameters, returning posterior mean predictions and credible
interval bounds for three quantities: the \strong{prognostic function}
(control-forest prediction \eqn{\mu(X)}), the \strong{Conditional Average
Treatment Effect} (CATE, \eqn{\tau(X)}), and the \strong{total predicted
outcome} (\eqn{\mu(X) + \tau(X)}).
}
\details{
The causal forest decomposes the expected outcome as
\deqn{E[Y \mid X] = \mu(X) + \tau(X) \cdot W,}
where \eqn{\mu(X)} is the prognostic function (control forest),
\eqn{\tau(X)} is the CATE (treatment forest), and \eqn{W} is the
treatment indicator.

For \strong{continuous} outcomes and survival with
\code{timescale = "log"}, all three components are on the response scale:
\code{prognostic} and \code{total} include the intercept shift
(\eqn{+ \bar{y}}), while \code{cate} is the pure additive treatment
effect with no intercept.

For \strong{survival with \code{timescale = "time"}}, predictions are
back-transformed to the original time scale:
\itemize{
\item \code{prognostic}: posterior expected baseline survival time
\eqn{E[\exp(\mu(X))]}.
\item \code{cate}: multiplicative effect on survival time
\eqn{\exp(\tau(X))}; a value greater than 1 means treatment prolongs
survival.
\item \code{total}: posterior expected survival time under the observed
treatment \eqn{E[\exp(\mu(X) + \tau(X))]}.
}
}
\seealso{
\code{\link{CausalHorseForest}}, \code{\link{CausalShrinkageForest}},
\code{\link{print.CausalShrinkageForestPrediction}},
\code{\link{summary.CausalShrinkageForestPrediction}}
}
