Description Usage Arguments Details Author(s) Examples
Plots are provided to summarize graphically the Bayesian analysis of a computer model.
1 2 |
x |
An object of class |
option |
One of "trace", "calibration" or "precision"(see details) |
... |
Additional graphical parameters to be passed |
Three different plots are implemented. If option
="trace" this function returns the trace plots of the simulated chains. This plot is useful for assessing the convergence of the sampling method. If option
="calibration" this function plots an histogram of the sample obtained from the posterior distribution of the calibration parameters and a line representing the prior assumed. If option
="precision" the histograms and priors correspond to the precision parameters.
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 | ## 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))
##############
# 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)
#A trace plot of the chains
plot(gfsw, option="trace")
#The histogram of the posterior density of calibration parameters
plot(gfsw, option="calibration")
#The histogram of the posterior density of precision parameters
plot(gfsw, option="precision")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.