covlinone.m

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

M
29
字号
function [A, B] = covLINone(logtheta, x, z);% Linear covariance function with a single hyperparameter. The covariance% function is parameterized as:%% k(x^p,x^q) = x^p'*inv(P)*x^q + 1./t2;%% where the P matrix is t2 times the unit matrix. The second term plays the% role of the bias. The hyperparameter is:%% logtheta = [ log(sqrt(t2)) ]%% For more help on design of covariance functions, try "help covFunctions".%% (C) Copyright 2006 by Carl Edward Rasmussen (2006-03-27)if nargin == 0, A = '1'; return; end              % report number of parametersit2 = exp(-2*logtheta);                                            % t2 inverseif nargin == 2                                             % compute covariance  A = it2*(1+x*x');elseif nargout == 2                              % compute test set covariances  A = it2*(1+sum(z.*z,2));  B = it2*(1+x*z');else                                                % compute derivative matrix  A = -2*it2*(1+x*x');end

⌨️ 快捷键说明

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