GaSP | R Documentation |
This function serves as a wrapper to build, fit, and make prediction
for a Gaussian process model. It calls on functions gp
, gp.mcmc
,
gp.optim
, gp.predict
.
GaSP(
formula = ~1,
output,
input,
param,
smooth.est = FALSE,
input.new = NULL,
cov.model = list(family = "CH", form = "isotropic"),
model.fit = "Cauchy_prior",
prior = list(),
proposal = list(range = 0.35, tail = 2, nugget = 0.8, nu = 0.8),
nsample = 5000,
burnin = 1000,
opt = NULL,
bound = NULL,
dtype = "Euclidean",
verbose = TRUE
)
formula |
an object of |
output |
a numerical vector including observations or outputs in a GaSP |
input |
a matrix including inputs in a GaSP |
param |
a list including values for regression parameters, covariance parameters, and nugget variance parameter. The specification of param should depend on the covariance model.
|
smooth.est |
a logical value indicating whether smoothness parameter will be estimated. |
input.new |
a matrix of new input locations |
cov.model |
a list of two strings: family, form, where family indicates the family of covariance functions including the Confluent Hypergeometric class, the Matérn class, the Cauchy class, the powered-exponential class. form indicates the specific form of covariance structures including the isotropic form, tensor form, automatic relevance determination form.
|
model.fit |
a string indicating the choice of priors on correlation parameters:
|
prior |
a list containing tuning parameters in prior distribution. This is used only if a subjective Bayes estimation method with informative priors is used. |
proposal |
a list containing tuning parameters in proposal distribution. This is used only if a Bayes estimation method is used. |
nsample |
an integer indicating the number of MCMC samples. |
burnin |
an integer indicating the burn-in period. |
opt |
a list of arguments to setup the
|
bound |
Default value is
for the Confluent Hypergeometric covariance and the Cauchy covariance.
|
dtype |
a string indicating the type of distance:
|
verbose |
a logical value. If it is |
a list containing the S4
object gp and prediction results
Pulong Ma mpulong@gmail.com
GPBayes-package
, gp
, gp.mcmc
, gp.optim
, gp.predict
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)
# fitting a GaSP model with the objective Bayes approach
fit = GaSP(formula=~1, output, input,
param=list(range=3, nugget=0.1, nu=2.5),
smooth.est=FALSE, input.new=XX,
cov.model=list(family="matern", form="isotropic"),
proposal=list(range=.35, nugget=.8, nu=0.8),
dtype="Euclidean", model.fit="Cauchy_prior", nsample=50,
burnin=10, verbose=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.