Learn R Programming

rlibkriging (version 0.7-4.3)

logMargPostFun.Kriging: Compute the log-marginal posterior of a kriging model, using the prior XXXY.

Description

Compute the log-marginal posterior of a kriging model, using the prior XXXY.

Usage

# S3 method for Kriging
logMargPostFun(object, theta, grad = FALSE, ...)

Value

The value of the log-marginal posterior computed for the given vector theta.

Arguments

object

S3 Kriging object.

theta

Numeric vector of correlation range parameters at which the function is to be evaluated.

grad

Logical. Should the function return the gradient (w.r.t theta)?

...

Not used.

Author

Yann Richet yann.richet@irsn.fr

References

XXXY A reference describing the model (prior, ...)

See Also

rgasp in the RobustGaSP package.

Examples

Run this code
f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
set.seed(123)
X <- as.matrix(runif(10))
y <- f(X)

k <- Kriging(y, X, "matern3_2", objective="LMP")
print(k)

lmp <- function(theta) logMargPostFun(k, theta)$logMargPost

t <- seq(from = 0.01, to = 2, length.out = 101)
plot(t, lmp(t), type = "l")
abline(v = k$theta(), col = "blue")

Run the code above in your browser using DataLab