% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict.R
\name{predict.ngme}
\alias{predict.ngme}
\title{Predict function of ngme2
predict using ngme after estimation}
\usage{
\method{predict}{ngme}(
  object,
  map,
  data = NULL,
  type = "lp",
  group = NULL,
  estimator = c("mean", "sd", "0.05q", "0.95q", "median", "mode"),
  sampling_size = 500,
  burnin_size = 100,
  seed = Sys.time(),
  train_idx = NULL,
  chain_combine = c("param_mean", "predictive_average"),
  return_samples = FALSE,
  ...
)
}
\arguments{
\item{object}{a ngme object}

\item{map}{a named list (or dataframe) of the locations to make the prediction}

\item{data}{a data.frame or matrix of covariates (used for fixed effects)
names(loc) corresponding to the name each latent model
vector or matrix (n * 2) for spatial coords}

\item{type}{what type of prediction, c("fe", "lp", <model_name>)
"fe" is fixed effect prediction
<model_name> is prediction of a specific model
"lp" is linear predictor (including fixed effect and all sub-models)
"response" is the linear predictor plus a fresh measurement-noise draw}

\item{group}{which filed to predict
(used for bivariate model, should be of same length as map)}

\item{estimator}{what type of estimator. Options include:
- "mean", "median", "mode", "sd": standard estimators
- "0.XXXq": any quantile specified as probability (e.g., "0.025q", "0.5q", "0.975q")}

\item{sampling_size}{size of posterior sampling}

\item{burnin_size}{size of posterior burnin}

\item{seed}{random seed}

\item{train_idx}{optional vector of training indices to use for posterior sampling.
If provided, only these indices from the original data will be used for training,
similar to cross-validation. If NULL, uses all original training data.}

\item{chain_combine}{how to combine multiple optimization chains:
\itemize{
  \item \code{"param_mean"}: default behavior using the fitted object parameters.
  \item \code{"predictive_average"}: run prediction for each optimization chain and
    average predictions across chains.
}}

\item{return_samples}{logical; when `TRUE`, attach sample draws for the
requested output in `attr(ret, "samples")`. For `type = "response"`, the
attached samples are response predictive draws.}

\item{...}{additional arguments (currently unused)}
}
\value{
a list of outputs contains estimation of operator paramters, noise parameters
}
\description{
Predict function of ngme2
predict using ngme after estimation
}
