function [logmax,dL]=nolin1d_grad_optag_3hyp_schur(x,M,y) % NOLIN1D_GRAD_OPTAG_3HYP_SCHUR This optimisation script uses only % GRADIENT information to perform Gaussian Process prior model optimisation % for time-series data, i.e. one-dimensional data, [M,y] with M as the % input and y as the output. Hessian is approximated by finite-differencing % using MATLAB operation. % The hyperparamters, g represents the length-scale, and V, the noise % variance, and a the data correlation. % % This is a fast algorithm using Generalised Schur algorithm to perform % computation task, impossible by standard MATLAB command. % % [logmax,dL] = NOLIN1D_GRAD_OPTAG_3HYP_SCHUR(x,M,y) % % Inputs: M : one-dimensional input column vector % y : one-dimensional output column vector % x : hyperparameter for GP, x = [a g V] for training % % Outputs: logmax = log likelihood function value % dL = gradient vector value % % % (C) Gaussian Process Schur Toolbox 1.0 % (C) Copyright 2005-2007, Keith Neo % http://www.hamilton.ie N0=size(M,1); a=exp(x(1)); g=exp(x(2)); V=exp(x(3)); G=get_eigen_block_trace(M,[a g a*V]); [trq2,bdQb,dQb,invB,logdet,tr,yQy,yQQy]=schur_invbtrace3(G,y); logmax=logdet+yQy; dL=zeros(3,1); dL(1,1)=N0-yQy; dL(2,1)=trq2-bdQb; dL(3,1)=a*V*(tr-yQQy);