# logMargPostFun.Kriging: Compute Log-Marginal-Posterior of Kriging Model In rlibkriging: Kriging Models using the 'libKriging' Library

 logMargPostFun.Kriging R Documentation

## Compute Log-Marginal-Posterior of Kriging Model

### Description

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

### Usage

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

### 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.

### 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, ...)

`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 Sept. 22, 2022, 5:07 p.m.