% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{predict.xreg2}
\alias{predict.xreg2}
\title{Predict from an xreg2 Model}
\usage{
\method{predict}{xreg2}(object, newdata = NULL, return_vector = FALSE, ...)
}
\arguments{
\item{object}{A fitted \code{xreg2} object.}

\item{newdata}{A named list of data frames (one per model component), or a
single data frame (automatically wrapped and named after the first
component).}

\item{return_vector}{Logical; if \code{TRUE} and there is a single
component, return a numeric vector of \code{Xb} values instead of a
list. Default \code{FALSE}.}

\item{...}{Currently unused.}
}
\value{
A named list of data frames (one per component), each augmented
  with computed variables including \code{Xb}.
}
\description{
Generates predictions (linear predictors and intermediate
  computed variables) from a fitted \code{xreg2} model applied to new data.
}
\details{
Predict method for xreg2 objects
}
\examples{
\donttest{
set.seed(1)
df   <- data.frame(y = rnorm(200, 2, 0.5), x = rnorm(200))
ctrl <- xreg2_control(
  formulas     = list(y ~ INTERCEPT + x * SLOPE),
  start_values = c(INTERCEPT = 0, SLOPE = 0),
  name         = "main"
)
fit  <- xreg2_fit(controlList = c(ctrl), dataList = list(main = df))
newdf <- data.frame(x = 1:5)
preds <- predict(fit, newdata = list(main = newdf))
}

}
