logLikelihoodFun.Kriging: Compute Log-Likelihood of Kriging Model

View source: R/KrigingClass.R

logLikelihoodFun.KrigingR Documentation

Compute Log-Likelihood of Kriging Model

Description

Compute Log-Likelihood of Kriging Model

Usage

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

Arguments

object

An S3 Kriging object.

theta

A numeric vector of (positive) range parameters at which the log-likelihood will be evaluated.

grad

Logical. Should the function return the gradient?

hess

Logical. Should the function return Hessian?

...

Not used.

Value

The log-Likelihood computed for given θ.

Author(s)

Yann Richet yann.richet@irsn.fr

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, kernel = "matern3_2")
print(k)

ll <- function(theta) logLikelihoodFun(k, theta)$logLikelihood

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

rlibkriging documentation built on Sept. 22, 2022, 5:07 p.m.