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

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function [covp, covf] = gpcovarp(net, x1, x2)
Daniel@0 2 %GPCOVARP Calculate the prior covariance for a Gaussian Process.
Daniel@0 3 %
Daniel@0 4 % Description
Daniel@0 5 %
Daniel@0 6 % COVP = GPCOVARP(NET, X1, X2) takes a Gaussian Process data structure
Daniel@0 7 % NET together with two matrices X1 and X2 of input vectors, and
Daniel@0 8 % computes the matrix of the prior covariance. This is the function
Daniel@0 9 % component of the covariance plus the exponential of the bias term.
Daniel@0 10 %
Daniel@0 11 % [COVP, COVF] = GPCOVARP(NET, X1, X2) also returns the function
Daniel@0 12 % component of the covariance.
Daniel@0 13 %
Daniel@0 14 % See also
Daniel@0 15 % GP, GPCOVAR, GPCOVARF, GPERR, GPGRAD
Daniel@0 16 %
Daniel@0 17
Daniel@0 18 % Copyright (c) Ian T Nabney (1996-2001)
Daniel@0 19
Daniel@0 20 errstring = consist(net, 'gp', x1);
Daniel@0 21 if ~isempty(errstring);
Daniel@0 22 error(errstring);
Daniel@0 23 end
Daniel@0 24
Daniel@0 25 if size(x1, 2) ~= size(x2, 2)
Daniel@0 26 error('Number of variables in x1 and x2 must be the same');
Daniel@0 27 end
Daniel@0 28
Daniel@0 29 covf = gpcovarf(net, x1, x2);
Daniel@0 30 covp = covf + exp(net.bias);