Learn R Programming

FBMS (version 1.3)

predict.gmjmcmc_parallel: Predict Using a GMJMCMC Result Object from a Parallel Run

Description

Predict Using a GMJMCMC Result Object from a Parallel Run

Usage

# S3 method for gmjmcmc_parallel
predict(
  object,
  x,
  link = function(x) x,
  quantiles = c(0.025, 0.5, 0.975),
  x_train = NULL,
  ...
)

Value

A list containing aggregated predictions and per model predictions.

aggr

Aggregated predictions with mean and quantiles.

preds

A list of lists containing individual predictions per model per population in object.

Arguments

object

The model to use.

x

The new data to use for the prediction, a matrix where each row is an observation.

link

The link function to use

quantiles

The quantiles to calculate credible intervals for the posterior modes (in model space).

x_train

Training design matrix to be provided when imputations are to be made from them

...

Additional arguments to pass to merge_results.

Examples

Run this code
result <- gmjmcmc.parallel(
 runs = 1,
 cores = 1,
 x = matrix(rnorm(600), 100),
 y = matrix(rnorm(100), 100),
 P = 2,
 transforms = c("p0", "exp_dbl")
)
preds <- predict(result, matrix(rnorm(600), 100))

Run the code above in your browser using DataLab