<< findTheta krisp toolbox logLL >>

krisp toolbox >> krisp toolbox > km

km

Creates kriging model, based on given parameters. It may estimate some parameters analytically.

Calling Sequence

[kmodel]=km(Exp, Resp, trend, fcov, theta, inNoise,inBeta,inSigma,silent);
[kmodel]=km(Exp, Resp, trend, fcov, theta, inNoise,inBeta,inSigma);
[kmodel]=km(Exp, Resp, trend, fcov, theta, inNoise,inBeta);
[kmodel]=km(Exp, Resp, trend, fcov, theta, inNoise);
[kmodel]=km(Exp, Resp, trend, fcov, theta);

Parameters

Exp:

design of experiments (m*n matrix), m - number of points, n - number of dimensions (each row represents one point).

Resp:

column vector (m*1) of m respone values for experiment.

trend:

pointer to trend function, that should return 1*p trend coefficients; Trend parameter can also have scalar values for included trend functions:

if trend ==0 then uses constant trend (function poly0);

if trend==1 linear polynomial (function poly1); if trend ==2 quadratic polynomial (function poly2).

if trend is not specified assumes trend=0.

fcov:

string describing correlation function. Use fcov= 'gaussian', Gaussian correlation; fcov= 'matern_5_2' for Matern 5_2 correlation function; fcov= 'exponential_1' or fcov='exponential_1_9' for power exponential.

theta:

row array (1*n) of scaling hyper-parameter values.

inNoise:

scalar, variance of noise effect.

if inNoise ==0, assumes no noise (sets noise=%eps*10 for numerical stability). If needed larger noise for numerical stability, but estimation procedure of other parameters as for deterministic case, one can use inNoise>0 in km(.) and set manually model.estimateNoise=0 between call to km(.) and findTheta(.).

if inNoise is not given, tries to estimate noise;

if inNoise is given assumes non zero noise.

inBeta:

column vector (p*1) of trend coefficients. If zero trend needed use trend=0 and inBeta=0;

If inBeta is not given, estimates trend coefficients (Beta) analytically from the data using maximum Likelihood. In this case the estimation error is acounted in predicted variance.

inSigma:

scalar, total process variance.

If inSigma is not given, tries to estimate total process variance from the data using maximum likelihood.

silent:

if it is necessary to operate in silent mode (no output to console). Default %f - the output is displayed;

kmodel:

mlist of type kmodel, containing information of kriging model.

m - number of experiment points.

n - number of dimensions.

trend - handle to trend funciton.

cov - correlation function.

theta - row array (1*n) of scaling hyper-parameter values.

MLL - negative Likelihood value.

dMLL - derivative of likelihood. Not implemented.

scS - scaling coefficients for experiment points (2*n). scS(1,:) - mean, scS(2,:) - st. dev.

scY - scaling coefficients for response values.

alfa - parameter for estimation of nugget and variance. Used in case when noise is not known.

coefcov - parameter, that links R to covariance. cefcov*R=covariance matrix. In case R is covariance matrix coefcov=1.

estimateNoise - flag that specifies if noise should be estimated.=1 when noise is known, =0 when there is no noise, =-1 when noise is not known and should be estimated.

estimateBeta - flag that specifies if trend coefficients should be estimated. =1 trend parameters are known and should not be estimated. =-1 trend parameters are not known and should be estimated (In this case the estimation error is acounted in predicted variance).

estimateSigma -flag that specifies if process variance should be estimated.=1 variance is known and should not be estimated.=-1 variance is not known and should be estimated.

noise - noise variance. It is equal to inNoise if given, estimated if inNoise is not given.

sigma - process total variance. It is equal to inSigma if given, estimated if inSigma is not given.

silent - if it is necessary to operate in silent mode (no output to console).

optimizer - mlist that contians information about parameter estimation procedure (optimizer with settings). It is set in findTheta().

Description

Creates kriging model, based on given parameters. It may estimate some parameters analytically. Usually used togeather with findTheta(.), which estimates model parameters.

This function and other functions operating with kriging model sets and uses all or some of global variables:

S_kriging - design of experiments; D_kriging - distances between experimental points; Y_kriging - response values for experiment; R_kriging - correlation (covariance) matrix;

T_kriging - Cholesky decomposition of R_kriging; Ty_kriging - Ty_kriging=(T')\(Y_kriging); F_kriging - Trend matrix (m*p) of experiment points M_kriging - M_kriging=(T_kriging')\(F_kriging); Beta_kriging - estimated trend coefficients or inBeta if given; Tyfb - Tyfb=(T_kriging')\(Y_kriging-F_kriging*Beta_kriging); frf - frf=inv((M')*M);

Examples

// 1D example
// zero noise
ftest=sin; // Response function

x_bound=[-2; 2];
X=(linspace(x_bound(1),x_bound(2),4))'; // Points of experiment
YExp=ftest(X);// Response values

noise=0;theta=1
[kmodel] =km(X,YExp,0,'gaussian',theta,noise);// creates kriging model  (constant trend)

lob   = [0.1];upb   = [10];
[kmodel p]=findTheta(kmodel,lob,upb,'MLL','RS',200);// searches for optimal hyper-parameters
//[kmodel p]=findTheta(kmodel,lob,upb,'CV','RS',200);// searches for optimal hyper-parameters

Xtest=(linspace(x_bound(1),x_bound(2),100))'; // 100 point test sample
[YX vY]=predict(kmodel,Xtest); // kriging prediction

// plot
scf();
xtitle('Kriging prediction, data points and test function');
plot(Xtest,YX,'k+');
plot(Xtest,ftest(Xtest));
plot(X,YExp,'r+');
a=gca();
a.data_bounds=a.data_bounds.*[1.1,1;1.1,1];
a.tight_limits="on";

// Simulate conditional Gaussian
kmodel.noise=0.00000001;// add small noise for numerical stability

[Sim1]=SimCondGaussian(Xtest,kmodel,50);
scf;
xtitle('Simulation of Conditional Gaussian processes and Kriging mean');
plot(Xtest,Sim1,'k'); // simulations
plot(Xtest,YX,'r');// Kriging mean

showModel(kmodel)

//See demos directory for more examples.

See also

Authors

Bibliography

Rasmussen C.E., Williams C.K.I. (2006), Gaussian Processes for Machine Learning, the MIT Press

Roustant O.,Ginsbourger D., Deville Y. (2010), Two R packages for the analysis of computer experiments by kriging-based metamodeling and optimization. http://hal.archives-ouvertes.fr/hal-00495766_v2/

<< findTheta krisp toolbox logLL >>