predict.BayesMfp: Predict method for BayesMfp objects

predict.BayesMfpR Documentation

Predict method for BayesMfp objects

Description

Predict new responses from a single multiple FP model.

Usage

## S3 method for class 'BayesMfp'
predict(object, newdata, ...)

Arguments

object

valid BayesMfp object, from which only the first model will be used.

newdata

new covariate data with exactly the names (and preferably ranges) as for the original BayesMfp call

...

unused

Author(s)

Daniel Saban\'es Bov\'e

See Also

bmaPredict

Examples

## generate a BayesMfp object
set.seed(19)

x1 <- rnorm(n=15)
x2 <- rbinom(n=15, size=20, prob=0.5) 
x3 <- rexp(n=15)

y <- rt(n=15, df=2)

test <- BayesMfp(y ~ bfp (x2, max = 4) + uc (x1 + x3), nModels = 100,
                 method="exhaustive")

## predict new responses at (again random) covariates
predict(test,
        newdata = list(x1 = rnorm (15),
                       x2 = rbinom (n=15, size=5, prob=0.2) + 1,
                       x3 = rexp (15)))

bfp documentation built on March 19, 2024, 3:07 a.m.

Related to predict.BayesMfp in bfp...