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

View source: R/KrigingClass.R

logMargPostFun.KrigingR Documentation

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 class 'Kriging'
logMargPostFun(object, theta, return_grad = FALSE, bench = FALSE, ...)

Arguments

object

S3 Kriging object.

theta

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

return_grad

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

bench

Logical. Should the function display benchmarking output?

...

Not used.

Value

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

Author(s)

Yann Richet yann.richet@irsn.fr

References

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

See Also

rgasp in the RobustGaSP package.

Examples

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")

rlibkriging documentation built on Oct. 3, 2024, 1:06 a.m.