fitEmulator: Fit Emulator

Description Usage Arguments Details Value References See Also Examples

Description

A function that fits an emulator to the data given resulting in an object of class emulatorFit.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
fitEmulator(inputs, outputs, prior.mean = "linear",
  cor.function = corGaussian, method = c("separable", "LMC"), ...)

fitEmulatorLMC(inputs, outputs, prior.mean = "linear",
  cor.function = corGaussian, phi.opt, sigmasq.opt, MCMC.iterations = 50,
  phi.init, sigmasq.init, MC.plot = FALSE, param = "matrix-log", ...)

fitEmulatorSEP(inputs, outputs, prior.mean = "linear",
  cor.function = corGaussian, phi.opt, sigmasq.opt, MCMC.iterations = 50,
  phi.init, sigmasq.init, MC.plot = FALSE, nugget = NULL,
  optim.method = "BFGS", optimise.interval, ...)

## S3 method for class 'emulatorFit'
fitted(object, ...)

## S3 method for class 'emulatorFit'
print(x, ...)

Arguments

inputs

A data frame, matrix or vector containing the input values of the training data. For matrices and data frames, use one column per input variable.

outputs

A data frame, matrix or vector containing the output values of the training data. For multivariate output, use one column per output variable.

prior.mean

Either an object of class 'formula' or 'Formula' that specifies the regressors in the prior mean function, or one of the two strings 'linear' or 'constant' that specify a linear prior mean in each input and a constant prior mean respectively. See details if method = 'LMC' and you want to specify a formula.

cor.function

Specifies a correlation function used as part of the prior information for the emulator. This package has options of: corGaussian, corMatern2.5, corGaussianPeriodic, corGaussianPeriodic2 and corCombined. One can also specify a user defined function, however this must follow the signature of, for example corGaussian.

method

Can take string 'seperable' (default) or 'LMC'. The seperable method is used for univariate output. For multivariate output, this distinction is more important. The separable emulator restricts the model to have just one set of hyper-parameters that are shared across all outputs, however the LMC (Linear model of coregionalisation) emulator allows for flexibilty of individual hyper-parameters for each output. See the references for further information.

...

Additional arguments to be used for fitEmulator and passed on to correlation functions.

phi.opt

An optional vector that indicates the optimal phi values used to fit the emulator. It avoids running the optimiser to generate optimal phi values (in this case, the phi.init values are ignored). If not given phi.init values are optimised.

sigmasq.opt

An optional scalar that indicates the optimal sigmasq value used to fit the emulator. It avoids running the optimiser to generate optimal sigmasq value (in this case, the sigmasq.init values are ignored). If not given sigmasq.init values are optimised.

MCMC.iterations

An optional value that indicates how many iterations to run the MCMC for. A non-positive value indicates not to apply the MCMC to estimate the starting values for the optimisation. In this case it will use the values given by phi.init as the starting values for the optimisation. Note: MCMC is run in order to get better starting values for the optim function that evaluates an optimum value for the hyperparameters,

phi.init

An optional vector used as starting values for either the optimisation or the MCMC output depending on MCMC.iterations given. If provided, it should be either a vector of length 1, where it will be assumed that all inputs have the same phi.init values, or a vector of length tequal to the number of inputs. The default value is a vector of zeros, however when method = 'LMC', the default value is derived by fitting individual optimized estimates from the univariate emulator. Phi refers to the roughness parameter used for the calcuations.

sigmasq.init

A optional scalar used as a starting value for either the optimisation or the MCMC output depending on MCMC.iterations given. If provided, it should be a vector of length the same as the number of inputs. The default value is a vector of zeros, however when method = 'LMC', the default value is derived by fitting a multivariate separate emulator and obtaining the estimates of the optimised sigmasq.hat values. For method = 'separable' sigmsq refers to an unknown scale parameter to calculate the covariance matirx. For method = 'LMC', sigmasq refers to the between outputs covaraince matrix.

MC.plot

If TRUE, produces a trace plot of the MCMC output of log likelihood against the number of iterations. (default: FALSE)

param

The type of parametrization chosen to appopriately parametrize the covariance matrix. param can take one of the following values: 'original', 'cholesky', 'log-cholesky', 'spherical', 'matrix-log' (defult), which refer to the name of the method used to parametrise according to the paper (1996) listed in the reference.

nugget

For noisy data, a scalar or a vector giving the observation variance for each training data point. If scalar, nugget for each training data point will be set to the same scalar value as specified. Currently only available with univariate output.

optim.method

The optimisation method to use for estimation of the unknown hyper-parameters. See optim.

optimise.interval

For optim.method = "Brent" with only one parameter to be estimated, a vector passed on to optimise containing the interval to search within.

object

A fit object of class inheriting from 'emulatorFit'.

x

A fit object of class inheriting from 'emulatorFit'.

Details

This function implements emulator fitting based on the procedures described in http://mucm.aston.ac.uk/MUCM/MUCMToolkit.

For the prior.mean arguement, if method = 'separable' then the left hand side of the equation is not required, but if specified, should include variables that are colnames of outputs. However, if method = 'LMC' and a formula is specified, it should have a similar format to the following. Given 3 output variables (y1, y2 and y3) and 3 input variables (x1, x2 and x3): y1 | y2 | y3 ~ x1 + x2 | x1 + x3 | x2 + x3. (The actual equations can vary). Note: the vertical lines separate prior mean formula for each output, for instance in the example above the prior mean formula for y1 is given as (y1 = x1 + x2), and for y3 is given as (y3 = x2 + x3). This format allows the user to specify different prior mean formulas for each output.

Value

fitEmulator returns an object of class 'emulatorFit'. An object of class 'emulatorFit' is a list containing at least the following components:

betahat Posterior mean of β.
sigmasq.hat Posterior mean of sigmasq.
out.min.Hbeta (y - H β).
phi.hat Optimum maximum likelihood estimate of the correlation length parameter
training.inputs Inputs used to train the emulator.
training.outputs Outputs used to train the emulator.
H.training Part of the prior.mean.
tL The cholesky decomposition of matrix A.
K The cholesky decomposition of the inverse of tL multiplied with H.
n.train Number of training runs (rows of D).
n.regressors Number of columns of H.
n.outputs Number of outputs.
cor.function The correlation function chosen for the prior variance.
cor.functions.args Extra arguments used for cor.functions and passed on for further evaluation.
formula The regressor terms in the prior mean function data.
log.lik It gives the log-likelihood value.
opt.convergence Only given if the optimisation was run. It is An integer code where 0 indicates successful completion. See optim for more information.
opt.message Only given if the optimisation was run. A character string giving any additional information returned by the optimizer, or NULL.

If method = 'separable' the following components are included.

Ainv.H Ainv * H.
Ainv.e Ainv * out.min.Hbeta.
nugget A vector giving the observation variance for each training data point.

If method = 'LMC', fitEmulator returns an object of class 'emulatorFit' and 'emulatorFitLMC'. The following components are also included.

Vinv.H Vinv * H.
Vinv.e Vinv * out.min.Hbeta.
sigmasq.param The type of parametrization chosen to appopriately parametrize the covariance matrix (sigmasq)

fitted returns the fitted values (i.e. the posterior mean estimate). This should equal outputs unless nugget is used.

References

Fricker, T. E., Oakley, J. E., & Urban, N. M. (2013). Multivariate Gaussian process emulators with nonseparable covariance structures. Technometrics, 55(1), 47-56.

Pinheiro, J. C., & Bates, D. M. (1996). Unconstrained parametrizations for variance-covariance matrices. Statistics and Computing, 6(3), 289-296.

See Also

If all data is in single matrix, see fitEmulatorData for a more conveniant method. To predict at new points, see predict.emulatorFit

Examples

1
2
3
4
5
fit1 <- fitEmulator(inputs = surfebm[1:25,1:2], outputs = surfebm[1:25,3]) 

fit2 <- fitEmulator(inputs = surfebm[1:25,1:2], outputs = surfebm[1:25,3],
                    prior.mean = 'constant', cor.function = corMatern2.5,
                    MCMC.iterations = 1000)

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