annotate toolboxes/FullBNT-1.0.7/netlab3.3/gpcovarp.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function [covp, covf] = gpcovarp(net, x1, x2)
wolffd@0 2 %GPCOVARP Calculate the prior covariance for a Gaussian Process.
wolffd@0 3 %
wolffd@0 4 % Description
wolffd@0 5 %
wolffd@0 6 % COVP = GPCOVARP(NET, X1, X2) takes a Gaussian Process data structure
wolffd@0 7 % NET together with two matrices X1 and X2 of input vectors, and
wolffd@0 8 % computes the matrix of the prior covariance. This is the function
wolffd@0 9 % component of the covariance plus the exponential of the bias term.
wolffd@0 10 %
wolffd@0 11 % [COVP, COVF] = GPCOVARP(NET, X1, X2) also returns the function
wolffd@0 12 % component of the covariance.
wolffd@0 13 %
wolffd@0 14 % See also
wolffd@0 15 % GP, GPCOVAR, GPCOVARF, GPERR, GPGRAD
wolffd@0 16 %
wolffd@0 17
wolffd@0 18 % Copyright (c) Ian T Nabney (1996-2001)
wolffd@0 19
wolffd@0 20 errstring = consist(net, 'gp', x1);
wolffd@0 21 if ~isempty(errstring);
wolffd@0 22 error(errstring);
wolffd@0 23 end
wolffd@0 24
wolffd@0 25 if size(x1, 2) ~= size(x2, 2)
wolffd@0 26 error('Number of variables in x1 and x2 must be the same');
wolffd@0 27 end
wolffd@0 28
wolffd@0 29 covf = gpcovarf(net, x1, x2);
wolffd@0 30 covp = covf + exp(net.bias);