## 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