Description Usage Arguments Value Author(s) See Also Examples
calibrate
is a function that allows to generate a calibrate.class
class in which the estimation is
done for a defined model.class
and prior.class
objects.
1 |
md |
a |
pr |
a |
opt.estim |
estimation options
|
opt.valid |
list of cross validation options (default value opt.valid=NULL)
|
calibrate
returns a calibrate.class
object. Two main methods are available:
plot(mdfit, x, graph) displays a series of graphs (ACF, MCMC, density a priori vs a posteriori , correlation between parameters, results on the quantify of interest, etc..) or return a list with all the graphs:
mdfit The calibrated model (a calibrate.class
object)
x The x-axis
graph Allows to select the wanted display. By default all the layout pannel graphs are displayed and
graph="all"
. If graph="chains"
, only the layout of the autocorrelation, chains points and densities
a priori and a posteriori is produced. If graph="corr"
, only the layout of the correlation graph between
each parameter is displayed. If graph="result"
, only the result on the quantity of interest is given.
If graph=NULL
, no graphs are produced automatically.
print(mdfit) returns the main information concerning the calibrate.class
object
M. Carmassi
prior
, calibrate
, forecast
, sequentialDesign
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 | ## Not run:
###################### The code to calibrate
X <- cbind(seq(0,1,length.out=10),seq(0,1,length.out=10))
code <- function(X,theta)
{
return((6*X[,1]*theta[2]-2)^2*theta[1]*sin(theta[3]*X[,2]-4))
}
Yexp <- code(X,c(1,1,11))+rnorm(10,0,0.1)
############### For the first model
###### Definition of the model
md <- model(code,X,Yexp,"model1")
###### Definition of the prior densities
pr <- prior(type.prior=c("gaussian","gaussian","gaussian","gamma"),opt.prior=
list(c(1,0.01),c(1,0.01),c(11,3),c(2,0.1)))
###### Definition of the calibration options
opt.estim=list(Ngibbs=200,Nmh=400,thetaInit=c(1,1,11,0.1),r=c(0.3,0.3),
sig=diag(4),Nchains=1,burnIn=100)
###### Run the calibration
mdfit <- calibrate(md,pr,opt.estim)
####### The plot generated is a list of ggplot
p <- plot(mdfit,X[,1])
p$out
print(mdfit)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.