Code covered by the BSD License  

Highlights from
regtools

image thumbnail
from regtools by Per Christian Hansen
Analysis and Solution of Discrete Ill-Posed Problems.

gcvfun(lambda,s2,beta,delta0,mn,dsvd)
function G = gcvfun(lambda,s2,beta,delta0,mn,dsvd)

% Auxiliary routine for gcv.  PCH, IMM, Feb. 24, 2008.

% Note: f = 1 - filter-factors.
if (nargin==5)
   f = (lambda^2)./(s2 + lambda^2);
else
   f = lambda./(s2 + lambda);
end
G = (norm(f.*beta)^2 + delta0)/(mn + sum(f))^2;

Contact us at files@mathworks.com