Description Usage Arguments Value Author(s) References See Also Examples
A function to determine a Gaussian process fit to a set of
points forming a matrix X
, given a column
of corresponding values of the log-density
of a target distribution. Returned is a (zero mean)
approximation Ef
of the log-density and various
components of the Gaussian process fit as used by
hybrid.explore
and hybrid.sample
.
1 |
X |
A matrix of at least 2 columns with rows representing the points (nodes) for a Gaussian process fit. |
y |
A column of corresponding values of the log-density.
Each entry corresponds to the log-density evaluated
at the respective row in |
params |
Gaussian process parameters as used in |
request.functions |
Optional boolean argument (default TRUE) to request the return of function
approximations |
finetune |
Optional boolean argument (default FALSE) to determine
fine-tuned optimal values in |
Returned is a list as requested consisting of:
Ef |
The Gaussian process approximation of the log-density function. |
sigmaf |
Upon request, a function giving the Gaussian process
approximation of the standard deviation with respect to |
Sigma |
Covariance matrix used in the Gaussian process fit. |
Sigma.inv |
The inverse of the Covariance matrix. |
inverseOK |
Boolean flag to indicate successful calculation
of |
X |
The original |
y |
|
params |
Parameter values for the Gaussian process fit. |
Mark James Fielding <mark.fielding@gmx.com>
"Efficient MCMC Schemes for Computationally Expensive Posterior Distributions", Fielding, Nott and Liong (2011).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | mu1 <- c(-1, -1)
mu2 <- c(+1, +1)
sigma.sq <- 0.1225
X <- matrix(c(-2,-1,0,-2,0,2,0,1,2, -2,-1,-2,0,0,0,2,1,2), ncol = 2)
f <- function(x) {
px <- 1/4/pi/sqrt(sigma.sq) * exp(-1/2/sigma.sq *
sum((x - mu1)^2)) + 1/4/pi/sqrt(sigma.sq) *
exp(-1/2/sigma.sq * sum((x - mu2)^2))
return(log(px))
}
y <- rep(NA, 9)
for(i in 1:9) y[i] <- f(X[i,])
Ef <- GProcess(X, y, request.functions = TRUE)$Ef
Ey <- NA*y
for(i in 1:9) Ey[i] <- Ef(X[i,])
data.frame(X, y, Ey)
## Gaussian process close to exact at points supplied.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.