NuggetKriging::fit
Description
Fit a NuggetKriging
Model Object using given Observations
Usage
Python
# k = NuggetKriging(kernel=...) k.fit(y, X, regmodel = "constant", normalize = False, optim = "BFGS", objective = "LL", parameters = None)
R
# k = NuggetKriging(kernel=...) k$fit(y, X, regmodel = "constant", normalize = FALSE, optim = "BFGS", objective = "LL", parameters = NULL)
Matlab/Octave
% k = NuggetKriging(kernel=...) k.fit(y, X, regmodel = "constant", normalize = false, optim = "BFGS", objective = "LL", parameters = [])
Arguments
Argument |
Description |
---|---|
|
Numeric vector of response values. |
|
Numeric matrix of input design. |
|
Universal NuggetKriging linear trend: |
|
Logical. If |
|
Character giving the Optimization method used to fit hyper-parameters. Possible values are: |
|
Character giving the objective function to optimize. Possible values are: |
|
Initial values for the hyper-parameters. When provided this must be named list with some elements |
|
Character defining the covariance model: |
Details
The hyper-parameters (variance and vector of correlation ranges)
are estimated thanks to the optimization of a criterion given by
objective
, using the method given in optim
.
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) + 0.1 * rnorm(nrow(X))
k <- NuggetKriging("matern3_2")
print("before fit")
print(k)
k$fit(y,X)
print("after fit")
print(k)
Results
[1] "before fit"
* covariance:
* kernel: matern3_2
[1] "after fit"
* data: 10x[0.0455565,0.940467] -> 10x[0.149491,0.940566]
* trend constant (est.): 0.488156
* variance (est.): 0.078856
* covariance:
* kernel: matern3_2
* range (est.): 0.274956
* nugget (est.): 0.00347513
* fit:
* objective: LL
* optim: BFGS