ForK Library
Functions/Subroutines

krigingfuncpredict.f90 File Reference

Subroutine to Predict mean function values from Kriging Surface (requires buildkriging to be called first) More...

Go to the source code of this file.

Functions/Subroutines

subroutine krigingfuncpredict (ndim, ntot, X, stot, H, beta, V, hyper, mtot, Xm, Hm, Ym, covarflagi)
 Model predictions throughout the domain are determined by sampling from the conditional distribution \(y_* | \vec{X},Y\) using the covariance between points in the domain where \(\vec{X},Y\) are the input and output training data. The posterior mean predictions for an explicit mean are given by the formula:

\[ y(\vec{x}_{*}) | \vec{X},Y,m(x) = m(\vec{x}_{*}) + k_*^T K^{-1} (Y-m(\vec{x}_{*})) \]

where \(k_{*}^{T}\) represents the covariance between the test point, \(\vec{x}_{*}\), and the training points \(\vec{X}\) (a row vector of length ntot).
For a regression mean function, the function predictions take the form of:

\[ y(\vec{x}_{*}) | \vec{X},Y,\beta = h^{T}(\vec{x}_{*}) \beta + k_*^T K^{-1} (Y-H^{T} \beta) \]

The regression parameters \(\beta\) and the hyperparamters in the covariance function are supplied by the subroutine buildkriging. Using only this data, function predictions can be made; however, the construction and inverse of the covariance matrix can make the function predictions expensive. Because this matrix is inverted during the construction of the Kriging model, this work can be re-used for function predictions. Defining the processed data \(V\) as:

\[ V = K^{-1} (Y - H^{T} \beta) \]

the function predictions are given by:

\[ y(\vec{x}_{*}) | \vec{X},Y,\beta = h^{T}(\vec{x}_{*}) \beta + k_*^T V \]



Detailed Description

Subroutine to Predict mean function values from Kriging Surface (requires buildkriging to be called first)

Definition in file krigingfuncpredict.f90.


Function Documentation

subroutine krigingfuncpredict ( integer,intent(in)  ndim,
integer,intent(in)  ntot,
real(8),dimension(ndim,ntot),intent(in)  X,
integer,intent(in)  stot,
real(8),dimension(stot,ntot),intent(in)  H,
real(8),dimension(stot),intent(in)  Beta,
real(8),dimension(ntot),intent(in)  V,
real(8),dimension(ndim+2),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)  Ym,
integer,intent(in)  covarflagi 
)

Model predictions throughout the domain are determined by sampling from the conditional distribution \(y_* | \vec{X},Y\) using the covariance between points in the domain where \(\vec{X},Y\) are the input and output training data. The posterior mean predictions for an explicit mean are given by the formula:

\[ y(\vec{x}_{*}) | \vec{X},Y,m(x) = m(\vec{x}_{*}) + k_*^T K^{-1} (Y-m(\vec{x}_{*})) \]

where \(k_{*}^{T}\) represents the covariance between the test point, \(\vec{x}_{*}\), and the training points \(\vec{X}\) (a row vector of length ntot).
For a regression mean function, the function predictions take the form of:

\[ y(\vec{x}_{*}) | \vec{X},Y,\beta = h^{T}(\vec{x}_{*}) \beta + k_*^T K^{-1} (Y-H^{T} \beta) \]

The regression parameters \(\beta\) and the hyperparamters in the covariance function are supplied by the subroutine buildkriging. Using only this data, function predictions can be made; however, the construction and inverse of the covariance matrix can make the function predictions expensive. Because this matrix is inverted during the construction of the Kriging model, this work can be re-used for function predictions. Defining the processed data \(V\) as:

\[ V = K^{-1} (Y - H^{T} \beta) \]

the function predictions are given by:

\[ y(\vec{x}_{*}) | \vec{X},Y,\beta = h^{T}(\vec{x}_{*}) \beta + k_*^T V \]

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)stot : Number of Terms in the regression
in)H: The collocation matrix for the regression (size=[stotxntot])
in) beta: Regression coefficients based on the optimal estimate for the Kriging model (size=[stot])
Supplied by buildkriging subroutine
in)V: Processed Training Data (size=[ntot])
Supplied by buildkriging subroutine
in)hyper: Hyperparameters for the Kriging Model (size=[ndim+2])
Supplied by buildkriging 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 (size=[stotxmtot])
out)Ym: The predicted function values (size=[mtot])
Using the processed data V, predicting function values is essentially linear with respect to the number of test points so mtot can be set to one and this subroutine can be called multiple times.
Often the function values at a set of test points is required, hence the ability to make the predictions in a single function call.
in)covarflagi: Flag to govern which covariance function is used

  • covarflag==0 Uses Matern function with \(\nu=1/2\)
  • 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. For function only Kriging, all three options are available.
Must supply the same covariance flag as used in buildkriging.

Definition at line 52 of file krigingfuncpredict.f90.

References covars::covarflag.

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

 All Classes Namespaces Files Functions Variables