llikGP | R Documentation |
Calculate a Gaussian process (GP) log likelihood or posterior probability with reference to a C-side GP object
llikGP(gpi, dab = c(0, 0), gab = c(0, 0))
llikGPsep(gpsepi, dab = c(0, 0), gab = c(0, 0))
gpi |
a C-side GP object identifier (positive integer);
e.g., as returned by |
gpsepi |
similar to |
dab |
|
gab |
|
An “ab
” parameter is a non-negative 2-vector describing
shape and rate parameters to a Gamma prior; a zero-setting for
either value results in no-prior being used in which case a log likelihood
is returned. If both ab
parameters are specified, then the value
returned can be interpreted as a log posterior density. See darg
for more information about ab
A real-valued scalar is returned.
Robert B. Gramacy rbg@vt.edu
mleGP
, darg
## partly following the example in mleGP
if(require("MASS")) {
## motorcycle data and predictive locations
X <- matrix(mcycle[,1], ncol=1)
Z <- mcycle[,2]
## get sensible ranges
d <- darg(NULL, X)
g <- garg(list(mle=TRUE), Z)
## initialize the model
gpi <- newGP(X, Z, d=d$start, g=g$start)
## calculate log likelihood
llikGP(gpi)
## calculate posterior probability
llikGP(gpi, d$ab, g$ab)
## clean up
deleteGP(gpi)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.