0001 function g=gcv(varargin) 0002 0003 fit = locfit(varargin{:}); 0004 rs = rsum(fit); 0005 0006 df0 = rs(1); 0007 df1 = rs(2); 0008 llk = rs(3); 0009 n = size(fit.data.x,1); 0010 gc = -2*n*llk/((n-df0)^2); 0011 g = [llk df0 df1 gc]; 0012 0013 return;