fitEmulatorData: Fit Emulator (Data)

Description Usage Arguments Value See Also Examples

Description

A function equivalent to fitEmulator. In fitEmulatorData the user can provide the inputs and outputs in one matrix/dataframe. To provide them seperately, use fitEmulator

Usage

1
fitEmulatorData(formula, data, input.names = NULL, ...)

Arguments

formula

Formula to include the RHS and LHS. The LHS indicates the outputs and the RHS defines the prior mean function defined by the column names of data. A multivariate formula can also be given (see as.Formula) .

data

A data frame or matrix containing at least the inputs and outputs of the model.

input.names

An optional vector of character containing the names of variables in data to be considered as input variables. By default, all variables in the data matrix, except those on the left hand side of the formula, are treated as inputs.

...

Additional arguments to be passed to the more specific fitEmulator function. Arguments such as MCMC.iterations, phi.opt, MC.plot, etc.

Value

fitEmulatorData returns an object of class 'emulatorFit'. See fitEmulator for details.

See Also

If input and output data is in different objects, see fitEmulator as a more conveniant method.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# specify the prior mean function as a object of class 'formula'
# ensure colnames of datasets include at least these variables.
emulator.prior.mean.formula <- Y ~ X.1 + X.2  

# fit the emulator using a prior mean specified above and a Gaussian correlation function.
fit <- fitEmulatorData(formula = emulator.prior.mean.formula, data = surfebm[1:25, ], 
                       cor.function = corGaussian)

# Use fitted emulator to predict posterior means and variances at the new inputs
predictions <- predict(fit, surfebm[26:35, 1:2], sd = FALSE, var.cov = TRUE)

# view results
print(predictions$posterior.mean)

OakleyJ/MUCM documentation built on May 7, 2019, 9:01 p.m.