covnoise.m

来自「高斯过程在回归和分类问题中的应用」· M 代码 · 共 29 行

M
29
字号
function [A, B] = covNoise(logtheta, x, z);% Independent covariance function, ie "white noise", with specified variance.% The covariance function is specified as:%% k(x^p,x^q) = s2 * \delta(p,q)%% where s2 is the noise variance and \delta(p,q) is a Kronecker delta function% which is 1 iff p=q and zero otherwise. The hyperparameter is%% logtheta = [ log(sqrt(s2)) ]%% For more help on design of covariance functions, try "help covFunctions".%% (C) Copyright 2006 by Carl Edward Rasmussen, 2006-03-24.if nargin == 0, A = '1'; return; end              % report number of parameterss2 = exp(2*logtheta);                                          % noise varianceif nargin == 2                                      % compute covariance matrix  A = s2*eye(size(x,1));elseif nargout == 2                              % compute test set covariances  A = s2;  B = 0;                               % zeros cross covariance by independenceelse                                                % compute derivative matrix  A = 2*s2*eye(size(x,1));end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?