SAVE (version 1.0)

predictreality: Predict values of reality at new input points

Description

The emulator of the computer model and the Bayesian fit are used to produce samples from the posterior predictive distribution of the computer model and bias function evaluated at the new input points. Then, bias-corrected predictions of the response (reality) are produced by adding these two samples (model+bias).

Usage

"predictreality"(object, newdesign, n.burnin=0, n.thin=1, tol=1E-10, verbose=FALSE, ...)
"summary"(object)
"show"(object)

Arguments

object
An object of the corresponding signature.
newdesign
A named matrix containing the points (controllable inputs) where predictions are to be performed. Column names should contain the object@controllablenames. This parameter should be set to NULL in the situation with constant controllable inputs.
n.burnin
The burnin to be applied (see details below).
n.thin
The thinin to be applied (see details below).
tol
The tolerance in the Cholesky decomposition.
verbose
A logical value indicating the level of output as the function runs.
...
Extra arguments to be passed to the function (still not implemented).

Value

Returns an S4 object of class predictreality.SAVE with the following slots:

Details

Draws from the posterior predictive distribution of the computer model and bias at a given set of controllable inputs are simulated using the MCMC sample from the posterior distribution of the parameters of the model stored in object@mcmcsample. This sample can be thinned by n.thin and/or the first n.burnin draws can be discarded.

A preliminary analysis of the resulting sample can be performed with summary which provides point estimates and tolerance bounds of the predictions.

See Also

validate

Examples

Run this code
## 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))
# 
# # summary of the results
# 
# summary(gfsw)
# 
# ##############
# # obtain the posterior distribution of the unknown parameters
# ##############
# 
# gfsw <- bayesfit(object=gfsw, prior=c(uniform("tuning", upper=8, lower=0.8)), 
# 				 n.iter=20000, n.burnin=100, n.thin=2)
# 
# #########
# # bias-corrected prediction at a set of inputs
# # using predictreality
# ##########
# 
# load <- c(4.0,5.3)
# curr <- seq(from=20,to=30,length=20)
# g <- c(1,2)
# 
# xnew<- expand.grid(current = curr, load = load, thickness=g)
# 
# # Obtain samples
# prsw <- predictreality(object=gfsw, newdesign=xnew, tol=1.E-12)
# 
# #Summarize the results:
# summary(prsw)
# 
# ## End(Not run)	
	
	

Run the code above in your browser using DataLab