Kriging::logLikelihoodFun

Description

Compute the Profile Log-Likelihood of a Kriging Model Object for a given Vector \(\boldsymbol{\theta}\) of Correlation Ranges

Usage

  • Python

    # k = Kriging(...)
    k.logLikelihoodFun(theta)
    
  • R

    # k = Kriging(...)
    k$logLikelihoodFun(theta)
    
  • Matlab/Octave

    % k = Kriging(...)
    k.logLikelihoodFun(theta)
    

Arguments

Argument

Description

theta

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

grad

Logical. Should the function return the gradient?

hess

Logical. Should the function return Hessian?

Details

The profile log-likelihood \(\ell_{\texttt{prof}}(\boldsymbol{\theta})\) is obtained from the log-likelihood function \(\ell(\boldsymbol{\theta},\, \sigma^2, \, \boldsymbol{\beta})\) by replacing the GP variance \(\sigma^2\) and the vector \(\boldsymbol{\beta}\) of trend coefficients by their ML estimates \(\widehat{\sigma}^2\) and \(\widehat{\boldsymbol{\beta}}\) which are obtained by Generalized Least Squares. See here for more details.

Value

The value of the profile log-likelihood \(\ell_{\texttt{prof}}(\boldsymbol{\theta})\) for the given vector \(\boldsymbol{\theta}\) of correlation ranges.

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) k$logLikelihoodFun(theta)$logLikelihood

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

Results

* data: 10x[0.0455565,0.940467] -> 10x[0.194057,1.00912]
* trend constant (est.): 0.433954
* variance (est.): 0.0873685
* covariance:
  * kernel: matern3_2
  * range (est.): 0.240585
  * fit:
    * objective: LL
    * optim: BFGS