gp.mcmc | R Documentation |
This function is a wraper to estimate parameters via MCMC algorithms in the GaSP model with different choices of priors.
gp.mcmc(
obj,
input.new = NULL,
method = "Cauchy_prior",
prior = list(),
proposal = list(),
nsample = 10000,
verbose = TRUE
)
obj |
an |
input.new |
a matrix of prediction locations. Default value is |
method |
a string indicating the Bayes estimation approaches with different choices of priors on correlation parameters:
|
prior |
a list containing tuning parameters in prior distributions. This is used only if a Bayes estimation method with subjective priors is used. |
proposal |
a list containing tuning parameters in proposal distributions. This is used only if a Bayes estimation method is used. |
nsample |
an integer indicating the number of MCMC samples. |
verbose |
a logical value. If it is |
a gp
object with prior, proposal, MCMC samples included.
Pulong Ma mpulong@gmail.com
GPBayes-package, GaSP
, gp, gp.optim
code = function(x){
y = (sin(pi*x/5) + 0.2*cos(4*pi*x/5))*(x<=9.6) + (x/10-1)*(x>9.6)
return(y)
}
n=100
input = seq(0, 20, length=n)
XX = seq(0, 20, length=99)
Ztrue = code(input)
set.seed(1234)
output = Ztrue + rnorm(length(Ztrue), sd=0.1)
obj = gp(formula=~1, output, input,
param=list(range=4, nugget=0.1,nu=2.5),
smooth.est=FALSE,
cov.model=list(family="matern", form="isotropic"))
fit.mcmc = gp.mcmc(obj, method="Cauchy_prior",
proposal=list(range=0.3, nugget=0.8),
nsample=100, verbose=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.