ForK Library
Functions/Subroutines

krigingfuncvarianceGEK.f90 File Reference

Subroutine to Variance of function values from Gradient-Enhanced Kriging Surface (requires buildkrigingGEK to be called first) More...

Go to the source code of this file.

Functions/Subroutines

subroutine krigingfuncvarianceGEK (ndim, ntot, X, gtot, pts, dims, stot, H, hyper, mtot, Xm, Hm, S, covarflagi)
 This subroutine calculates the variance associated with function predictions from a Gradient-Enhanced Kriging model. The details of this variance prediction are given in krigingfuncvariance for a function-only model. For a gradient-enhanced model, the variance predictions take the same form as a function-only model and are given by the formula:

Detailed Description

Subroutine to Variance of function values from Gradient-Enhanced Kriging Surface (requires buildkrigingGEK to be called first)

Definition in file krigingfuncvarianceGEK.f90.


Function Documentation

subroutine krigingfuncvarianceGEK ( integer,intent(in)  ndim,
integer,intent(in)  ntot,
real(8),dimension(ndim,ntot),intent(in)  X,
integer,intent(in)  gtot,
integer,dimension(gtot),intent(in)  pts,
integer,dimension(gtot),intent(in)  dims,
integer,intent(in)  stot,
real(8),dimension(stot,ntot+gtot),intent(in)  H,
real(8),dimension(ndim+3),intent(in)  hyper,
integer,intent(in)  mtot,
real(8),dimension(ndim,mtot),intent(in)  Xm,
real(8),dimension(stot,mtot),intent(in)  Hm,
real(8),dimension(mtot),intent(out)  S,
integer,intent(in)  covarflagi 
)

This subroutine calculates the variance associated with function predictions from a Gradient-Enhanced Kriging model. The details of this variance prediction are given in krigingfuncvariance for a function-only model. For a gradient-enhanced model, the variance predictions take the same form as a function-only model and are given by the formula:

\[ V\left[y_*\right]= cov(\vec{x}_{*},\vec{x}_{*})-\underline{k}_*^T \underline{K}^{-1} \underline{k}_*+ \underline{R}(\vec{x}_*) \underline{A}^{-1} \underline{R}(\vec{x}_*)^{T} \]

The gradient-enhanced versions of the covariance matrices can be found in buildkrigingGEK and krigingfuncpredictGEK. The gradient-enhanced regression matrix is defined using the gradient-enhanced collocation matrix and covariance matrix, given as:

\[ \underline{A} = \underline{H} \underline{K}^{-1} \underline{H}^{T} \]

Finally, the term \(\underline{R}\) is given as:

\[ \underline{R}(\vec{x}_{*}) = h^{T} - \underline{k}^{T}_{*} \underline{K}^{-1} \underline{H}^{T} \]

Author:
Brian Lockwood Department of Mechanical Engineering University of Wyoming
Date:
May 2, 2012
Parameters:
in)ndim : The dimension of the problem
in)ntot : The number of Training points
in)X : The location of the training points (size=[ndimxntot])
in)gtot: Number of derivative values included in training data (ndim*ntot if all derivatives are included at the training points)
in)pts: List identifying what point the derivative value is enforced at (size=[gtot] with values ranging from 1 to ntot)
in)dims: List identifying the dimension the derivative is taken with respect to (size=[gtot] with values ranging from 1 to ndim)
in)stot : Number of Terms in the regression
in)H: The collocation matrix for the regression including derivative values. (size=[stotxntot+gtot])
Columns 1:ntot are the basis evaluated at the training points
Columns ntot+1:ntot+gtot are the derivative of the basis evaluated at the training points
in) beta: Regression coefficients based on the optimal estimate for the Kriging model (size=[stot])
Supplied by buildkrigingGEK subroutine
in)hyper: Hyperparameters for the Kriging Model (size=[ndim+3])
Supplied by buildkrigingGEK subroutine
in)mtot : The number of test points, the places where function prediction are desired
in)Xm : The location of the test points (size=[ndimxmtot])
in)Hm : The collocation matrix evaluated at the test points. The derivative of the basis is NOT required for the test points to predict function values (size=[stotxmtot])
out)S: The variance of the function values (size=[mtot])
Predicting the variance values requires the construction of the covariance matrix for the training data so it is more expensive than function predictions
Best to predict the variance associated with multiple points using a single function call if possible.
in)covarflagi: Flag to govern which covariance function is used

  • covarflag==1 Uses Matern function with \(\nu=3/2\)
  • covarflag==2 Uses Matern function with \(\nu=5/2\)


The parameter \(\nu\) governs the smoothness and differentiability of the covariance function.
When using gradient values, \(\nu=1/2\) is not differentiable enough so \(\nu \geq 3/2\) must be used
Must supply the same covariance flag as used in buildkrigingGEK.

Definition at line 59 of file krigingfuncvarianceGEK.f90.

References covars::covarflag, covars::covarfunc(), choleskymod::invertsymmetric(), choleskymod::matrixmulttrans(), choleskymod::symmatrixmulttrans(), and choleskymod::symmatvec().

Referenced by funcmod::func_kriging_grad(), and krigingwrapper().

 All Classes Namespaces Files Functions Variables