wolffd@0: function [covp, covf] = gpcovarp(net, x1, x2) wolffd@0: %GPCOVARP Calculate the prior covariance for a Gaussian Process. wolffd@0: % wolffd@0: % Description wolffd@0: % wolffd@0: % COVP = GPCOVARP(NET, X1, X2) takes a Gaussian Process data structure wolffd@0: % NET together with two matrices X1 and X2 of input vectors, and wolffd@0: % computes the matrix of the prior covariance. This is the function wolffd@0: % component of the covariance plus the exponential of the bias term. wolffd@0: % wolffd@0: % [COVP, COVF] = GPCOVARP(NET, X1, X2) also returns the function wolffd@0: % component of the covariance. wolffd@0: % wolffd@0: % See also wolffd@0: % GP, GPCOVAR, GPCOVARF, GPERR, GPGRAD wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: wolffd@0: errstring = consist(net, 'gp', x1); wolffd@0: if ~isempty(errstring); wolffd@0: error(errstring); wolffd@0: end wolffd@0: wolffd@0: if size(x1, 2) ~= size(x2, 2) wolffd@0: error('Number of variables in x1 and x2 must be the same'); wolffd@0: end wolffd@0: wolffd@0: covf = gpcovarf(net, x1, x2); wolffd@0: covp = covf + exp(net.bias);