Description Usage Arguments Details Value Author(s) See Also Examples
The emulator of the computer model fitted by SAVE
is used to predict values of the model at new input points.
1 2 3 4 5 6 7 8 9 10 11 | ## S4 method for signature 'SAVE'
predictcode(object, newdesign, n.iter=1000, sampledraws=T, tol=1e-10, verbose=FALSE)
## S4 method for signature 'predictcode.SAVE'
summary(object)
## S4 method for signature 'summary.predictcode.SAVE'
show(object)
## S4 method for signature 'predictcode.SAVE'
plot(x, ...)
|
object |
An object of the corresponding signature. |
newdesign |
A named matrix containing the points (calibration and controllable inputs) where predictions are to be performed. Column names should contain both the |
n.iter |
The number of simulations that are to be drawn from the emulator (see details below) |
sampledraws |
If TRUE a sample of size |
tol |
The tolerance in the Cholesky decomposition |
verbose |
A |
... |
Extra arguments to be passed to the function (still not implemented). |
x |
An object of class |
The emulator of the computer model fitted by SAVE
evaluated at the new input points specified in newdesign
is a multivariate normal. Then predictcode
computes the mean, the covariance matrix and, if sampledraws=TRUE
, a simulated sample of size n.iter
from this multivariate normal. A pivotal Cholesky decomposition algorithm is used in the simulation of the samples and tol
is a tolerance parameter in this algorithm.
The object created can be explored with the functions plot
and summary
. The first function plots a graphic with the mean and 95% tolerance bounds of the emulator at each of the new input points. Furthermore, summary
prints a matrix with the mean of the emulator at each new input point, the associated standard deviation, and 95% tolerance bounds.
Returns an S4 object of the class predictcode.SAVE
that contains the following slots:
newdesign |
A copy of the design. |
samples |
The matrix that contains the simulations (see details). |
mle |
A copy of the maximum likelihood estimate |
predictcodecall |
The call to this function. |
modelmean |
The mean of the emulator (see details) at the new design |
covmat |
The covariance matrix of the emulator (see details) at the new design |
Jesus Palomo, Rui Paulo and Gonzalo Garcia-Donato.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ## Not run:
library(SAVE)
#############
# load data
#############
data(spotweldfield,package='SAVE')
data(spotweldmodel,package='SAVE')
##############
# create the SAVE object which describes the problem and
# compute the corresponding mle estimates
##############
gfsw <- SAVE(response.name="diameter", controllable.names=c("current", "load", "thickness"),
calibration.names="tuning", field.data=spotweldfield,
model.data=spotweldmodel, mean.formula=~1,
bestguess=list(tuning=4.0))
##########
# emulate the output of the model using predictcode
##########
# construct design at which to emulate the model
u <- 3.2
load <- c(4.0,5.3)
curr <- seq(from=20,to=30,length=20)
g <- c(1,2)
xnewpure <- expand.grid(curr,load,g)
xnewpure <- cbind(xnewpure,rep(u,dim(xnewpure)[1]))
names(xnewpure) <- c("current","load","thickness","tuning")
xnewpure <- as.data.frame(xnewpure)
pcsw<- predictcode(object=gfsw, newdesign=xnewpure, n.iter=20000, tol=1.E-12)
#A summary of the emulation:
summary(pcsw)
#A plot of the emulation
plot(pcsw)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.