Predict function of ngme2 predict using ngme after estimation

# S3 method for class 'ngme'
predict(
  object,
  map,
  data = NULL,
  type = "lp",
  group = NULL,
  estimator = c("mean", "sd", "0.05q", "0.95q", "median", "mode"),
  sampling_size = 100,
  burnin_size = 100,
  seed = Sys.time(),
  train_idx = NULL,
  ...
)

Arguments

object

a ngme object

map

a named list (or dataframe) of the locations to make the prediction

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

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)

group

which filed to predict (used for bivariate model, should be of same length as map)

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")

sampling_size

size of posterior sampling

burnin_size

size of posterior burnin

seed

random seed

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.

...

additional arguments (currently unused)

Value

a list of outputs contains estimation of operator paramters, noise parameters